:root {
  --bg: #eceef3;
  --bg-soft: #f5f6f9;
  --shell: #ffffff;
  --sidebar: #ffffff;
  --sidebar-text: #6b7280;
  --primary: #e8437a;
  --primary-soft: #ffe4ee;
  --primary-hover: #d6336c;
  --accent-blue: #5b8def;
  --accent-blue-soft: #e8f0fe;
  --accent-gold: #e8b84a;
  --ink: #111827;
  --card: #ffffff;
  --border: #e8eaef;
  --text: #1f2937;
  --muted: #8b93a7;
  --success: #22a06b;
  --success-soft: #e3f7ed;
  --warning: #d97706;
  --warning-soft: #fff4e0;
  --danger: #e11d48;
  --danger-soft: #ffe4ea;
  --radius: 18px;
  --radius-sm: 12px;
  --radius-pill: 999px;
  --shadow: 0 1px 2px rgba(17, 24, 39, 0.04), 0 8px 24px rgba(17, 24, 39, 0.04);
  --shadow-lg: 0 12px 40px rgba(17, 24, 39, 0.1);
  --font: "Manrope", system-ui, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.hidden { display: none !important; }
.screen { min-height: 100vh; }

/* Login */
#login-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background:
    radial-gradient(ellipse at 20% 10%, rgba(232, 67, 122, 0.18), transparent 45%),
    radial-gradient(ellipse at 85% 80%, rgba(91, 141, 239, 0.16), transparent 40%),
    var(--bg);
}

.login-card {
  background: var(--card);
  padding: 2.25rem;
  border-radius: 28px;
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 420px;
  border: 1px solid rgba(255, 255, 255, 0.8);
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.75rem;
}

.brand-mark {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  background: var(--ink);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.15rem;
  flex-shrink: 0;
}

.login-card h1 { font-size: 1.55rem; font-weight: 800; letter-spacing: -0.02em; }
.subtitle { color: var(--muted); font-size: .9rem; margin-top: .15rem; }

.login-card label {
  display: block;
  margin-bottom: 1rem;
  font-size: .8rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .04em;
}

.login-card input {
  display: block;
  width: 100%;
  margin-top: .4rem;
  padding: .75rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-family: inherit;
  background: var(--bg-soft);
  color: var(--text);
  transition: border-color .15s, box-shadow .15s;
}

.login-card input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
  background: #fff;
}

.login-card button[type=submit] {
  width: 100%;
  padding: .85rem;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-pill);
  font-size: 1rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  margin-top: .5rem;
  transition: background .15s, transform .1s;
}

.login-card button[type=submit]:hover { background: var(--primary-hover); }
.login-card button[type=submit]:active { transform: scale(0.99); }
.error { color: var(--danger); font-size: .875rem; margin-top: .75rem; }

/* App shell */
#app {
  padding: 14px;
  min-height: 100vh;
}

.app-shell {
  display: flex;
  background: var(--shell);
  border-radius: 28px;
  height: calc(100vh - 28px);
  min-height: calc(100vh - 28px);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.sidebar {
  width: 248px;
  background: var(--sidebar);
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  border-right: 1px solid var(--border);
  padding: 1.25rem 0.9rem 1rem;
  height: 100%;
  position: sticky;
  top: 0;
  overflow: hidden;
}

.brand {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .35rem .55rem 1.25rem;
}

.brand .brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 14px;
  font-size: 1rem;
}

.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-text strong { color: var(--ink); font-size: .95rem; font-weight: 800; }
.brand-text small { color: var(--muted); font-size: .72rem; }

.sidebar nav {
  flex: 1;
  overflow-y: auto;
  padding: 0 .15rem;
  min-height: 0;
}

.sidebar .logout {
  flex-shrink: 0;
  margin-top: .5rem;
}

.nav-label {
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: #a0a8b8;
  padding: .85rem .7rem .35rem;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: .65rem;
  width: 100%;
  text-align: left;
  padding: .65rem .75rem;
  background: none;
  border: none;
  color: var(--sidebar-text);
  font-size: .9rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  border-radius: 12px;
  transition: background .15s, color .15s;
  margin-bottom: 2px;
}

.nav-icon {
  width: 1.4rem;
  text-align: center;
  opacity: .7;
  font-size: .95rem;
}

.nav-item:hover {
  background: var(--bg-soft);
  color: var(--ink);
}

.nav-item.active {
  background: var(--primary-soft);
  color: var(--primary);
}

.nav-item.active .nav-icon { opacity: 1; }

.logout {
  margin-top: .75rem;
  padding: .7rem 1rem;
  background: var(--bg-soft);
  border: none;
  color: var(--muted);
  border-radius: var(--radius-pill);
  cursor: pointer;
  font-size: .85rem;
  font-weight: 600;
  font-family: inherit;
  transition: background .15s, color .15s;
}

.logout:hover { background: var(--danger-soft); color: var(--danger); }

.main-column {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  background: var(--bg-soft);
  overflow: hidden;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 1.1rem 1.5rem;
  background: transparent;
}

.topbar h2 {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--ink);
  white-space: nowrap;
}

.topbar-search {
  flex: 1;
  min-width: 180px;
  max-width: 420px;
  display: flex;
  align-items: center;
  gap: .5rem;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: .55rem 1rem;
  box-shadow: 0 1px 2px rgba(17, 24, 39, 0.03);
}

.topbar-search .search-icon {
  color: var(--muted);
  font-size: 1rem;
}

.topbar-search input {
  border: none;
  outline: none;
  width: 100%;
  font-family: inherit;
  font-size: .9rem;
  background: transparent;
  color: var(--text);
}

.topbar-search input::placeholder { color: #b0b6c4; }

.topbar-actions {
  display: flex;
  gap: .45rem;
  flex-wrap: wrap;
  align-items: center;
  margin-left: auto;
}

.role-badge {
  font-size: .72rem;
  font-weight: 700;
  padding: .4rem .75rem;
  border-radius: var(--radius-pill);
  background: #fff;
  border: 1px solid var(--border);
  color: var(--muted);
  white-space: nowrap;
}

.content {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}

.view {
  padding: 0 1.5rem 1.5rem;
  flex: 1;
  overflow-y: auto;
}

/* Cards & tables */
.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid rgba(232, 234, 239, 0.8);
  padding: 1.25rem 1.35rem;
  margin-bottom: 1rem;
}

.card h3 {
  font-size: .95rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  margin-bottom: 1rem;
  color: var(--ink);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  padding: .55rem 1.05rem;
  border-radius: var(--radius-pill);
  border: none;
  font-size: .84rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: background .15s, transform .1s, box-shadow .15s;
}

.btn:active { transform: scale(0.98); }

.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 4px 14px rgba(232, 67, 122, 0.28);
}
.btn-primary:hover { background: var(--primary-hover); }

.btn-secondary {
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--border);
}
.btn-secondary:hover { background: var(--bg-soft); }

.btn-danger {
  background: var(--ink);
  color: #fff;
  border: none;
}
.btn-danger:hover { background: #000; filter: none; }

.btn-sm {
  padding: .35rem .75rem;
  font-size: .78rem;
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: .875rem;
}

th, td {
  padding: .8rem .75rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

th {
  font-weight: 700;
  color: var(--muted);
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .04em;
}

tr:last-child td { border-bottom: none; }
tr:hover td { background: #fafbfd; }

.info-block { margin-top: .85rem; }
.info-block strong { display: block; margin-bottom: .35rem; }
.pre-line {
  white-space: pre-line;
  line-height: 1.45;
  color: var(--text);
}

th.sortable {
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}
th.sortable:hover { color: var(--text); }
th.sortable::after {
  content: " ↕";
  color: var(--primary);
  font-size: .95rem;
  font-weight: 800;
  letter-spacing: 0;
  opacity: .7;
}
th.sortable:hover::after { opacity: 1; }
th.sortable.sort-asc::after,
th.sortable.sort-desc::after { opacity: 1; }
th.sortable.sort-asc::after { content: " ↑"; }
th.sortable.sort-desc::after { content: " ↓"; }

.clickable-row { cursor: pointer; }
.clickable-row:hover td { background: var(--primary-soft); }

/* Предстоящие сверху, проведённые ниже: подпись раздела — как заголовок таблицы (без плашек),
   прошедшие строки — приглушённым текстом, без заливки */
.list-section-divider td {
  padding: 1.15rem .75rem .45rem;
  border-bottom: 1px solid var(--line);
  background: transparent;
  cursor: default;
}
.list-section-divider:first-child td { padding-top: .35rem; }
.list-section-label {
  display: inline-flex; align-items: baseline; gap: .45rem;
  font-family: var(--mono); font-size: .64rem; font-weight: 500;
  letter-spacing: .07em; text-transform: uppercase; color: var(--muted);
}
.list-section-label b { font-weight: 600; color: var(--ink); }
.list-row-past td { color: var(--muted); }
.list-row-past td strong { color: var(--text); font-weight: 600; }
.list-row-past td.num.is-warn { color: var(--muted); }   /* у прошедших «без ответа» — уже не сигнал */

.badge {
  display: inline-block;
  padding: .22rem .65rem;
  border-radius: var(--radius-pill);
  font-size: .72rem;
  font-weight: 700;
}

.badge-confirmed { background: var(--success-soft); color: #0f6b45; }
.badge-declined { background: var(--danger-soft); color: #9f1239; }
.badge-sent, .badge-no_response { background: var(--warning-soft); color: #92400e; }
.badge-representative { background: var(--accent-blue-soft); color: #1e40af; }
.badge-late { background: #efe9ff; color: #5b21b6; }
.badge-draft { background: #f1f5f9; color: #475569; }
.badge-scheduled { background: var(--success-soft); color: #0f6b45; }
.badge-cancelled { background: var(--danger-soft); color: #9f1239; }
.badge-archived { background: #f1f5f9; color: #475569; }
.badge-completed { background: var(--bg-soft); color: var(--muted); box-shadow: inset 0 0 0 1px var(--line); }
.badge-rescheduled { background: var(--warning-soft); color: #92400e; }

.row-actions {
  display: flex;
  gap: .35rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.badge-requested, .badge-received, .badge-moderating { background: var(--accent-blue-soft); color: #1e40af; }
.badge-accepted { background: var(--success-soft); color: #0f6b45; }
.badge-needs_revision { background: var(--warning-soft); color: #92400e; }
.badge-rejected, .badge-not_submitted { background: var(--danger-soft); color: #9f1239; }
.badge-viewed, .badge-delivered { background: #f1f5f9; color: #475569; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }

.stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.15rem 1.25rem;
  box-shadow: var(--shadow);
  text-align: left;
  position: relative;
  overflow: hidden;
}

.stat-card::after {
  content: "";
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--primary);
  opacity: .35;
}

.stat-card:nth-child(2)::after { background: var(--accent-blue); }
.stat-card:nth-child(3)::after { background: var(--accent-gold); }

.stat-card .value {
  font-size: 1.85rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--ink);
  line-height: 1.1;
}

.stat-card .label {
  font-size: .78rem;
  font-weight: 600;
  color: var(--muted);
  margin-top: .4rem;
}

.form-group { margin-bottom: 1rem; }
.form-group label {
  display: block;
  font-size: .8rem;
  font-weight: 700;
  margin-bottom: .4rem;
  color: var(--text);
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: .65rem .85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: .9rem;
  font-family: inherit;
  background: var(--bg-soft);
  transition: border-color .15s, box-shadow .15s, background .15s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
  background: #fff;
}

.form-group textarea { min-height: 80px; resize: vertical; }
.form-actions { display: flex; gap: .5rem; margin-top: 1.25rem; flex-wrap: wrap; }

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(17, 24, 39, 0.35);
  backdrop-filter: blur(4px);
}

.modal-content {
  position: relative;
  background: var(--card);
  border-radius: 24px;
  padding: 1.75rem;
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}

.modal-close {
  position: absolute;
  top: .85rem;
  right: .85rem;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-soft);
  border: none;
  font-size: 1.25rem;
  cursor: pointer;
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close:hover { background: var(--danger-soft); color: var(--danger); }
.modal-content-lg { max-width: 840px; }

.form-section {
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}
.form-section:last-of-type { border-bottom: none; }
.form-section h4 { margin: 0 0 .75rem; font-size: 1rem; font-weight: 800; }
.form-hint { color: var(--muted); font-size: .875rem; margin: 0 0 .75rem; }

.contact-list-toolbar {
  display: flex;
  gap: .5rem;
  align-items: center;
  margin-bottom: .5rem;
  flex-wrap: wrap;
}

.contact-search {
  flex: 1;
  min-width: 160px;
  padding: .55rem .85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--bg-soft);
  font-family: inherit;
}

.contact-checklist {
  max-height: 220px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: .5rem;
  background: var(--bg-soft);
}
.contact-checklist-tall { max-height: 420px; }
.contact-check-item.is-checked { background: #fff; box-shadow: inset 3px 0 0 var(--primary); }
.vks-toggle {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  font-size: .78rem;
  font-weight: 700;
  color: var(--accent-blue);
  white-space: nowrap;
  margin-left: .35rem;
  flex-shrink: 0;
}
.vks-toggle input { margin: 0; }
.picked-chips {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  margin: .35rem 0 .5rem;
  min-height: 0;
}
.picked-panel {
  margin: 0 0 .85rem;
  padding: .75rem .9rem;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--bg-soft);
}
.picked-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  margin-bottom: .55rem;
}
.picked-panel-head strong {
  font-size: .88rem;
  color: var(--ink, var(--text));
}
.picked-empty {
  margin: 0;
  color: var(--muted);
  font-size: .82rem;
  font-weight: 600;
}
.picked-chip {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  max-width: 100%;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  border-radius: 999px;
  padding: .35rem .55rem .35rem .75rem;
  font: inherit;
  font-size: .8rem;
  font-weight: 700;
  cursor: pointer;
  text-align: left;
}
.picked-chip:hover {
  border-color: var(--danger, #e11d48);
  color: var(--danger, #e11d48);
}
.picked-chip span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 280px;
}
.picked-chip-x {
  flex: 0 0 auto;
  width: 1.1rem;
  height: 1.1rem;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-soft);
  font-size: .95rem;
  line-height: 1;
  color: var(--muted);
}
.picked-chip:hover .picked-chip-x {
  background: var(--danger-soft, #ffe4ea);
  color: var(--danger, #e11d48);
}
.picker-group-row {
  display: flex;
  gap: .5rem;
  align-items: center;
  margin-bottom: .6rem;
  flex-wrap: wrap;
}
.picker-group-row select { flex: 1; min-width: 180px; }

.contact-check-item {
  display: flex;
  align-items: flex-start;
  gap: .65rem;
  padding: .55rem;
  border-radius: 10px;
  cursor: pointer;
}
.contact-check-item > input[type=checkbox] {
  flex: 0 0 auto;
  width: 1.05rem;
  height: 1.05rem;
  margin: .2rem 0 0;
}
.contact-check-item:hover { background: #fff; }
.contact-check-item.is-checked {
  background: #fff;
  box-shadow: inset 3px 0 0 var(--primary);
}
.contact-check-item strong { display: block; }
.contact-check-item small { display: block; color: var(--muted); font-size: .8rem; }
.contact-warn { color: var(--danger) !important; }
.contact-ok { color: var(--success) !important; }

/* Модалка «Запрос справок» */
.brief-request-form .brief-picker { margin: 0 0 1rem; }
.brief-pick-list {
  max-height: 260px;
}
.brief-pick-item {
  align-items: center;
  margin: 0;
  width: 100%;
  box-sizing: border-box;
}
.brief-pick-body {
  flex: 1 1 auto;
  min-width: 0;
}
.brief-pick-body strong {
  font-size: .92rem;
  line-height: 1.25;
}
.brief-pick-item + .brief-pick-item {
  margin-top: .15rem;
}

.reminder-create-table { width: 100%; font-size: .875rem; border-collapse: collapse; }
.reminder-create-table th, .reminder-create-table td {
  padding: .45rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
}
.reminder-create-table input[type=text],
.reminder-create-table select {
  width: 100%;
  padding: .4rem .55rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: inherit;
  background: var(--bg-soft);
}

.reminder-cards {
  display: flex;
  flex-direction: column;
  gap: .75rem;
}

.reminder-card {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: .9rem 1rem;
  transition: border-color .15s ease, box-shadow .15s ease, opacity .15s ease;
}

.reminder-card:hover {
  border-color: #d5dae5;
  box-shadow: 0 2px 10px rgba(17, 24, 39, 0.04);
}

.reminder-card-off {
  opacity: .72;
}

.reminder-card-sent {
  background: linear-gradient(180deg, #f3fbf7 0%, var(--bg-soft) 48%);
}

.reminder-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  margin-bottom: .75rem;
  flex-wrap: wrap;
}

.reminder-card-title {
  display: flex;
  align-items: center;
  gap: .5rem;
  flex-wrap: wrap;
}

.reminder-card-actions {
  display: flex;
  align-items: center;
  gap: .55rem;
}

.reminder-type-chip {
  display: inline-flex;
  align-items: center;
  padding: .28rem .7rem;
  border-radius: var(--radius-pill);
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .01em;
  background: #e8ecf4;
  color: #374151;
}

.reminder-type-start {
  background: var(--accent-blue-soft);
  color: #1d4ed8;
}

.reminder-type-brief {
  background: #fff4e0;
  color: #92400e;
}

.reminder-type-deadline {
  background: #ecfdf5;
  color: #047857;
}

#brief-deadline-card .brief-deadline-grid {
  grid-template-columns: minmax(7rem, 9rem) minmax(12rem, 1fr);
}

#brief-deadline-card .reminder-field-wide {
  grid-column: auto;
}

#brief-deadline-card input[readonly] {
  background: #f8fafc;
  color: var(--ink, #111827);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.reminder-type-custom {
  background: var(--primary-soft);
  color: #be185d;
}

.reminder-card-grid {
  display: grid;
  grid-template-columns: minmax(7rem, 9rem) minmax(10rem, 1fr) minmax(12rem, 1.4fr);
  gap: .65rem .75rem;
  align-items: end;
}

.reminder-field {
  display: flex;
  flex-direction: column;
  gap: .3rem;
  min-width: 0;
}

.reminder-field > span {
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--muted);
}

.reminder-field input[type=text],
.reminder-field input[type=number],
.reminder-field select,
.reminder-hours-wrap input {
  width: 100%;
  padding: .5rem .65rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-family: inherit;
  font-size: .875rem;
  background: #fff;
  color: var(--text);
}

.reminder-field input:focus,
.reminder-field select:focus,
.reminder-hours-wrap input:focus {
  outline: none;
  border-color: #c9d4ea;
  box-shadow: 0 0 0 3px rgba(91, 141, 239, 0.15);
}

.reminder-hours-wrap {
  display: flex;
  align-items: center;
  gap: .4rem;
}

.reminder-hours-wrap input {
  max-width: 5.5rem;
}

.reminder-hours-unit {
  color: var(--muted);
  font-size: .85rem;
  font-weight: 600;
}

.reminder-card-extra {
  display: grid;
  grid-template-columns: repeat(2, minmax(8rem, 14rem));
  gap: .65rem .75rem;
  margin-top: .85rem;
  padding-top: .85rem;
  border-top: 1px dashed var(--border);
}

.reminder-switch {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  font-size: .82rem;
  color: var(--muted);
  cursor: pointer;
  user-select: none;
}

.reminder-switch input {
  width: 1rem;
  height: 1rem;
  accent-color: var(--primary);
}

.reminder-delete {
  width: 2rem;
  height: 2rem;
  padding: 0;
  border-radius: 999px;
  line-height: 1;
  font-size: 1rem;
}

@media (max-width: 900px) {
  .reminder-card-grid {
    grid-template-columns: 1fr 1fr;
  }
  .reminder-field-wide {
    grid-column: 1 / -1;
  }
  .reminder-card-extra {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 560px) {
  .reminder-card-grid,
  .reminder-card-extra {
    grid-template-columns: 1fr;
  }
}

.checkbox-inline {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: .9rem;
  cursor: pointer;
}

.risk-list { list-style: none; }
.risk-list li {
  padding: .55rem .75rem;
  margin-bottom: .4rem;
  color: #9f1239;
  font-size: .875rem;
  background: var(--danger-soft);
  border-radius: 10px;
}
.risk-list li::before { content: "• "; font-weight: 800; }

.empty {
  text-align: center;
  padding: 3rem 1.5rem;
  color: var(--muted);
  background: #fff;
  border-radius: var(--radius);
  border: 1px dashed var(--border);
}

.empty-state { color: var(--muted); font-size: .9rem; padding: .5rem 0; }

.dashboard-stats { margin-bottom: 1rem; }

.dashboard-alerts .alert {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .85rem 1rem;
  border-radius: 14px;
  margin-bottom: .55rem;
  font-size: .9rem;
  font-weight: 600;
}

.alert-danger { background: var(--danger-soft); color: #9f1239; }
.alert-warning { background: var(--warning-soft); color: #92400e; }

.bulk-toolbar { margin-bottom: .75rem; }
.export-group { display: inline-flex; gap: .35rem; flex-wrap: wrap; }

/* Detail card toolbar */
.detail-toolbar {
  padding: 1rem 1.15rem;
  margin-bottom: 1rem;
  display: flex;
  flex-direction: column;
  gap: .85rem;
}

.detail-toolbar-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  flex-wrap: wrap;
}

.detail-toolbar-status .badge {
  font-size: .78rem;
}

.btn-back {
  min-width: 7rem;
}

.detail-toolbar-section {
  display: flex;
  flex-direction: column;
  gap: .45rem;
}

.detail-toolbar-label {
  font-size: .72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--muted);
}

.detail-toolbar-btns {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
}

.export-select {
  width: 100%;
  max-width: 280px;
  min-height: 44px;
  padding: .55rem .85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-soft);
  font-family: inherit;
  font-size: .88rem;
  font-weight: 600;
  color: var(--text);
}

.notif-backdrop {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(17, 24, 39, 0.25);
  backdrop-filter: blur(2px);
}

.notif-backdrop.hidden {
  display: none !important;
}

.audit-filters,
.analytics-filters {
  display: flex;
  gap: .65rem;
  margin-bottom: .75rem;
  flex-wrap: wrap;
  align-items: center;
}

.audit-filters input,
.analytics-filters input {
  flex: 1;
  min-width: 140px;
  padding: .55rem .85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--bg-soft);
  font-family: inherit;
}

.analytics-filters label {
  font-size: .875rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: .35rem;
}

/* Help */
.help-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 1.25rem;
  align-items: start;
}

.help-toc {
  position: sticky;
  top: 0;
  max-height: calc(100vh - 8rem);
  overflow-y: auto;
  padding: 1rem 1.1rem;
}

.help-toc h3 { font-size: .95rem; margin-bottom: .75rem; font-weight: 800; }

.help-toc a {
  display: block;
  color: var(--muted);
  text-decoration: none;
  font-size: .85rem;
  font-weight: 600;
  padding: .4rem 0;
  border-bottom: 1px solid var(--border);
}

.help-toc a:last-child { border-bottom: none; }
.help-toc a:hover { color: var(--primary); }
.help-body { display: flex; flex-direction: column; gap: 1rem; }

.help-section h3 {
  font-size: 1.05rem;
  margin-bottom: .75rem;
  padding-bottom: .5rem;
  border-bottom: 1px solid var(--border);
  font-weight: 800;
}

.help-section p { margin-bottom: .65rem; font-size: .925rem; }
.help-section ul, .help-section ol {
  margin: 0 0 .75rem 1.25rem;
  font-size: .925rem;
}
.help-section li { margin-bottom: .35rem; }
.help-section table { margin: .5rem 0 0; }

.help-tip {
  background: var(--primary-soft);
  border-left: 3px solid var(--primary);
  padding: .65rem .85rem;
  border-radius: 0 12px 12px 0;
  color: #7a2148;
}

.help-faq dt {
  font-weight: 700;
  margin-top: .85rem;
  font-size: .925rem;
}

.help-faq dd {
  color: var(--muted);
  font-size: .9rem;
  margin: .25rem 0 0;
}

/* Dashboard hero (screenshot-inspired) */
.dash-hero {
  display: flex;
  gap: 1.5rem;
  align-items: stretch;
  flex-wrap: wrap;
  margin-bottom: 1rem;
  padding: 1.5rem 1.6rem !important;
}

.dash-hero-main { flex: 1; min-width: 180px; }
.dash-kicker {
  font-size: .78rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: .35rem;
}
.dash-hero-value {
  font-size: 3rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--ink);
  line-height: 1;
}
.dash-hero-label {
  margin-top: .4rem;
  color: var(--muted);
  font-weight: 600;
  font-size: .9rem;
}

.dash-hero-metrics {
  display: flex;
  gap: .75rem;
  flex-wrap: wrap;
  align-items: stretch;
}

.dash-mini {
  background: var(--bg-soft);
  border-radius: 16px;
  padding: 1rem 1.15rem;
  min-width: 120px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.dash-mini-dark {
  background: var(--ink);
  color: #fff;
}

.dash-mini-dark .dash-mini-label { color: rgba(255, 255, 255, 0.65); }
.dash-mini-label {
  font-size: .72rem;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: .35rem;
}
.dash-mini strong {
  font-size: 1.55rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}

/* Dashboard calendar */
.dash-calendar-layout {
  display: grid;
  grid-template-columns: minmax(280px, 1.1fr) minmax(240px, .9fr);
  gap: 1rem;
  margin-bottom: 1rem;
}

.cal-card { padding: 1.1rem 1.15rem 1.25rem; }

.cal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  margin-bottom: .85rem;
}

.cal-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.cal-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: .25rem;
  margin-bottom: .35rem;
}

.cal-weekdays span {
  text-align: center;
  font-size: .72rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: .3rem;
}

.cal-cell {
  position: relative;
  aspect-ratio: 1;
  min-height: 52px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: var(--bg-soft);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  padding: .35rem .4rem;
  font-family: inherit;
  transition: background .15s, border-color .15s, transform .12s;
}

.cal-cell:hover {
  background: #fff;
  border-color: var(--border);
}

.cal-empty {
  background: transparent;
  cursor: default;
  pointer-events: none;
}

.cal-day-num {
  font-size: .85rem;
  font-weight: 700;
  color: var(--text);
}

.cal-today {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.cal-today .cal-day-num { color: var(--primary); }

.cal-selected {
  background: #fff;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary) 25%, transparent);
}

.cal-has-events .cal-day-num { font-weight: 800; }

.cal-markers {
  display: flex;
  gap: 3px;
  align-items: center;
  margin-top: auto;
  flex-wrap: wrap;
}

.cal-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--primary);
}

.cal-dot-event { background: #2563eb; }

.cal-more {
  font-size: .65rem;
  font-weight: 700;
  color: var(--muted);
}

.cal-count {
  position: absolute;
  top: .3rem;
  right: .35rem;
  min-width: 1.1rem;
  height: 1.1rem;
  padding: 0 .25rem;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  font-size: .65rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.cal-day-panel h3 {
  margin: 0 0 .25rem;
  text-transform: capitalize;
}

.cal-day-sub {
  margin: 0 0 1rem;
  color: var(--muted);
  font-size: .85rem;
  font-weight: 600;
}

.cal-day-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: .5rem;
}

.cal-day-item {
  display: flex;
  gap: .75rem;
  align-items: flex-start;
  padding: .7rem .8rem;
  border-radius: 12px;
  background: var(--bg-soft);
  cursor: pointer;
  transition: background .15s;
}

.cal-day-item:hover { background: color-mix(in srgb, var(--primary) 8%, var(--bg-soft)); }

.cal-day-time {
  font-size: .9rem;
  font-weight: 800;
  color: var(--primary);
  min-width: 3rem;
  padding-top: .1rem;
}

.cal-day-body {
  display: flex;
  flex-direction: column;
  gap: .15rem;
  min-width: 0;
}

.cal-day-body strong {
  font-size: .92rem;
  font-weight: 750;
  line-height: 1.25;
}

.cal-day-body small {
  color: var(--muted);
  font-size: .78rem;
  font-weight: 600;
}

.cal-day-loc {
  color: var(--text) !important;
  opacity: .75;
}

@media (max-width: 900px) {
  .dash-calendar-layout {
    grid-template-columns: 1fr;
  }
}

.row-title {
  display: flex;
  align-items: center;
  gap: .65rem;
}

.row-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: .8rem;
  font-weight: 800;
  flex-shrink: 0;
}

.metric-pill {
  display: inline-flex;
  align-items: center;
  padding: .2rem .65rem;
  border-radius: var(--radius-pill);
  background: var(--bg-soft);
  font-weight: 700;
  font-size: .8rem;
  color: var(--ink);
}

@media (max-width: 960px) {
  .grid-3 { grid-template-columns: 1fr 1fr; }
  .topbar-search { max-width: none; order: 3; flex-basis: 100%; }
}

@media (max-width: 768px) {
  html {
    -webkit-text-size-adjust: 100%;
    height: 100%;
  }

  body {
    overflow-x: hidden;
    min-height: 100%;
    min-height: 100dvh;
  }

  .screen { min-height: 100dvh; }

  #login-screen {
    padding: max(1rem, env(safe-area-inset-top)) max(1rem, env(safe-area-inset-right))
      max(1rem, env(safe-area-inset-bottom)) max(1rem, env(safe-area-inset-left));
    align-items: center;
    justify-content: center;
  }

  .login-card {
    padding: 1.75rem 1.35rem;
    border-radius: 22px;
    width: 100%;
    max-width: 100%;
  }

  .login-card input {
    min-height: 48px;
    font-size: 16px;
  }

  .login-card button[type="submit"] {
    min-height: 48px;
    font-size: 1rem;
    width: 100%;
  }

  #app { padding: 0; }

  .app-shell {
    flex-direction: column;
    border-radius: 0;
    height: 100dvh;
    min-height: 100dvh;
    max-height: 100dvh;
    box-shadow: none;
  }

  /* Sidebar hidden — bottom tab bar instead */
  .sidebar { display: none !important; }

  .main-column {
    flex: 1;
    min-height: 0;
    padding-bottom: calc(56px + env(safe-area-inset-bottom, 0px));
  }

  .topbar {
    position: sticky;
    top: 0;
    z-index: 30;
    flex-wrap: wrap;
    gap: .5rem;
    padding: max(.65rem, env(safe-area-inset-top)) .85rem .65rem;
    background: rgba(245, 246, 249, 0.92);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
  }

  .topbar h2 {
    font-size: 1.05rem;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .topbar-search {
    display: flex;
    max-width: none;
    order: 3;
    flex-basis: 100%;
  }

  .topbar-actions {
    order: 10;
    flex-basis: 100%;
    margin-left: 0;
    gap: .4rem;
    flex-wrap: wrap;
  }

  .topbar-actions:empty { display: none; }

  .topbar-actions .btn {
    flex: 1 1 calc(50% - .25rem);
    min-width: 0;
    min-height: 44px;
    justify-content: center;
    font-size: .78rem;
    padding: .5rem .65rem;
  }

  .notif-wrap { flex-shrink: 0; }

  .notif-bell {
    width: 44px;
    height: 44px;
    font-size: 1.05rem;
  }

  .notif-panel {
    top: calc(52px + env(safe-area-inset-top, 0px));
    max-height: min(420px, 55dvh);
  }

  .detail-toolbar-btns .btn {
    flex: 1 1 calc(50% - .25rem);
    min-width: 0;
    justify-content: center;
    font-size: .78rem;
  }

  .export-select {
    max-width: none;
  }

  .role-badge {
    display: none;
  }

  .content {
    flex: 1;
    min-height: 0;
    overflow: hidden;
  }

  .view {
    padding: 0 .85rem max(1rem, env(safe-area-inset-bottom));
    -webkit-overflow-scrolling: touch;
  }

  .grid-2, .grid-3 { grid-template-columns: 1fr; }

  .card {
    padding: 1rem;
    border-radius: 16px;
    margin-bottom: .85rem;
  }

  .card:has(table) {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: .5rem;
  }

  .card table {
    min-width: 520px;
  }

  .help-layout { grid-template-columns: 1fr; }
  .help-toc { position: static; max-height: none; }

  .btn {
    min-height: 44px;
    padding: .6rem 1rem;
  }

  .btn-sm {
    min-height: 40px;
    padding: .45rem .85rem;
  }

  .form-actions {
    flex-direction: column;
  }

  .form-actions .btn {
    width: 100%;
  }

  .row-actions {
    justify-content: flex-start;
  }

  .row-actions .btn-sm {
    min-height: 40px;
  }

  .list-filters {
    padding: .65rem .75rem;
    gap: .45rem;
  }

  .list-filters input,
  .list-filters select {
    flex: 1 1 100%;
    min-width: 0;
    min-height: 44px;
  }

  .contact-list-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .contact-search {
    min-width: 0;
    min-height: 44px;
  }

  .audit-filters,
  .analytics-filters {
    flex-direction: column;
    align-items: stretch;
  }

  .audit-filters input,
  .analytics-filters input {
    min-width: 0;
    min-height: 44px;
    width: 100%;
  }

  .audit-filters .btn,
  .analytics-filters .btn {
    width: 100%;
  }

  .bulk-toolbar .btn {
    flex: 1 1 calc(50% - .25rem);
    min-width: 0;
  }

  .export-group {
    width: 100%;
  }

  .export-group .btn {
    flex: 1 1 calc(50% - .25rem);
    min-width: 0;
  }

  .dash-hero {
    padding: 1.15rem !important;
    gap: 1rem;
  }

  .dash-hero-value {
    font-size: 2.25rem;
  }

  .dash-hero-metrics {
    width: 100%;
  }

  .dash-mini {
    flex: 1 1 calc(50% - .4rem);
    min-width: 0;
  }

  .cal-grid {
    gap: 2px;
  }

  .cal-cell {
    min-height: 44px;
    font-size: .82rem;
  }

  .cal-day-item {
    min-height: 44px;
    padding: .65rem .75rem;
  }

  .cal-day-actions .btn {
    flex: 1 1 calc(50% - .25rem);
    min-width: 0;
  }

  .modal {
    padding: 0;
    align-items: flex-end;
  }

  .modal-content {
    max-width: none;
    width: 100%;
    max-height: 92dvh;
    border-radius: 20px 20px 0 0;
    padding: 1.25rem 1rem max(1.25rem, env(safe-area-inset-bottom));
  }

  .modal-close {
    width: 44px;
    height: 44px;
    top: .65rem;
    right: .65rem;
  }

  .detail-header {
    flex-direction: column;
    align-items: stretch !important;
    gap: .75rem;
  }

  .detail-header .btn {
    width: 100%;
  }

  .detail-actions {
    flex-direction: column;
  }

  .detail-actions .btn {
    width: 100%;
  }

  th, td {
    padding: .65rem .55rem;
    font-size: .82rem;
  }
}

/* Mobile bottom tab bar */
.mobile-tabbar {
  display: none;
}

@media (max-width: 768px) {
  .mobile-tabbar {
    display: flex;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 50;
    height: calc(56px + env(safe-area-inset-bottom, 0px));
    padding-bottom: env(safe-area-inset-bottom, 0px);
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid var(--border);
    box-shadow: 0 -4px 24px rgba(17, 24, 39, 0.06);
  }

  .mobile-tab {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .15rem;
    min-height: 56px;
    padding: .35rem .25rem;
    border: none;
    background: transparent;
    color: var(--muted);
    font-family: inherit;
    font-size: .62rem;
    font-weight: 700;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: color .15s;
  }

  .mobile-tab-icon {
    font-size: 1.15rem;
    line-height: 1;
  }

  .mobile-tab-label {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-tab.active {
    color: var(--primary);
  }

  .mobile-tab:active {
    opacity: .75;
  }
}

/* Mobile menu sheet */
.mobile-menu-sheet {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.mobile-menu-sheet.hidden {
  display: none !important;
}

.mobile-menu-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(17, 24, 39, 0.4);
  backdrop-filter: blur(2px);
}

.mobile-menu-panel {
  position: relative;
  width: 100%;
  max-height: 75dvh;
  background: #fff;
  border-radius: 20px 20px 0 0;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  box-shadow: var(--shadow-lg);
  animation: mobile-sheet-up .22s ease-out;
}

@keyframes mobile-sheet-up {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.mobile-menu-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1rem .75rem;
  border-bottom: 1px solid var(--border);
}

.mobile-menu-head strong {
  font-size: 1.05rem;
  font-weight: 800;
}

.mobile-menu-close {
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: var(--bg-soft);
  font-size: 1.4rem;
  line-height: 1;
  color: var(--muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.mobile-menu-items {
  display: flex;
  flex-direction: column;
  padding: .5rem 0;
  overflow-y: auto;
  max-height: calc(75dvh - 60px);
  -webkit-overflow-scrolling: touch;
}

.mobile-menu-item {
  display: flex;
  align-items: center;
  gap: .85rem;
  width: 100%;
  min-height: 52px;
  padding: .85rem 1.15rem;
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: .95rem;
  font-weight: 600;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.mobile-menu-item:active {
  background: var(--bg-soft);
}

.mobile-menu-item.active {
  color: var(--primary);
  background: var(--primary-soft);
}

.mobile-menu-icon {
  width: 28px;
  text-align: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.mobile-menu-logout {
  margin-top: .35rem;
  border-top: 1px solid var(--border);
  color: var(--danger);
}

@media (min-width: 769px) {
  .mobile-menu-sheet { display: none !important; }
}

/* Notifications */
.notif-wrap { position: relative; }
.notif-bell {
  width: 40px; height: 40px; border-radius: 50%;
  border: 1px solid var(--border); background: var(--bg-soft);
  cursor: pointer; position: relative; font-size: 1rem;
  display: inline-flex; align-items: center; justify-content: center;
}
.notif-bell:hover { border-color: var(--primary); color: var(--primary); }
.notif-badge {
  position: absolute; top: -2px; right: -2px;
  min-width: 18px; height: 18px; padding: 0 4px;
  border-radius: 999px; background: var(--primary); color: #fff;
  font-size: .65rem; font-weight: 800;
  display: inline-flex; align-items: center; justify-content: center;
}
.notif-panel {
  position: fixed;
  right: max(.75rem, env(safe-area-inset-right, 0px));
  left: max(.75rem, env(safe-area-inset-left, 0px));
  top: calc(56px + env(safe-area-inset-top, 0px));
  width: auto;
  max-width: 380px;
  margin-left: auto;
  max-height: min(420px, calc(100dvh - 72px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px)));
  overflow: auto;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  z-index: 95;
  -webkit-overflow-scrolling: touch;
}
.notif-panel-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: .75rem 1rem; border-bottom: 1px solid var(--border);
  position: sticky; top: 0; background: #fff;
}
.notif-list { display: flex; flex-direction: column; }
.notif-item {
  text-align: left; border: 0; border-bottom: 1px solid var(--border);
  background: transparent; padding: .75rem 1rem; cursor: pointer;
  display: flex; flex-direction: column; gap: .2rem; font-family: inherit;
}
.notif-item:hover { background: var(--bg-soft); }
.notif-item.unread { background: var(--primary-soft); }
.notif-item strong { font-size: .88rem; }
.notif-item span { font-size: .8rem; color: var(--text); white-space: pre-wrap; }
.notif-item small { color: var(--muted); font-size: .72rem; }

.list-filters {
  display: flex; flex-wrap: wrap; gap: .5rem; align-items: center;
  margin-bottom: .75rem; padding: .75rem 1rem;
}
.list-filters input, .list-filters select {
  padding: .5rem .75rem; border: 1px solid var(--border);
  border-radius: var(--radius-pill); background: var(--bg-soft);
  font-family: inherit; min-width: 140px;
}
.cal-day-actions { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: .75rem; }
.invite-preview {
  white-space: pre-wrap; background: var(--bg-soft); padding: 1rem;
  border-radius: 12px; font-family: inherit; font-size: .9rem; line-height: 1.45;
  max-height: 50vh; overflow: auto;
}

.toast-container {
  position: fixed; top: calc(1rem + env(safe-area-inset-top, 0px)); right: 1rem;
  z-index: 10000; display: flex; flex-direction: column; gap: .5rem; max-width: min(360px, 90vw);
  pointer-events: none;
}
.toast {
  padding: .75rem 1rem; border-radius: 12px; background: var(--ink); color: #fff;
  font-size: .88rem; box-shadow: var(--shadow-lg); opacity: 0; transform: translateY(-8px);
  transition: opacity .25s, transform .25s;
}
.toast-show { opacity: 1; transform: translateY(0); }
.toast-success { background: var(--success); }
.toast-error { background: var(--danger); }
.toast-info { background: var(--accent-blue); }

.dash-list-block { margin-bottom: 1rem; }
.dash-list-block h3 { margin-bottom: .75rem; }
.list-meta { color: var(--muted); font-size: .85rem; margin: .25rem 0 .75rem; }
.load-more-wrap { text-align: center; margin: 1rem 0; }

.cal-dot-cancelled { background: var(--danger) !important; }
.cal-dot-past { background: var(--faint) !important; }
.cal-day-past .cal-day-num,
.cal-day-past .cal-count { color: var(--muted); font-weight: 600; }
.cal-day-cancelled {
  opacity: .7;
}
.cal-day-cancelled .cal-day-body strong,
.cal-day-cancelled .cal-day-time {
  text-decoration: line-through;
  text-decoration-thickness: 1.5px;
}
/* Прошедшие события дня — приглушённым текстом, без полупрозрачности (как прошедшие строки в списках) */
.cal-day-past-item .cal-day-body strong { color: var(--muted); font-weight: 600; }
.cal-day-past-item .cal-day-body small,
.cal-day-past-item .cal-day-time { color: var(--faint); }

.notif-filters {
  display: flex; flex-wrap: wrap; gap: .5rem; padding: .5rem .75rem;
  border-bottom: 1px solid var(--border); margin-bottom: .25rem; font-size: .82rem;
}
.notif-filters select { padding: .25rem .5rem; border-radius: 8px; border: 1px solid var(--border); }

.btn-block { display: block; width: 100%; }
.search-results { max-height: 50vh; overflow: auto; }
