:root { --bg: #f8fafc; --fg: #0f172a; --line: #e2e8f0; --accent: #2563eb; }
* { box-sizing: border-box; }
body { margin: 0; font: 15px/1.45 system-ui, -apple-system, "Segoe UI", sans-serif;
       background: var(--bg); color: var(--fg); }

.topbar { display: flex; align-items: center; justify-content: space-between;
          gap: 12px; padding: 10px 16px; background: #fff;
          border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.brand { font-weight: 600; text-decoration: none; color: inherit; }
.topbar nav { display: flex; align-items: center; gap: 12px; }
.inline { display: inline; }
.who { color: #64748b; }

main { padding: 16px; max-width: 1100px; margin: 0 auto; }
.footer { padding: 12px 16px; color: #94a3b8; text-align: center; font-size: 13px; }

.card { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 20px; }
.login { max-width: 360px; margin: 40px auto; }
.error { color: #b91c1c; }

label { display: block; margin: 10px 0; }
label.row { display: flex; align-items: center; gap: 8px; }
input, textarea, select { width: 100%; padding: 8px; border: 1px solid var(--line);
                          border-radius: 6px; font: inherit; }
label.row input[type=checkbox] { width: auto; }
button { padding: 8px 14px; border: 0; border-radius: 6px; background: var(--accent);
         color: #fff; font: inherit; cursor: pointer; }
button#btn-cancel { background: #64748b; }
button#btn-delete { background: #b91c1c; }

.filters { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 12px; }
.chip { display: inline-flex; align-items: center; gap: 6px; margin: 0;
        background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 4px 10px; }
.chip input { width: auto; }
.swatch { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }

#calendar { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 10px; }

dialog { border: 0; border-radius: 12px; padding: 20px; max-width: 460px; width: 92vw; }
dialog::backdrop { background: rgba(15, 23, 42, .45); }
.actions { display: flex; justify-content: flex-end; gap: 8px; padding: 0; margin: 16px 0 0; }
fieldset { border: 1px solid var(--line); border-radius: 8px; margin: 12px 0; }

.users { width: 100%; border-collapse: collapse; }
.users th, .users td { text-align: left; padding: 8px; border-bottom: 1px solid var(--line); }
.hint { color: #64748b; font-size: 13px; }

.row-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.inline-form { display: flex; gap: 6px; align-items: center; margin: 0; }
.inline-form input { width: 150px; }
button.danger { background: #b91c1c; }
.new-user { max-width: 360px; margin-top: 20px; }

@media (max-width: 640px) {
  main { padding: 10px; }
  .card { padding: 14px; }
  .users thead { display: none; }
  .users tr { display: block; border-bottom: 1px solid var(--line); padding: 8px 0; }
  .users td { display: block; border: 0; padding: 4px 0; }
  .inline-form input { width: 100%; }
}

/* И4: деактивированный участник видим, но не редактируем — иначе событие,
   у которого все участники деактивированы, исчезало бы у всех навсегда. */
.chip.inactive, label.row.inactive { opacity: 0.55; }
.chip.inactive { text-decoration: line-through; }
