/* EQUADORCOFFEE — Карта працівника. Корпоративний світлий інтерфейс, адаптивний (ПК / планшет / телефон). */
:root {
  --brand: #245b45;
  --brand-dark: #163a2c;
  --brand-darker: #102c21;
  --brand-soft: #e6f0ea;
  --accent: #b5794a;
  --bg: #f3f5f4;
  --card: #ffffff;
  --text: #1d2b25;
  --muted: #6b7a72;
  --border: #e1e7e3;
  --danger: #b3261e;
  --danger-soft: #fdecea;
  --warn: #9a5b00;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(16, 44, 33, .06), 0 4px 14px rgba(16, 44, 33, .05);
  --sidebar: 248px;
  --c-green: #2e7d4f; --c-green-bg: #e7f4ec;
  --c-blue: #2463b3; --c-blue-bg: #e7effa;
  --c-orange: #b35c00; --c-orange-bg: #fdf0e1;
  --c-gray: #5f6b66; --c-gray-bg: #eef1ef;
  --c-pink: #b8336a; --c-pink-bg: #fbe8f0;
  --c-violet: #6941c6; --c-violet-bg: #f0ebfb;
  --c-teal: #0f766e; --c-teal-bg: #e3f4f2;
  --c-red: #b3261e; --c-red-bg: #fdecea;
  font-family: "Segoe UI", Inter, system-ui, -apple-system, Roboto, Arial, sans-serif;
  font-size: 15px;
  color: var(--text);
  background: var(--bg);
}

* { box-sizing: border-box; }
/* Текстовий курсор — лише в полях вводу. Якщо в браузері ввімкнено «перегляд із курсором» (F7, Caret Browsing),
   після кліку по сторінці там блимала темно-зелена вертикальна смужка (колір тексту): біля фото в картці, у таблиці тощо. */
body { caret-color: transparent; }
input, textarea, select, [contenteditable="true"] { caret-color: auto; }
/* iOS Safari: без цього Safari сам збільшує шрифт окремих блоків (різний розмір тексту в групах картки).
   overflow-x — запобіжник від «плавання» сторінки вбік; таблиці мають власне прокручування (.table-wrap). */
html { scroll-padding-top: 80px; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; overflow-x: hidden; overflow-x: clip; }
body { margin: 0; background: var(--bg); line-height: 1.45; }
a { color: var(--brand); }
h1, h2, h3 { margin: 0; line-height: 1.25; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.visually-hidden, .sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ic { flex-shrink: 0; vertical-align: middle; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.block { display: block; }
.danger-text { color: var(--danger); }
.warn-text { color: var(--warn); font-weight: 600; }

/* --- Каркас --------------------------------------------------------------------------------------- */
.app { min-height: 100vh; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--sidebar); z-index: 30;
  background: linear-gradient(180deg, var(--brand-dark), var(--brand-darker));
  color: #dfe9e4; display: flex; flex-direction: column; padding: 18px 12px;
}
.brand { display: flex; gap: 11px; align-items: center; padding: 4px 8px 22px; color: #fff; text-decoration: none; }
.brand img { border-radius: 10px; }
.brand b { display: block; letter-spacing: .06em; font-size: 14px; }
.brand small { display: block; color: #a9c2b6; font-size: 12px; }
.nav { display: grid; gap: 4px; }
.nav a {
  display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 10px;
  color: #cfdcd5; text-decoration: none; font-weight: 500;
}
.nav a:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.nav a.active { background: rgba(255, 255, 255, .14); color: #fff; box-shadow: inset 3px 0 0 #8fd1ad; }
.sidebar-foot { margin-top: auto; font-size: 12px; color: #93ad9f; padding: 12px 8px 0; border-top: 1px solid rgba(255, 255, 255, .1); }
.menu-overlay { display: none; }

.main { margin-left: var(--sidebar); min-width: 0; }
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 14px;
  padding: 14px 28px; background: rgba(243, 245, 244, .92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--border);
}
.topbar h1 { font-size: 22px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.icon-btn.menu-toggle { display: none; }
.view { padding: 22px 28px 60px; max-width: 1400px; outline: none; }
.page-sub { margin: 0 0 16px; color: var(--muted); }

/* --- Кнопки ------------------------------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 9px 15px;
  border-radius: 9px; border: 1px solid var(--border); background: #fff; color: var(--text);
  font-weight: 600; cursor: pointer; text-decoration: none; white-space: nowrap; line-height: 1.2;
}
.btn:hover { border-color: #c5d2cb; background: #f8faf9; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-dark); }
.btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.danger:hover { background: #8f1d17; }
.btn.danger-outline { color: var(--danger); border-color: #efc4c0; }
.btn.danger-outline:hover { background: var(--danger-soft); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: rgba(0, 0, 0, .04); }
.btn.sm { padding: 6px 11px; font-size: 13px; }
.btn:focus-visible, .icon-btn:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, .cal-day:focus-visible {
  outline: 3px solid rgba(36, 91, 69, .35); outline-offset: 1px;
}
.icon-btn {
  display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 8px; border: 0;
  background: transparent; color: var(--muted); cursor: pointer; text-decoration: none;
}
.icon-btn:hover { background: var(--brand-soft); color: var(--brand); }
.icon-btn.danger:hover { background: var(--danger-soft); color: var(--danger); }
.icon-btn.light { color: #fff; }
.linklike { background: none; border: 0; padding: 0; cursor: pointer; text-align: left; }
.row-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }

/* --- Картки ------------------------------------------------------------------------------------- */
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px; margin-bottom: 18px; min-width: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.card-head h2 { font-size: 16px; display: flex; align-items: center; gap: 8px; }
.card-head h2 .ic { color: var(--brand); }
.card-link { font-size: 13px; font-weight: 600; text-decoration: none; display: inline-flex; gap: 5px; align-items: center; }
.card-link:hover { text-decoration: underline; }
.welcome h2 { font-size: 22px; margin-bottom: 8px; }
.error-card { color: var(--danger); background: var(--danger-soft); border: 1px solid #f3c6c2; border-radius: 10px; padding: 14px; display: flex; gap: 10px; align-items: flex-start; flex-wrap: wrap; }
.danger-zone { border-color: #f1cfcb; }
.danger-zone .card-head h2 .ic { color: var(--danger); }

.stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 16px 18px; display: grid; gap: 4px; text-decoration: none; color: inherit; border-top: 4px solid var(--brand);
}
a.stat-card:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(16, 44, 33, .09); }
.stat-card.green { border-top-color: var(--c-green); }
.stat-card.blue { border-top-color: var(--c-blue); }
.stat-card.orange { border-top-color: var(--c-orange); }
.stat-card.violet { border-top-color: var(--c-violet); }
.stat-card.teal { border-top-color: var(--c-teal); }
.stat-label { font-size: 13px; color: var(--muted); font-weight: 600; }
.stat-value { font-size: 28px; font-weight: 700; color: var(--brand-dark); }
.stat-sub { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 0 18px; align-items: start; }

/* --- Списки ------------------------------------------------------------------------------------- */
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 0; border-top: 1px solid #eef2ef; }
.list li:first-child { border-top: 0; }
.list-main { display: flex; align-items: center; gap: 10px; min-width: 0; color: inherit; text-decoration: none; flex: 1; }
.list-main > span { min-width: 0; }
.list-main b { display: block; font-weight: 600; overflow-wrap: anywhere; }
.list-main b.done { text-decoration: line-through; color: var(--muted); }
.list-main small { display: block; color: var(--muted); font-size: 12.5px; }
a.list-main:hover b, button.list-main:hover b { color: var(--brand); }
.list-side { font-size: 13px; color: var(--muted); white-space: nowrap; display: flex; gap: 2px; align-items: center; }
.today { color: var(--c-pink); }
.empty { color: var(--muted); padding: 18px 4px; text-align: center; font-size: 14px; }
.empty-actions { margin-top: 12px; display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; }
.plain { margin: 0; padding-left: 18px; }
.plain li { margin: 4px 0; }
.counts { list-style: none; padding: 0; margin: 10px 0; display: grid; gap: 6px; }
.counts li { display: flex; justify-content: space-between; padding: 7px 10px; background: var(--bg); border-radius: 8px; }

/* --- Аватари, бейджі, прогрес ------------------------------------------------------------------- */
.avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); display: inline-grid; place-items: center; font-weight: 700; font-size: 14px; object-fit: cover; flex-shrink: 0; }
.avatar.sm { width: 32px; height: 32px; font-size: 12px; }
.avatar.xl { width: 112px; height: 112px; font-size: 34px; }
.badge { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.badge.green { color: var(--c-green); background: var(--c-green-bg); }
.badge.blue { color: var(--c-blue); background: var(--c-blue-bg); }
.badge.orange { color: var(--c-orange); background: var(--c-orange-bg); }
.badge.gray { color: var(--c-gray); background: var(--c-gray-bg); }
.badge.red { color: var(--c-red); background: var(--c-red-bg); }
.badge.teal { color: var(--c-teal); background: var(--c-teal-bg); }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.dot.pink { background: var(--c-pink); } .dot.blue { background: var(--c-blue); } .dot.orange { background: var(--c-orange); }
.dot.green { background: var(--c-green); } .dot.violet { background: var(--c-violet); }
.progress { display: inline-block; width: 70px; height: 6px; background: #e8eeea; border-radius: 4px; overflow: hidden; vertical-align: middle; margin-right: 6px; }
.progress > span { display: block; height: 100%; background: var(--brand); border-radius: 4px; }
.progress.wide { width: 100%; max-width: 320px; display: block; margin-top: 6px; }
.chip { display: inline-block; max-width: 100%; overflow-wrap: anywhere; padding: 5px 11px; border-radius: 20px; background: var(--bg); border: 1px solid var(--border); text-decoration: none; font-size: 13.5px; font-weight: 600; }
.psy { display: inline-block; width: 11px; height: 11px; border-radius: 50%; margin-right: 6px; vertical-align: -1px; background: #ccc; }
.psy-Червоний { background: #d93636; } .psy-Зелений { background: #2e9e57; } .psy-Жовтий { background: #e5b700; } .psy-Синій { background: #2b62c9; }

/* --- Панель фільтрів і таблиці ------------------------------------------------------------------ */
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin-bottom: 12px; }
.search { flex: 1 1 260px; display: flex; align-items: center; gap: 8px; border: 1px solid var(--border); border-radius: 9px; padding: 0 11px; background: #fff; color: var(--muted); }
.search input { border: 0; outline: 0; padding: 10px 0; width: 100%; background: transparent; color: var(--text); }
.search:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(36, 91, 69, .12); }
.filter { display: grid; gap: 3px; font-size: 12px; color: var(--muted); font-weight: 600; }
.filter select, .inline-select { padding: 8px 10px; border: 1px solid var(--border); border-radius: 9px; background: #fff; min-width: 140px; font-size: 14px; color: var(--text); font-weight: 400; }
.inline-select { min-width: 120px; padding: 6px 8px; }
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 700; padding: 10px; border-bottom: 2px solid var(--border); white-space: nowrap; }
.table td { padding: 10px; border-bottom: 1px solid #eef2ef; vertical-align: middle; }
.table tbody tr:hover { background: #f9fbfa; }
.table .row-done td { color: var(--muted); }
.table .row-done b { text-decoration: line-through; }
.actions-col { white-space: nowrap; text-align: right; width: 1%; }
.person { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; text-decoration: none; color: var(--text); }
.person:hover span { color: var(--brand); text-decoration: underline; }

.tabs { display: flex; gap: 6px; margin-bottom: 14px; flex-wrap: wrap; }
.tabs a { display: inline-flex; gap: 8px; align-items: center; padding: 9px 15px; border-radius: 9px; text-decoration: none; color: var(--muted); font-weight: 600; border: 1px solid transparent; }
.tabs a:hover { background: #fff; }
.tabs a.active { background: #fff; color: var(--brand); border-color: var(--border); box-shadow: var(--shadow); }
.uniform-sub { margin-top: 16px; }
.count { background: var(--brand-soft); color: var(--brand); border-radius: 20px; padding: 1px 8px; font-size: 12px; }

/* --- Форми -------------------------------------------------------------------------------------- */
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; }
.field { display: grid; gap: 5px; align-content: start; min-width: 0; }
.field.full { grid-column: 1 / -1; }
.field.dimmed { opacity: .55; }
.field label { font-size: 13px; font-weight: 600; color: #3b4a43; }
.req { color: var(--danger); font-weight: 700; }
.field input, .field select, .field textarea, .note-form textarea {
  width: 100%; padding: 9px 11px; border: 1px solid #d5ddd8; border-radius: 9px; background: #fff; outline: none;
}
.field textarea { resize: vertical; min-height: 60px; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(36, 91, 69, .12); }
.field .invalid, .field input.invalid, .field select.invalid, .field textarea.invalid { border-color: var(--danger); background: #fffafa; }
.field-error { color: var(--danger); font-size: 12.5px; font-weight: 600; }
.hint { color: var(--muted); font-size: 12px; }
.emp-form { max-width: 1000px; }
.form-section { border: 1px solid var(--border); }
.form-section legend { font-weight: 700; font-size: 16px; padding: 0 6px; color: var(--brand-dark); }
.section-nav { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 14px; }
.section-nav a { font-size: 13px; padding: 5px 11px; border-radius: 20px; background: #fff; border: 1px solid var(--border); text-decoration: none; font-weight: 600; }
.form-footer { position: sticky; bottom: 0; display: flex; justify-content: flex-end; gap: 10px; padding: 14px 0; background: linear-gradient(transparent, var(--bg) 30%); }
.photo-field { display: flex; gap: 18px; align-items: center; margin-bottom: 16px; flex-wrap: wrap; }
.photo-field > div:last-child { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.radio-group { border: 0; padding: 0; margin: 12px 0; display: grid; gap: 8px; }
.radio-group legend { font-weight: 700; margin-bottom: 6px; }
.radio-group label { display: flex; gap: 8px; align-items: flex-start; }
.import-box { margin-top: 14px; padding: 14px; background: var(--bg); border-radius: 10px; }

/* --- Картка працівника -------------------------------------------------------------------------- */
.profile-head { display: flex; gap: 24px; align-items: flex-start; }
.photo-btn { border: 0; padding: 0; background: none; cursor: zoom-in; border-radius: 50%; }
.profile-main { flex: 1; min-width: 0; }
.profile-main h2 { font-size: 24px; overflow-wrap: anywhere; }
.profile-badges { display: flex; gap: 8px; align-items: center; margin: 8px 0; }
.contacts { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px 18px; margin: 0 0 12px; }
.facts dt { font-size: 12px; color: var(--muted); font-weight: 600; }
.facts dd { margin: 2px 0 0; font-weight: 600; }
.completion { font-size: 13.5px; }
.profile-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.props { margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 12px 18px; }
.prop.wide { grid-column: 1 / -1; }
.prop dt { font-size: 12px; color: var(--muted); font-weight: 600; }
.prop dd { margin: 2px 0 0; overflow-wrap: anywhere; }
.note-form { display: grid; gap: 8px; justify-items: start; margin-bottom: 14px; }
.note-form .field { width: 100%; }
.notes { list-style: none; margin: 0; padding: 0; }
.notes li { border-left: 3px solid var(--accent); background: #fbf8f5; border-radius: 0 9px 9px 0; padding: 8px 12px; margin-bottom: 10px; }
.notes p { margin: 4px 0 0; overflow-wrap: anywhere; }
.note-meta { font-size: 12px; color: var(--muted); display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.note-actions { display: flex; }
.note-actions .icon-btn { width: 28px; height: 28px; }

/* --- Анкета ------------------------------------------------------------------------------------- */
/* minmax(0, 1fr): рядок попереднього перегляду (nowrap) не повинен розширювати анкету за межі картки. */
.q-subs { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.q-sub { border: 1px solid var(--border); border-radius: 10px; background: #fff; }
.q-sub[open] { border-color: #c9d8cf; }
.q-sub summary { display: flex; align-items: baseline; gap: 10px; padding: 10px 14px; cursor: pointer; list-style: none; min-width: 0; }
.q-sub summary::-webkit-details-marker { display: none; }
.q-sub summary::before { content: '›'; color: var(--brand); font-weight: 700; transition: transform .15s; flex-shrink: 0; }
.q-sub[open] summary::before { transform: rotate(90deg); }
.q-sub summary:hover .q-title { color: var(--brand); }
.q-title { font-weight: 600; flex-shrink: 0; }
.q-preview { font-size: 13px; color: var(--muted); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.q-sub[open] .q-preview { display: none; }
.q-body { padding: 4px 14px 14px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; justify-items: stretch; }
.q-body > .card-link { justify-self: start; }
.q-text { margin: 0; overflow-wrap: anywhere; }
.q-list { margin: 0; padding-left: 20px; display: grid; gap: 6px; overflow-wrap: anywhere; }
.q-head-actions { display: inline-flex; gap: 14px; align-items: center; }
.q-lang-row { display: grid; grid-template-columns: 1fr 1fr auto; gap: 10px 14px; align-items: end; margin-bottom: 10px; }
.q-photos { display: flex; flex-wrap: wrap; gap: 14px; }
.q-photo-slot { display: grid; gap: 8px; justify-items: start; }
.q-slot-title { font-size: 13px; font-weight: 600; color: #3b4a43; }
.q-thumb { width: 160px; height: 120px; padding: 0; border: 1px solid var(--border); border-radius: 10px; background: var(--bg); overflow: hidden; cursor: zoom-in; display: grid; place-items: center; }
.q-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.q-thumb:hover { border-color: var(--brand); }
.q-thumb.empty { cursor: pointer; border-style: dashed; color: var(--muted); font-size: 13px; font-weight: 600; align-content: center; gap: 6px; justify-items: center; }
.q-slot-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.q-animal { border-top: 1px solid #eef2ef; padding-top: 10px; }
.q-animal:first-child { border-top: 0; padding-top: 0; }
.q-animal-title { display: block; margin-bottom: 8px; color: var(--brand-dark); }

/* --- Календар ----------------------------------------------------------------------------------- */
.cal-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.cal-nav { display: flex; align-items: center; gap: 6px; }
.cal-nav h2 { font-size: 19px; min-width: 170px; text-align: center; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; }
.legend-item { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.cal-wd { padding: 8px; font-size: 12px; font-weight: 700; color: var(--muted); text-align: center; background: #f7f9f8; border-bottom: 1px solid var(--border); }
.cal-day {
  min-height: 104px; padding: 6px; border: 0; border-right: 1px solid #edf1ee; border-bottom: 1px solid #edf1ee;
  background: #fff; text-align: left; cursor: pointer; display: flex; flex-direction: column; gap: 3px; min-width: 0;
}
.cal-day:nth-child(7n) { border-right: 0; }
.cal-day:hover { background: #f6faf8; }
.cal-day.weekend { background: #fcfcfb; }
.cal-day.other { background: #f8f9f8; }
.cal-day.other .cal-num { color: #b3bdb8; }
.cal-num { font-size: 13px; font-weight: 700; width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; }
.cal-day.today .cal-num { background: var(--brand); color: #fff; }
.cal-ev { display: block; font-size: 11.5px; padding: 2px 6px; border-radius: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.cal-ev.pink { background: var(--c-pink-bg); color: var(--c-pink); }
.cal-ev.blue { background: var(--c-blue-bg); color: var(--c-blue); }
.cal-ev.orange { background: var(--c-orange-bg); color: var(--c-orange); }
.cal-ev.green { background: var(--c-green-bg); color: var(--c-green); }
.cal-ev.violet { background: var(--c-violet-bg); color: var(--c-violet); }
.cal-more { font-size: 11px; color: var(--muted); padding-left: 4px; }
.cal-dots { display: none; gap: 3px; flex-wrap: wrap; }

/* --- Статистика --------------------------------------------------------------------------------- */
.bars { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; }
.bars li { display: grid; grid-template-columns: minmax(90px, 38%) 1fr auto; gap: 10px; align-items: center; font-size: 13.5px; }
.bar-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { background: #eef2ef; border-radius: 5px; height: 12px; overflow: hidden; }
.bar { display: block; height: 100%; background: var(--brand); border-radius: 5px; }
.bar.green { background: var(--c-green); } .bar.blue { background: var(--c-blue); } .bar.orange { background: var(--c-orange); } .bar.gray { background: #a7b3ad; }
.bar-value { font-weight: 700; white-space: nowrap; }
.bar-value small { color: var(--muted); font-weight: 400; }
.stat-card.static { border-top-color: var(--accent); }

/* --- Модальні вікна, повідомлення, перегляд фото ------------------------------------------------ */
.modal-backdrop { position: fixed; inset: 0; z-index: 100; background: rgba(15, 30, 24, .45); display: grid; place-items: center; padding: 16px; overflow-y: auto; }
.modal { background: #fff; border-radius: 14px; width: min(560px, 100%); box-shadow: 0 20px 60px rgba(0, 0, 0, .25); max-height: calc(100vh - 32px); display: flex; }
.modal.wide { width: min(760px, 100%); }
.modal form { display: flex; flex-direction: column; width: 100%; min-height: 0; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.modal-head h2 { font-size: 18px; }
.modal-body { padding: 18px 20px; overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--border); flex-wrap: wrap; }
.confirm-text { display: flex; gap: 12px; align-items: flex-start; }
.confirm-text .ic { color: var(--danger); margin-top: 2px; }
.confirm-text p { margin: 0; }
.toasts { position: fixed; right: 18px; bottom: 18px; z-index: 200; display: grid; gap: 8px; max-width: min(420px, calc(100vw - 36px)); }
.toast { padding: 12px 16px; border-radius: 10px; color: #fff; background: var(--brand-dark); box-shadow: 0 8px 24px rgba(0, 0, 0, .2); font-weight: 600; transition: opacity .4s, transform .4s; }
.toast.error { background: var(--danger); }
.toast.hide { opacity: 0; transform: translateY(8px); }
/* max-height: 100% у комірці grid з автовисотою не діє — фото анкети (книжкова орієнтація) виходило за екран знизу.
   Тепер фото вміщується у висоту вікна; на дуже низькому екрані (менше ~520 px) — не менше 480 px і прокручується
   саме перегляд фото. margin: auto (замість place-items: center) — щоб при прокручуванні верх фото не ховався. */
.lightbox { position: fixed; inset: 0; z-index: 150; background: rgba(0, 0, 0, .85); display: grid; cursor: zoom-out; padding: 20px; overflow: auto; overscroll-behavior: contain; }
.lightbox img { margin: auto; max-width: 100%; max-height: max(calc(100vh - 40px), 480px); max-height: max(calc(100dvh - 40px), 480px); border-radius: 10px; }
.lightbox .icon-btn { position: absolute; top: 14px; right: 14px; }

/* --- Адаптивність ------------------------------------------------------------------------------- */
@media (max-width: 1180px) {
  /* minmax(0, …), як і на широкому екрані: «1fr» не дає колонці стати вужчою за найдовший нерозривний рядок
     (попередній перегляд анкети в один рядок), і картка розширювалась за межі телефона. */
  .profile-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 960px) {
  :root { --sidebar: 0px; }
  .sidebar { width: 260px; transform: translateX(-100%); transition: transform .25s; visibility: hidden; }
  body.menu-open .sidebar { transform: none; visibility: visible; box-shadow: 0 0 40px rgba(0, 0, 0, .3); }
  body.menu-open .menu-overlay { display: block; position: fixed; inset: 0; background: rgba(0, 0, 0, .35); z-index: 25; }
  .icon-btn.menu-toggle { display: inline-grid; }
  .topbar { padding: 12px 16px; }
  .view { padding: 16px 16px 60px; }
}
@media (max-width: 720px) {
  .topbar { flex-wrap: wrap; }
  .topbar h1 { font-size: 19px; }
  .page-actions { width: 100%; justify-content: flex-start; }
  .page-actions .btn { flex: 1 1 auto; }
  .grid2, .props { grid-template-columns: minmax(0, 1fr); }
  .q-lang-row { grid-template-columns: 1fr auto; }
  .q-lang-row .field:first-child { grid-column: 1 / -1; }
  .dash-grid { grid-template-columns: 1fr; }
  .profile-head { flex-direction: column; align-items: center; text-align: center; }
  .profile-badges, .contacts { justify-content: center; }
  .facts { text-align: left; }
  .filter { flex: 1 1 140px; }
  .filter select { min-width: 0; width: 100%; }
  /* Таблиці стають картками */
  .table.responsive thead { display: none; }
  .table.responsive tr { display: block; border: 1px solid var(--border); border-radius: 10px; margin-bottom: 10px; padding: 6px 10px; }
  .table.responsive td { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 12px; border: 0; padding: 6px 0; text-align: right; }
  .table.responsive td > small.block { flex-basis: 100%; }
  .table.responsive td::before { content: attr(data-label); font-size: 12px; font-weight: 700; color: var(--muted); text-align: left; }
  .table.responsive td.actions-col { justify-content: flex-end; width: auto; }
  .table.responsive td.actions-col::before { content: none; }
  /* Список працівників: фото й ім'я — під підписом «Працівник», від лівого краю. Без цього space-between + text-align: right
     зсували короткі імена праворуч, а довгі (що переносились на новий рядок) — ліворуч. */
  /* Таблиці всередині картки працівника (історія видач уніформи) — той самий текст, що й у полях інших груп. */
  .profile-grid .table { font-size: inherit; }
  .profile-grid .table.responsive td::before { font-weight: 600; }
  .table.responsive td.person-cell { flex-direction: column; align-items: flex-start; text-align: left; }
  .table-wrap { overflow: visible; }
  .cal-day { min-height: 58px; padding: 4px; }
  .cal-ev, .cal-more { display: none; }
  .cal-dots { display: flex; }
  .cal-nav h2 { min-width: 0; font-size: 17px; }
  .bars li { grid-template-columns: 1fr auto; }
  .bars .bar-track { grid-column: 1 / -1; grid-row: 2; }
  .form-footer .btn { flex: 1; }
}

@media print {
  .sidebar, .topbar .page-actions, .menu-toggle, .toasts { display: none; }
  .main { margin: 0; }
  .card { box-shadow: none; break-inside: avoid; }
}

/* --- Серверна версія: вхід, користувач у меню, адмінсторінки ------------------------------------ */
body.locked .app { display: none; }
.auth-screen { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: linear-gradient(160deg, var(--brand-dark), var(--brand-darker)); }
.auth-card { width: min(420px, 100%); display: grid; gap: 14px; margin: 0; padding: 26px 26px 20px; }
.auth-card h2 { font-size: 20px; }
.auth-card p { margin: 0; }
.auth-brand { display: flex; gap: 12px; align-items: center; color: var(--brand-dark); }
.auth-brand img { border-radius: 12px; }
.auth-brand b { display: block; letter-spacing: .06em; }
.auth-brand small { display: block; color: var(--muted); }
.auth-msg { background: var(--brand-soft); color: var(--brand-dark); padding: 10px 12px; border-radius: 9px; font-size: 14px; font-weight: 600; }
.auth-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.auth-actions .btn.primary { flex: 1; }
.auth-error { padding: 10px 12px; font-size: 14px; font-weight: 600; }
.sidebar-foot .user-name { color: #fff; font-weight: 600; font-size: 13.5px; overflow-wrap: anywhere; }
.sidebar-foot .user-role { color: #a9c2b6; margin: 2px 0 8px; }
.sidebar-foot .user-actions { display: flex; flex-wrap: wrap; gap: 4px 12px; }
.link-btn { background: none; border: 0; padding: 4px 0; color: #dfe9e4; cursor: pointer; display: inline-flex; gap: 6px; align-items: center; font-size: 13px; }
.link-btn:hover { color: #fff; text-decoration: underline; }
.pin-row { display: flex; gap: 8px; }
.pin-row input { flex: 1; letter-spacing: .15em; font-variant-numeric: tabular-nums; }
.changes { margin: 6px 0 0; padding-left: 18px; font-size: 12.5px; color: var(--muted); }
.changes li { overflow-wrap: anywhere; }
.history { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.history li { border-left: 3px solid var(--brand); background: #f7faf8; border-radius: 0 9px 9px 0; padding: 8px 12px; overflow-wrap: anywhere; }

/* --- Графік роботи ----------------------------------------------------------------------------- */
/* ===== Графік роботи (мінімалістичний стиль): нейтральна сітка, тонкі лінії, кольори лише для змін і позначок. ===== */
.sched-card { --sc-line: #dcdce1; --sc-row-line: #c9c9d0; --sc-head-line: #dcdce1; --sc-wkline: #c2c3ca; --sc-wkend: #f5f5f7; --sc-today: #e6f1ea; --sc-head: #fafafb;
  --sc-label: #86868b; --sc-pr: #d97706; padding: 16px 14px; }
/* Таблиця прокручується всередині блоку: закріплені рядок із датами (вертикально) і колонка з працівниками (горизонтально). */
.sched-wrap { overflow: auto; max-height: calc(100vh - 250px); max-height: calc(100dvh - 250px); min-height: 240px; border: 1px solid var(--sc-head-line); border-radius: 12px; overscroll-behavior: contain; }
/* Ширина: колонка працівників + дні (порівну) + «Вихідні». На комп'ютері таблиця займає ширину картки без прокручування;
   min-width (не менше --day-min на день) — лише на вузьких екранах з'являється прокручування вбік. */
.sched { --name-w: max(150px, calc(var(--name-text, 92px) + 60px)); --off-w: 64px; --day-min: 22px; width: 100%; table-layout: fixed; min-width: calc(var(--name-w) + var(--off-w) + var(--days, 31) * var(--day-min));
  border-collapse: separate; border-spacing: 0; font-size: 13px; font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", system-ui, Roboto, Arial, sans-serif;
  font-variant-numeric: tabular-nums; -webkit-font-smoothing: antialiased; }
.sched .col-name { width: var(--name-w); }
.sched .col-off { width: var(--off-w); }
.sched th, .sched td { border-bottom: 1px solid var(--sc-line); border-right: 1px solid var(--sc-line); padding: 0; background: #fff; }
/* Лінія між працівниками: та сама товщина (1 px — висота рядків не змінюється), але помітніший світло-сірий колір,
   через увесь рядок, включно із закріпленим стовпцем ПІБ і колонкою «Вихідні». Групи відокремлюються окремо (сірий проміжок 8 px). */
.sched tbody tr:not(.sched-group) > th, .sched tbody tr:not(.sched-group) > td { border-bottom-color: var(--sc-row-line); }
/* Подвійна лінія між працівниками: нижня — рамка 1 px, верхня — смужка фону 1 px на 2 px вище (проміжок 2 px).
   Смужка малюється всередині клітинки, тож висота рядків не змінюється; !important лише для властивостей цієї смужки —
   щоб фон вихідних, «сьогодні», колонки «Вихідні» та наведення не прибирав другу лінію (колір фону вони змінюють як і раніше). */
.sched tbody tr:not(.sched-group) > th, .sched tbody tr:not(.sched-group) > td {
  background-image: linear-gradient(var(--sc-row-line), var(--sc-row-line)) !important; background-repeat: no-repeat !important;
  background-size: 100% 1px !important; background-position: left 0 bottom 2px !important; }
/* Заголовок днів: закріплений угорі; число — у кружечку (для «сьогодні» він стає зеленим). */
.sched thead th { position: sticky; top: 0; z-index: 2; background: var(--sc-head); font-weight: 600; color: var(--sc-label); padding: 5px 0 4px; text-align: center; border-bottom-color: var(--sc-head-line); }
.sched .sd-num { display: block; width: 22px; height: 22px; margin: 0 auto; border-radius: 50%; line-height: 22px; font-size: 13px; font-weight: 600; color: var(--text); }
.sched .sd-wd { display: block; margin-top: 1px; font-size: 10px; font-weight: 500; letter-spacing: .02em; }
/* Стовпець ПІБ: закріплений зліва, з легкою тінню-краєм, щоб клітинки не «заходили» під імена під час прокручування. */
.sched .sched-name { position: sticky; left: 0; z-index: 1; text-align: left; padding: 5px 8px; border-right: 1px solid var(--sc-head-line); box-shadow: 4px 0 6px -5px rgba(0, 0, 0, .18); }
.sched thead .sched-name { z-index: 3; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--sc-label); }
.sched tbody .sched-name .person { display: flex; min-width: 0; font-weight: 500; font-size: 13px; color: var(--text); }
.sched tbody .sched-name .person span { min-width: 0; white-space: nowrap; line-height: 1.25; }
/* Ширина колонки ПІБ рахується в schedule.js за найдовшим ім'ям місяця (--name-text — в один рядок, --name-word — найдовше слово).
   На великому моніторі ПІБ в один рядок; на ноутбуці й телефоні ПІБ може перейти на 2 рядки (прізвище / ім'я), щоб дні лишались ширшими. */
.sched tbody tr:hover > .sched-name { background: #f7f8f9; }
/* Субота й неділя — ледь сірий фон; межа між тижнями — тонка лінія перед понеділком. */
.sched thead th.weekend, .sched td.weekend { background: var(--sc-wkend); }
.sched thead th.weekend .sd-wd { color: var(--accent); }
.sched thead th.wk, .sched td.wk { border-left: 1px solid var(--sc-wkline); }
/* Сьогодні — світло-зелений стовпець і зелений кружечок із числом. Дата береться з пристрою, тож виділення змінюється щодня. */
.sched thead th.today, .sched td.today { background: var(--sc-today); }
.sched thead th.today .sd-num { background: var(--brand); color: #fff; }
.sched thead th.today .sd-wd { color: var(--brand); font-weight: 600; }
.sc { position: relative; display: grid; grid-template-rows: 1fr 1fr; place-items: center; width: 100%; height: 40px; padding: 2px 1px; border: 0; background: transparent; cursor: pointer; font: inherit; font-weight: 600; color: var(--text); }
.sc:hover, .sc:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; border-radius: 3px; }
.sc.work .sc-s1, .sc.work .sc-s2 { display: block; width: 100%; max-width: 30px; min-height: 17px; border-radius: 5px; line-height: 17px; font-size: 12px; text-align: center; padding: 0 1px; white-space: nowrap; }
.sc.work .sc-s1 { background: var(--c-teal-bg); color: var(--c-teal); }
.sc.work .sc-s2 { background: var(--c-violet-bg); color: var(--c-violet); }
.sc.work .none { background: transparent; }
/* Номер зміни: менший верхній індекс, звичайна насиченість — відрізняється і від літери, і від номерів днів у заголовку. */
.sc-n { font-size: 9.5px; font-weight: 600; line-height: 0; vertical-align: super; margin-left: 1px; opacity: .85; font-variant-numeric: lining-nums; }
.sc.off, .sc.vacation, .sc.empty, .sc.work.single { grid-template-rows: 1fr; }
.sc.off .sc-day { color: var(--c-gray); background: var(--c-gray-bg); border-radius: 5px; padding: 2px 1px; font-size: 10.5px; letter-spacing: -.02em; }
.sc.vacation .sc-day { color: var(--c-blue); background: var(--c-blue-bg); border-radius: 5px; padding: 2px 5px; font-size: 12px; }
/* Колонка «Вихідні»: стримане виділення. */
.sched .sched-off { text-align: center; font-weight: 600; font-size: 13px; color: var(--brand-dark); background: #f4f8f6; border-left: 1px solid var(--sc-head-line); }
.sched thead th.sched-off { font-size: 10.5px; font-weight: 600; color: var(--brand-dark); background: #eef5f1; padding: 5px 2px; }
.sc-empty { color: #c7c7cc; font-weight: 400; }
/* Пріоритет зміни: цифра 1 або 2 у бурштиновому кружечку — у рядку відповідної зміни, одразу після позначки (А¹ ①).
   Не плутається з номером зміни (верхній індекс) і з літерою «П» (Покровський). */
.sc.work .sc-row { display: flex; align-items: center; justify-content: center; gap: 1px; width: 100%; min-width: 0; }
/* Рядок із пріоритетом: позначка зміни не стискається й не обрізається (А¹ завжди видно повністю), лише трохи менший шрифт. */
.sc.work .sc-row.has-pr .sc-s1, .sc.work .sc-row.has-pr .sc-s2 { width: auto; flex: none; padding: 0 1px; font-size: 11px; letter-spacing: -.02em; }
.sc.work .sc-row.has-pr .sc-n { margin-left: 0; font-size: 8.5px; }
.sc.work .sc-row.has-pr .none { display: none; }
.sc-pr { flex: none; display: inline-block; width: 11px; height: 11px; border-radius: 50%; font-size: 8.5px; line-height: 11px; text-align: center; font-weight: 700;
  color: #fff; background: var(--sc-pr); font-variant-numeric: lining-nums; }
/* «Вих» / «В» + пріоритет: кружечок у правому верхньому кутку (у цих позначках немає верхнього індексу). */
.sc.off .sc-pr, .sc.vacation .sc-pr { position: absolute; top: 2px; right: 1px; box-shadow: 0 0 0 1.5px #fff; }
.sc.prio { grid-template-rows: 1fr; }
.sc.prio .sc-pr { position: static; width: 17px; height: 17px; line-height: 17px; font-size: 11px; box-shadow: none; }
.sc-pr.lg { position: static; display: inline-block; width: 15px; height: 15px; line-height: 15px; font-size: 10px; box-shadow: none; margin-right: -3px; }
/* Вихідний на прохання: той самий «Вих», рожевий відтінок. */
.sc.off.req .sc-day { color: #b0177a; background: #fbe3f1; }
.sc-legend.off.req { color: #b0177a; background: #fbe3f1; }
.check-row { display: flex; align-items: center; gap: 8px; font-size: 14px; align-self: end; padding-bottom: 8px; }
.check-row input:disabled + * , .check-row:has(input:disabled) { color: var(--muted); }
/* Відсутність у «Календарі» — маленька помаранчева крапка в лівому нижньому куті (кути праворуч — для пріоритету). */
.sc-abs { position: absolute; left: 3px; bottom: 3px; width: 5px; height: 5px; border-radius: 50%; background: var(--c-orange); }
/* Групи кав'ярень: заголовок-розділ через усю таблицю (назва + підсумки), між групами — проміжок кольору сторінки.
   Назва закріплена зліва під час прокручування вбік. */
.sched tr.sched-group th { position: static; text-align: left; padding: 10px 10px 6px; background: #fff; border-right: 0; border-top: 8px solid var(--sc-wkend); border-bottom: 1px solid var(--sc-head-line); }
.sched tbody tr.sched-group:first-child th { border-top: 0; }
.sched tr.sched-group .sg-title { position: sticky; left: 10px; display: inline-flex; align-items: baseline; flex-wrap: wrap; gap: 2px 10px; }
.sched tr.sched-group .sg-name { font-size: 14px; font-weight: 700; color: var(--brand-dark); letter-spacing: -.01em; }
.sched tr.sched-group .sg-meta { font-size: 12px; font-weight: 500; color: var(--sc-label); white-space: nowrap; }
.sched tr.sched-group .sg-meta i { font-style: normal; margin: 0 6px; opacity: .6; }
/* Легенда над таблицею: основні позначення — одним рядком, літери кав'ярень — другим, дрібнішим. */
/* Синхронізація з Google Таблицею: компактний рядок стану (лише адміністратор) і позначка ручної зміни. */
.sched-sync { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: -2px 0 10px; padding: 8px 10px; border: 1px solid var(--border);
  border-radius: 10px; background: #fafbfa; font-size: 12.5px; color: var(--muted); }
.sched-sync-meta { display: inline-flex; flex-wrap: wrap; gap: 2px 8px; min-width: 0; }
.sched-sync-meta i { font-style: normal; color: #c3c9c5; }
.sched-sync-err { color: var(--danger); font-weight: 600; overflow-wrap: anywhere; }
.sched-sync-actions { display: inline-flex; gap: 6px; margin-left: auto; flex-wrap: wrap; }
.sched-sync .btn.sm .ic { margin-right: 4px; vertical-align: -3px; }
/* Швидке редагування з клавіатури: поле введення лежить поверх активної клітинки (position: absolute) — розміри рядків
   і колонок не змінюються. Поки нічого не введено, поле прозоре й видно поточне значення клітинки. */
.sched-card .cal-nav { flex-wrap: wrap; }
.sc.ro { cursor: default; }
/* Працівник бачить графік команди — власний рядок виділено. */
.sched tbody tr.me > .sched-name { background: var(--sc-today); }
.sched tbody tr.me > .sched-name .person span { font-weight: 700; }
.sc.ro:hover { outline: none; }
.acc-edit-toggle { margin-top: 8px; align-items: flex-start; }
.acc-edit-toggle input { margin-top: 3px; }
.qe-toggle .ic { margin-right: 4px; vertical-align: -3px; }
.qe-toggle.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.qe-hint { line-height: 1.6; }
.qe-hint b { color: var(--text); font-weight: 600; }
.qe-touch { display: none; }
@media (hover: none) and (pointer: coarse) { .qe-keys { display: none; } .qe-touch { display: inline; } }
.qe-hint kbd { display: inline-block; padding: 0 5px; border: 1px solid var(--sc-head-line, #dcdce1); border-bottom-width: 2px; border-radius: 5px;
  background: #fff; font: 600 11px/16px -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif; color: var(--text); }
.sched td.qe-active { position: relative; }
.qe-input { position: absolute; inset: 1px; z-index: 1; width: calc(100% - 2px); height: calc(100% - 2px); margin: 0; padding: 0 1px; box-sizing: border-box;
  border: 2px solid var(--brand); border-radius: 6px; background: transparent; color: var(--text); text-align: center; font: 600 13px/1 -apple-system, BlinkMacSystemFont,
  "SF Pro Text", "Segoe UI", system-ui, Roboto, Arial, sans-serif; caret-color: var(--brand); outline: none; box-shadow: 0 0 0 3px rgba(36, 91, 69, .2);
  -webkit-appearance: none; appearance: none; min-width: 0; }
.qe-input:not(:focus) { box-shadow: none; border-color: color-mix(in srgb, var(--brand) 55%, #fff); }
.qe-input.typing { background: #fff; }
.qe-input.bad { animation: qe-bad .45s; border-color: var(--danger); }
@keyframes qe-bad { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-3px); } 75% { transform: translateX(3px); } }
.sched .sc.qe-saving { opacity: .45; }
/* iOS збільшує сторінку, якщо шрифт поля < 16 px — на телефонах поле з 16 px. */
@media (max-width: 720px), (hover: none) { .qe-input { font-size: 16px; } }
@media (prefers-reduced-motion: reduce) { .qe-input.bad { animation: none; } }
.sched .sc.manual { position: relative; }
.sched .sc.manual::before { content: ""; position: absolute; top: 1px; right: 1px; width: 0; height: 0; border-top: 6px solid var(--c-blue);
  border-left: 6px solid transparent; pointer-events: none; }
.sc-man { display: inline-block; width: 10px; height: 10px; background: linear-gradient(225deg, var(--c-blue) 50%, transparent 50%);
  border: 1px solid #dcdce1; border-radius: 2px; }
.sched-sheet-note { margin: 10px 0 0; padding: 8px 10px; border-radius: 8px; background: var(--c-blue-bg); color: var(--c-blue); font-size: 13px; }
.sched-hist { margin-top: 10px; font-size: 13px; }
.sched-hist summary { cursor: pointer; color: var(--brand); font-weight: 600; }
.sched-hist-list { margin: 6px 0 0; padding-left: 18px; display: grid; gap: 3px; }
.sp-h { font-size: 14px; margin: 14px 0 4px; }
.sp-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.sp-item { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 6px 10px; padding: 8px 10px;
  border: 1px solid var(--border); border-radius: 8px; }
.sp-item > div:first-child { min-width: 0; overflow-wrap: anywhere; }
.sp-map { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.sp-map select { max-width: 260px; min-width: 0; }
@media (max-width: 640px) {
  .sched-sync-actions { margin-left: 0; width: 100%; }
  .sp-map, .sp-map select { width: 100%; max-width: none; }
}
.sched-legend { display: grid; gap: 6px; margin: 2px 0 10px; font-size: 12.5px; color: var(--muted); }
.sched-legend .lg-main, .sched-legend .lg-cafes { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.sched-legend .lg-cafes { gap: 4px 12px; font-size: 11.5px; color: var(--sc-label); }
.sched-legend span { display: inline-flex; align-items: center; gap: 6px; }
.lg-cafe { display: inline-grid; place-items: center; min-width: 18px; height: 18px; border-radius: 5px; background: var(--sc-wkend); color: var(--text); font-size: 11px; }
.sc-legend { position: relative; display: inline-flex; gap: 2px; align-items: center; justify-content: center; min-width: 24px; height: 19px; border-radius: 5px; font-size: 11.5px; font-weight: 600; }
.sc-legend.work i { font-style: normal; padding: 0 4px; border-radius: 5px; background: var(--c-teal-bg); color: var(--c-teal); }
.sc-legend.work i.s2 { background: var(--c-violet-bg); color: var(--c-violet); }
.sc-legend.off { color: var(--c-gray); background: var(--c-gray-bg); padding: 0 5px; }
.sc-legend.vacation { color: var(--c-blue); background: var(--c-blue-bg); }
.sc-legend.empty { color: #c7c7cc; border: 1px solid var(--sc-head-line); line-height: 1; padding: 0; font-size: 11.5px; }
.sc-legend.weekend { background: var(--sc-wkend); border: 1px solid var(--sc-head-line); }
.sc-legend.today { background: var(--sc-today); border: 1px solid #b9d6c4; }
.sc-legend.absmark { border: 1px solid var(--sc-head-line); }
.sc-legend.absmark .sc-abs { left: 50%; top: 50%; bottom: auto; transform: translate(-50%, -50%); }
.sched-form { display: grid; gap: 14px; }
.sched-status { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-radio { position: relative; cursor: pointer; }
.chip-radio input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.chip-radio span { display: inline-block; padding: 7px 14px; border-radius: 20px; border: 1px solid var(--border); background: #fff; font-size: 14px; font-weight: 600; }
.chip-radio input:checked + span { background: var(--brand); border-color: var(--brand); color: #fff; }
.chip-radio input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }
.field select:disabled { background: var(--bg); color: var(--muted); cursor: not-allowed; }
/* Статус за графіком на сьогодні — у списку працівників і в картці. */
.shift-today { display: block; font-size: 12.5px; font-weight: 600; color: var(--c-teal); white-space: normal; }
.shift-today.off { color: var(--c-gray); }
.shift-today.vacation { color: var(--c-blue); }
.shift-today.none { color: var(--muted); font-weight: 400; }
.profile-shift { font-size: 13px; color: var(--muted); margin: 0 0 10px; display: flex; gap: 6px; flex-wrap: wrap; align-items: baseline; }
.profile-shift .shift-today { display: inline; font-size: 13.5px; }
@media (max-width: 720px) {
  .sched-wrap { max-height: calc(100vh - 200px); max-height: calc(100dvh - 200px); }
  .sched { --name-w: max(120px, calc(var(--name-word, 100px) + 18px)); --off-w: 58px; --day-min: 40px; }
  .sched tbody .sched-name .person span { white-space: normal; line-height: 1.15; }
  .sched tbody .sched-name { padding-top: 2px; padding-bottom: 2px; }
  .sched .sched-name { padding: 6px 8px; }
  .sched tbody .sched-name .avatar { display: none; }
  .profile-shift { justify-content: center; }
}
/* Графік роботи на вузькому вікні комп'ютера (бічне меню ще видно): компактніші колонки, щоб 31 день вміщувався без прокручування. */
@media (min-width: 961px) and (max-width: 1240px) {
  .view:has(.sched-card) { padding-left: 16px; padding-right: 16px; }
  .sched { --name-w: max(118px, calc(var(--name-word, 98px) + 18px)); --off-w: 50px; --day-min: 15px; }
  .sched tbody .sched-name .person span { white-space: normal; line-height: 1.15; }
  .sched tbody .sched-name { padding-top: 2px; padding-bottom: 2px; }
  .sched tbody .sched-name .avatar { display: none; }
  .sched tbody .sched-name .person { font-size: 12.5px; }
  .sched .sd-num { width: 19px; height: 19px; line-height: 19px; font-size: 12px; }
  .sched .sd-wd { font-size: 9px; }
  .sc-pr { width: 9px; height: 9px; line-height: 9px; font-size: 7px; }
  .sc.work .sc-row.has-pr { gap: 0; }
  .sc.work .sc-row.has-pr .sc-s1, .sc.work .sc-row.has-pr .sc-s2 { padding: 0; font-size: 9.5px; }
  .sc.work .sc-row.has-pr .sc-n { font-size: 7px; }
  .sched thead th.sched-off { font-size: 9.5px; }
  .sc.work .sc-s1, .sc.work .sc-s2 { font-size: 10.5px; }
  .sc-n { font-size: 8px; margin-left: 0; }
  .sc.off .sc-day { font-size: 8.5px; padding: 2px 0; letter-spacing: -.06em; }
}
/* Графік на моніторі 1241–1400 px: клітинки ~23 px — у рядку з пріоритетом трохи менші позначка й кружечок, щоб вміщалися повністю. */
@media (min-width: 1241px) and (max-width: 1400px) {
  .sc.work .sc-row.has-pr { gap: 0; }
  .sc.work .sc-row.has-pr .sc-s1, .sc.work .sc-row.has-pr .sc-s2 { padding: 0; font-size: 10px; }
  .sc.work .sc-row.has-pr .sc-n { font-size: 7.5px; }
  .sc.work .sc-pr { width: 10px; height: 10px; line-height: 10px; font-size: 7.5px; }
}
/* Графік на смартфоні: легенда — по одному рядку, що гортається вбік (не займає пів екрана). */
@media (max-width: 720px) {
  .sched-legend { font-size: 12px; margin-bottom: 8px; }
  .sched-legend .lg-main, .sched-legend .lg-cafes { flex-wrap: nowrap; overflow-x: auto; white-space: nowrap; padding-bottom: 2px; scrollbar-width: none; }
  .sched-legend .lg-main::-webkit-scrollbar, .sched-legend .lg-cafes::-webkit-scrollbar { display: none; }
  .sched-legend span { flex: none; }
}
/* Ноутбук 1241–1400 px: ПІБ може переноситись на 2 рядки, колонка — за найдовшим словом (фото лишається). */
@media (min-width: 1241px) and (max-width: 1400px) {
  .sched { --name-w: max(150px, calc(var(--name-word, 92px) + 60px)); }
  .sched tbody .sched-name .person span { white-space: normal; line-height: 1.15; }
}

/* Права доступу менеджера (лише власник): рядок розділу — назва зліва, перемикач «Немає · Перегляд · Редагування» справа. */
.acc-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.acc-head h2 { margin: 0; }
.acc-tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 8px; }
.acc-copy { display: inline-flex; gap: 6px; align-items: center; }
.acc-copy select { padding: 6px 10px; border-radius: 10px; border: 1px solid var(--border); background: #fff; font: inherit; font-size: 14px; }
.acc-list { display: grid; }
.acc-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 10px 0; border-top: 1px solid var(--border); flex-wrap: wrap; }
.acc-row:first-child { border-top: 0; }
.acc-row.locked { color: var(--muted); align-items: center; }
.acc-label { flex: 1 1 260px; min-width: 0; }
.acc-label b { font-weight: 600; }
.seg { display: inline-flex; gap: 4px; flex-wrap: wrap; }
.chip-radio.sm span { padding: 5px 11px; font-size: 13px; }
.chip-radio input:disabled + span { opacity: .5; }
.acc-fields { margin-top: 6px; font-size: 13px; }
.acc-fields summary { cursor: pointer; color: var(--brand); }
.acc-field { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 4px 0 4px 12px; }
.acc-field select { padding: 4px 8px; border-radius: 8px; border: 1px solid var(--border); background: #fff; font: inherit; font-size: 13px; }
.acc-acts { display: grid; gap: 6px; }
.acc-act { padding-bottom: 0; align-self: auto; }
.acc-footer { position: sticky; bottom: 0; background: var(--bg); padding: 10px 0; display: flex; gap: 8px; align-items: center; justify-content: flex-end; flex-wrap: wrap; }
.acc-footer > span { margin-right: auto; }
.acc-history { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.acc-preview { max-height: 50vh; overflow: auto; }

/* Відпустки в картці працівника (розрахунок за графіком, позначки «В»). */
.vac-facts { margin: 4px 0 12px; }
.vac-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.vac-tile { border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; display: grid; gap: 2px; background: #fff; min-width: 0; }
.vac-tile span { font-size: 12px; color: var(--muted); }
.vac-tile b { font-size: 24px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.vac-tile small { font-size: 11.5px; color: var(--muted); }
.vac-tile.paid b { color: var(--c-green); }
.vac-tile.unpaid b { color: var(--c-orange); }
.vac-tile.left { background: var(--brand-soft); border-color: transparent; }
.vac-tile.left b { color: var(--brand-dark); }
.vac-bar { height: 6px; border-radius: 3px; background: var(--c-gray-bg); margin: 10px 0 4px; overflow: hidden; }
.vac-bar span { display: block; height: 100%; background: var(--c-green); border-radius: 3px; }
@media (max-width: 720px) { .vac-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Річниці роботи в календарі — окремий бурштиново-золотий колір (не плутається з іншими подіями). */
.dot.gold { background: #c58a00; }
.cal-ev.gold { background: #fdf3d7; color: #8a5a00; font-weight: 600; }
.cal-ev.gold .ann-name { display: flex; align-items: center; gap: 3px; min-width: 0; }
.cal-ev.gold .ann-name svg { flex: none; }
.cal-ev.gold .ann-name span, .cal-ev.gold small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.cal-ev.gold small { display: block; font-size: 10.5px; font-weight: 500; opacity: .85; }

/* --- Кар'єрний шлях: вертикальна шкала --- */
.tl-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-bottom: 14px; }
.tl-stats > div { border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; display: grid; gap: 2px; background: #fff; min-width: 0; }
.tl-stats span { font-size: 12px; color: var(--muted); }
.tl-stats b { font-size: 18px; line-height: 1.2; font-variant-numeric: tabular-nums; }
.tl-stats small { font-size: 11.5px; color: var(--muted); }
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.tl-item { position: relative; padding: 0 0 16px 26px; }
.tl-item:last-child { padding-bottom: 2px; }
.tl-item::before { content: ""; position: absolute; left: 6px; top: 14px; bottom: -2px; width: 2px; background: var(--border); }
.tl-item:last-child::before { display: none; }
.tl-dot { position: absolute; left: 1px; top: 4px; width: 12px; height: 12px; border-radius: 50%; background: #fff; border: 2px solid #c5cfca; box-sizing: border-box; }
.tl-item.current .tl-dot { width: 14px; height: 14px; left: 0; top: 3px; border: 0; background: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }
.tl-body { min-width: 0; color: var(--muted); }
.tl-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tl-rank { font-size: 14.5px; font-weight: 600; color: #4b5a53; }
.tl-item.current .tl-body { color: var(--text); }
.tl-item.current .tl-rank { font-size: 16px; color: var(--text); }
.tl-actions { margin-left: auto; display: inline-flex; gap: 2px; }
.tl-date { font-size: 13px; margin-top: 2px; font-variant-numeric: tabular-nums; }
.tl-item.current .tl-date { color: var(--text); }
.tl-kind, .tl-meta { font-size: 12px; margin-top: 2px; }
.tl-comment { font-size: 13px; margin-top: 4px; padding: 6px 10px; background: var(--bg); border-radius: 8px; color: var(--text); }
.pos-change { grid-column: 1 / -1; border: 1px solid var(--brand-soft); background: #f7faf8; border-radius: 10px; padding: 10px 12px; }
.pos-change p { margin: 0 0 6px; }

/* --- Безпека входу --- */
.sec-policy { margin: 0; padding-left: 18px; display: grid; gap: 4px; font-size: 14px; }
.table tr.sec-warn td { background: #fff8f0; }
.tf-steps { padding-left: 18px; display: grid; gap: 8px; margin: 0 0 10px; }
.tf-secret { font-family: ui-monospace, Consolas, monospace; font-size: 16px; letter-spacing: .06em; background: var(--bg); border: 1px solid var(--border);
  border-radius: 8px; padding: 8px 10px; margin: 6px 0; word-break: break-all; user-select: all; }

/* --- «Ділюся радістю»: стрічка новин на «Головній» --- */
.joy { margin-bottom: 22px; }
.joy-top { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin: 0 auto 12px; max-width: 680px; }
.joy-top h2 { margin: 0; font-size: 21px; font-weight: 700; letter-spacing: -.01em; }
.joy-top p { margin: 2px 0 0; }
.joy-feed { max-width: 680px; margin: 0 auto; display: grid; gap: 16px; }
.joy-post { background: #fff; border: 1px solid rgba(16, 44, 33, .07); border-radius: 18px; box-shadow: 0 1px 2px rgba(16, 44, 33, .04), 0 8px 24px rgba(16, 44, 33, .05);
  padding: 16px 18px 12px; min-width: 0; }
.joy-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.joy-avatar { width: 36px; height: 36px; border-radius: 50%; flex: none; display: grid; place-items: center; font-size: 13px; font-weight: 700; letter-spacing: .02em;
  color: var(--brand); background: linear-gradient(135deg, var(--brand-soft), #f3ece4); }
.joy-meta { display: grid; min-width: 0; line-height: 1.25; }
.joy-meta b { font-size: 14.5px; font-weight: 600; }
.joy-meta small { font-size: 12.5px; color: var(--muted); }
.joy-new { font-size: 11.5px; font-weight: 700; color: #fff; background: var(--accent); border-radius: 20px; padding: 2px 9px; }
.joy-tools { margin-left: auto; display: inline-flex; gap: 2px; opacity: .75; }
.joy-tools:hover { opacity: 1; }
.joy-photo { background: #f5f5f7; border-radius: 14px; overflow: hidden; display: flex; justify-content: center; margin: 0 -4px 12px; }
.joy-photo-btn { display: block; border: 0; padding: 0; background: none; cursor: zoom-in; max-width: 100%; }
.joy-photo img { display: block; max-width: 100%; height: auto; width: auto; max-height: min(72vh, 620px); }
.joy-photo.landscape img, .joy-photo.square img { width: 100%; }
.joy-text { font-size: 15.5px; line-height: 1.6; color: var(--text); overflow-wrap: anywhere; }
.joy-text p { margin: 0 0 .7em; }
.joy-text p:last-child { margin-bottom: 0; }
.joy-foot { display: flex; align-items: center; margin-top: 10px; padding-top: 8px; border-top: 1px solid rgba(16, 44, 33, .06); }
.joy-like { display: inline-flex; align-items: center; gap: 6px; border: 0; background: transparent; border-radius: 20px; padding: 5px 10px 5px 8px; cursor: pointer;
  font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; transition: background .15s; }
.joy-like:hover { background: #f5f5f7; }
.joy-like.on { color: #c2185b; }
.joy-like .heart { font-size: 17px; line-height: 1; }
.joy-like.pop .heart { animation: joy-pop .35s ease; }
@keyframes joy-pop { 40% { transform: scale(1.35); } 100% { transform: scale(1); } }
@media (prefers-reduced-motion: reduce) { .joy-like.pop .heart { animation: none; } }
.joy-more { text-align: center; }
.joy-empty { text-align: center; padding: 26px 16px; background: #fff; border: 1px dashed var(--border); border-radius: 18px; color: var(--muted); }
.joy-empty span { font-size: 28px; }
.joy-empty p { margin: 6px 0 0; }
.nav a.nav-dot span::after { content: ""; display: inline-block; width: 8px; height: 8px; margin-left: 8px; border-radius: 50%; background: #f2a65a; vertical-align: middle; }
/* Вікно публікації */
.joy-seg { display: inline-flex; background: #f0f2f1; border-radius: 11px; padding: 3px; gap: 2px; margin-bottom: 14px; flex-wrap: wrap; }
.joy-seg button { border: 0; background: transparent; padding: 7px 14px; border-radius: 9px; font-size: 14px; font-weight: 600; color: var(--muted); cursor: pointer; }
.joy-seg button.active { background: #fff; color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, .1); }
.joy-drop { display: flex; align-items: center; gap: 12px; border: 1.5px dashed #c9d3ce; border-radius: 14px; padding: 14px 16px; cursor: pointer; color: var(--brand); background: #fafcfb; }
.joy-drop:hover { border-color: var(--brand); }
.joy-drop span { display: grid; }
.joy-drop small { color: var(--muted); font-size: 12.5px; }
.joy-file-info { margin: 6px 2px 12px; min-height: 1em; }
.joy-preview-wrap { margin-top: 14px; padding: 14px; background: var(--bg); border-radius: 16px; }
.joy-preview-label { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 8px; }
.joy-preview-wrap .joy-post { box-shadow: none; }
.joy-preview-wrap .joy-photo img { max-height: 340px; }
.joy-preview-empty { margin: 4px 0; }
@media (max-width: 720px) {
  .joy-post { padding: 14px 14px 10px; border-radius: 16px; }
  .joy-photo { margin: 0 -14px 12px; border-radius: 0; }
  .joy-top h2 { font-size: 19px; }
}

/* --- Навчання --- */
.learn { max-width: 980px; margin: 0 auto; position: relative; }
.learn-banners { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 18px; position: relative; }
.learn-banner { border-radius: 18px; padding: 18px 20px; min-width: 0; overflow-wrap: anywhere; }
.learn-banner.mission { background: linear-gradient(135deg, #f1f6f3, #e6f0ea); }
.learn-banner.motto { background: linear-gradient(135deg, #fbf4ec, #f5e8da); }
.learn-banner .eyebrow { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.learn-banner p { margin: 8px 0 0; font-size: 16.5px; line-height: 1.5; font-weight: 500; color: var(--text); max-height: 14em; overflow: auto; }
.learn-banner-edit { position: absolute; top: -6px; right: 0; }
.learn-progress-row { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.ring { --p: 0; width: 104px; height: 104px; border-radius: 50%; flex: none; display: grid; place-items: center;
  background: conic-gradient(var(--brand) calc(var(--p) * 1%), #e8eeea 0); position: relative; }
.ring::before { content: ""; position: absolute; inset: 10px; background: #fff; border-radius: 50%; }
.ring b { position: relative; font-size: 22px; font-variant-numeric: tabular-nums; }
.learn-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; flex: 1; min-width: 240px; }
.learn-tiles div { background: var(--bg); border-radius: 12px; padding: 10px 12px; display: grid; }
.learn-tiles b { font-size: 22px; font-variant-numeric: tabular-nums; }
.learn-tiles span { font-size: 12px; color: var(--muted); }
.learn-mand { margin-top: 12px; padding: 12px 14px; border-radius: 12px; background: #fff6f5; border: 1px solid #f6d7d3; }
.learn-mand ul { margin: 6px 0 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.learn-mand li { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.learn-attempts { margin-top: 12px; }
.learn-attempts summary { cursor: pointer; font-weight: 600; }
.learn-sec-head { display: flex; align-items: center; justify-content: space-between; margin: 6px 0 10px; }
.learn-sec-head h2 { margin: 0; font-size: 19px; }
.learn-secs { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.learn-sec { position: relative; display: grid; gap: 4px; align-content: start; background: #fff; border: 1px solid rgba(16, 44, 33, .07); border-radius: 18px;
  padding: 16px; text-decoration: none; color: var(--text); box-shadow: 0 1px 2px rgba(16, 44, 33, .04), 0 8px 22px rgba(16, 44, 33, .05); min-height: 140px; transition: transform .15s; }
.learn-sec:hover { transform: translateY(-2px); }
.learn-sec .num { font-size: 12px; font-weight: 700; color: var(--accent); letter-spacing: .06em; }
.learn-sec b { font-size: 16.5px; line-height: 1.3; }
.learn-sec small { color: var(--muted); }
.learn-sec-foot { display: flex; align-items: center; gap: 8px; margin-top: auto; padding-top: 8px; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.learn-sec-foot .bar { width: 70px; height: 5px; background: #e8eeea; border-radius: 4px; overflow: hidden; display: inline-block; }
.learn-sec-foot .bar span { display: block; height: 100%; background: var(--brand); }
.learn-sec-tools { position: absolute; top: 8px; right: 8px; display: flex; opacity: .6; }
.learn-sec-tools .icon-btn:first-child svg { transform: rotate(90deg); }
.learn-sec:hover .learn-sec-tools { opacity: 1; }
.learn-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; align-items: center; }
.learn-chips .chip { display: inline-flex; align-items: center; gap: 4px; padding: 6px 13px; border-radius: 20px; background: #fff; border: 1px solid var(--border);
  text-decoration: none; color: var(--text); font-size: 14px; cursor: pointer; }
.learn-chips .chip.active { background: var(--brand); color: #fff; border-color: var(--brand); }
.learn-chips .chip.add { color: var(--brand); border-style: dashed; }
.chip-wrap { display: inline-flex; align-items: center; }
.learn-items { display: grid; gap: 10px; }
.learn-item { display: flex; gap: 14px; align-items: center; background: #fff; border: 1px solid rgba(16, 44, 33, .07); border-radius: 16px; padding: 12px;
  text-decoration: none; color: var(--text); box-shadow: 0 1px 2px rgba(16, 44, 33, .03); min-width: 0; }
.learn-item:hover { border-color: #cfdcd4; }
.learn-item .cover { width: 76px; height: 76px; border-radius: 12px; overflow: hidden; flex: none; background: #f5f5f7; display: grid; place-items: center; font-size: 28px; }
.learn-item .cover img { width: 100%; height: 100%; object-fit: cover; }
.learn-item .body { display: grid; gap: 3px; min-width: 0; flex: 1; }
.learn-item .meta, .learn-title .meta { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; font-weight: 600; }
.learn-item b { font-size: 16px; }
.learn-item small { color: var(--muted); overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.learn-item .tags, .learn-title .tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
.learn-item-tools { display: grid; gap: 2px; }
.badge.red { color: var(--c-red); background: var(--c-red-bg); }
.badge.violet { color: var(--c-violet); background: var(--c-violet-bg); }
/* Перегляд матеріалу: захист від простого копіювання + водяний знак */
.learn-protect { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.learn-protect img, .learn-protect video { -webkit-user-drag: none; }
.learn-watermark { position: absolute; inset: 0; pointer-events: none; z-index: 3; opacity: .07; background-repeat: repeat; }
.learn-title { background: #fff; border-radius: 20px; padding: 22px 24px; margin-bottom: 16px; border: 1px solid rgba(16, 44, 33, .06); }
.learn-title h1 { margin: 6px 0 6px; font-size: 28px; line-height: 1.2; letter-spacing: -.015em; }
.learn-title .lead { font-size: 17px; color: #4b5a53; margin: 0 0 10px; }
.learn-cover { width: 100%; max-height: 340px; object-fit: contain; background: #f5f5f7; border-radius: 14px; margin-bottom: 14px; display: block; }
.learn-article { background: #fff; border-radius: 20px; padding: 24px 28px; border: 1px solid rgba(16, 44, 33, .06); font-size: 16.5px; line-height: 1.7; overflow-wrap: anywhere; }
.learn-article h2 { font-size: 23px; margin: 1.2em 0 .4em; }
.learn-article h3 { font-size: 19px; margin: 1.1em 0 .3em; }
.learn-article h4 { font-size: 16.5px; margin: 1em 0 .3em; }
.learn-article > :first-child { margin-top: 0; }
.learn-article blockquote { margin: 1em 0; padding: 10px 16px; border-left: 3px solid var(--accent); background: #fbf8f5; border-radius: 0 10px 10px 0; }
.learn-article table, .rte table { border-collapse: collapse; width: 100%; margin: 1em 0; font-size: 15px; display: block; overflow-x: auto; }
.learn-article th, .learn-article td, .rte th, .rte td { border: 1px solid var(--border); padding: 8px 10px; text-align: left; vertical-align: top; min-width: 80px; }
.learn-article th, .rte th { background: #f5f7f6; }
.learn-article hr, .rte hr { border: 0; border-top: 1px solid var(--border); margin: 1.5em 0; }
.learn-img { margin: 1.2em 0; text-align: center; }
.learn-img img { width: auto; height: auto; max-width: 100%; max-height: 75vh; border-radius: 12px; cursor: zoom-in; }   /* пропорції оригіналу */
.learn-video { margin: 1.2em 0; }
.learn-video video { width: 100%; max-height: 75vh; border-radius: 12px; background: #000; display: block; }
.learn-video.embed iframe { width: 100%; aspect-ratio: 16 / 9; border: 0; border-radius: 12px; display: block; }
.learn-docs { margin-top: 16px; background: #fff; border-radius: 18px; padding: 16px 20px; border: 1px solid rgba(16, 44, 33, .06); }
.learn-docs h3 { margin: 0 0 8px; font-size: 16px; }
.learn-docs ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.learn-docs a { display: flex; gap: 10px; align-items: center; text-decoration: none; color: var(--text); padding: 8px 10px; border-radius: 10px; background: var(--bg); position: relative; z-index: 4; }
.learn-docs a small { margin-left: auto; color: var(--muted); }
.learn-done { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin: 22px 0; position: relative; z-index: 4; }
.btn.lg { padding: 12px 22px; font-size: 15.5px; }
.learn-test-info { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 18px; }
.learn-test-info div { background: #fff; border-radius: 14px; padding: 14px; text-align: center; display: grid; border: 1px solid rgba(16, 44, 33, .06); }
.learn-test-info b { font-size: 22px; }
.learn-test-info span { font-size: 12px; color: var(--muted); }
.learn > .btn.lg { display: block; width: fit-content; margin: 0 auto 18px; position: relative; z-index: 4; }
/* Тест */
.quiz-bar { position: sticky; top: 0; z-index: 5; display: flex; justify-content: space-between; align-items: center; gap: 10px; background: rgba(255, 255, 255, .94);
  border: 1px solid var(--border); border-radius: 14px; padding: 10px 16px; margin-bottom: 14px; font-size: 14px; }
.quiz-timer { font-variant-numeric: tabular-nums; font-weight: 700; font-size: 18px; color: var(--brand); }
.quiz-timer.low { color: var(--c-red); }
.quiz-q { background: #fff; border: 1px solid rgba(16, 44, 33, .07); border-radius: 18px; padding: 16px 18px; margin: 0 0 12px; position: relative; z-index: 4; min-width: 0; }
.quiz-q legend { font-weight: 600; font-size: 16.5px; padding: 0; display: flex; gap: 10px; float: left; width: 100%; }
.quiz-q legend + * { clear: both; }
.quiz-q .n { width: 26px; height: 26px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; font-size: 13px; flex: none; }
.quiz-img { max-width: 100%; max-height: 320px; border-radius: 12px; display: block; margin: 10px 0; }
.quiz-opt { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--border); margin-top: 8px; cursor: pointer; }
.quiz-opt:has(input:checked) { border-color: var(--brand); background: #f3f8f5; }
.quiz-opt input { margin-top: 3px; width: 18px; height: 18px; flex: none; }
.quiz-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin: 16px 0 30px; position: relative; z-index: 4; }
.quiz-result { text-align: center; padding: 28px 20px; }
.quiz-result .big { font-size: 46px; font-weight: 800; font-variant-numeric: tabular-nums; }
.quiz-result.ok .big { color: var(--c-green); }
.quiz-result.fail .big { color: var(--c-orange); }
.quiz-result h2 { margin: 4px 0 6px; }
.quiz-review { list-style: none; padding: 0; margin: 16px auto; max-width: 640px; text-align: left; display: grid; gap: 6px; }
.quiz-review li { display: flex; gap: 10px; padding: 8px 12px; border-radius: 10px; background: var(--bg); }
.quiz-review li.ok span { color: var(--c-green); font-weight: 700; }
.quiz-review li.fail span { color: var(--c-red); font-weight: 700; }
/* Редактор */
.learn-editor .card { max-width: 980px; margin-left: auto; margin-right: auto; }
.rte-toolbar { display: flex; flex-wrap: wrap; gap: 4px; padding: 6px; background: #f5f7f6; border: 1px solid var(--border); border-bottom: 0; border-radius: 12px 12px 0 0; position: sticky; top: 0; z-index: 3; }
.rte-toolbar .tb { border: 0; background: transparent; padding: 6px 9px; border-radius: 8px; cursor: pointer; font-size: 14px; color: var(--text); min-width: 34px; }
.rte-toolbar .tb:hover { background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .08); }
.rte-toolbar .sep { width: 1px; background: var(--border); margin: 4px 3px; }
.rte { min-height: 280px; border: 1px solid var(--border); border-radius: 0 0 12px 12px; padding: 16px 18px; background: #fff; font-size: 16px; line-height: 1.65; outline: none; overflow-wrap: anywhere; caret-color: auto; }
.rte:focus { border-color: #9fc3b0; }
.rte:empty::before { content: attr(data-placeholder); color: var(--muted); }
.rte blockquote { margin: 1em 0; padding: 8px 14px; border-left: 3px solid var(--accent); background: #fbf8f5; }
.rte figure { position: relative; margin: 1em 0; padding: 6px; border: 1px dashed #c9d3ce; border-radius: 12px; text-align: center; background: #fafcfb; }
.rte figure img, .rte figure video { width: auto; height: auto; max-width: 100%; max-height: 320px; border-radius: 8px; }
.rte .embed-ph { padding: 24px; background: #111; color: #fff; border-radius: 8px; }
.fig-tools { position: absolute; top: 8px; right: 8px; display: flex; gap: 4px; }
.fig-tools button { border: 0; background: rgba(255, 255, 255, .92); border-radius: 8px; width: 30px; height: 30px; cursor: pointer; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); }
.ed-cover { margin-top: 10px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.ed-cover #coverBox { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.ed-cover-img { width: 120px; height: 80px; object-fit: cover; border-radius: 10px; }
.ed-significant { margin-top: 10px; padding: 8px 12px; background: #fff8ec; border-radius: 10px; }
.ed-docs { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.ed-docs li { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 6px 10px; background: var(--bg); border-radius: 10px; }
.q-edit { border: 1px solid var(--border); border-radius: 14px; padding: 12px 14px; margin-bottom: 12px; display: grid; gap: 8px; }
.q-edit-head { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; justify-content: space-between; }
.q-edit textarea, .q-opt input[type=text], .q-edit select { width: 100%; padding: 8px 10px; border: 1px solid var(--border); border-radius: 9px; font: inherit; }
.q-edit-head select { width: auto; }
.q-opt { display: flex; gap: 8px; align-items: center; }
.q-opt input[type=radio], .q-opt input[type=checkbox] { width: 20px; height: 20px; flex: none; }
.q-img img { max-height: 120px; border-radius: 8px; display: block; margin-bottom: 6px; }
.assign-list { list-style: none; padding: 0; display: grid; gap: 6px; }
.assign-list li { display: flex; align-items: center; gap: 8px; }
.assign-people { max-height: 260px; overflow: auto; display: grid; gap: 2px; padding: 6px 0; }
.learn-cta { max-width: 680px; margin: 0 auto; text-align: center; }
.modal .learn-protect { position: relative; }
@media (max-width: 720px) {
  .learn-banners { grid-template-columns: 1fr; }
  .learn-banner-edit { position: static; justify-self: end; }
  .learn-tiles, .learn-test-info { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .learn-article { padding: 16px; font-size: 16px; }
  .learn-title { padding: 16px; }
  .learn-title h1 { font-size: 23px; }
  .learn-item .cover { width: 56px; height: 56px; }
  .learn-secs { grid-template-columns: 1fr 1fr; gap: 10px; }
  .learn-sec { min-height: 120px; padding: 12px; }
}

/* --- Кадрові документи --- */
.hr-tabs { margin-bottom: 14px; }
.hr-th { font-size: 11px; text-align: center; }
.hr-dot { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; text-decoration: none; font-size: 13px; font-weight: 700; }
.hr-dot.gray { color: #9aa5a0; background: #f2f4f3; }
.hr-dot.blue { color: var(--c-blue); background: var(--c-blue-bg); }
.hr-dot.orange { color: var(--c-orange); background: var(--c-orange-bg); }
.hr-dot.green { color: var(--c-green); background: var(--c-green-bg); }
.hr-dot.violet { color: var(--c-violet); background: var(--c-violet-bg); }
.hr-employers { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.hr-employer.inactive { opacity: .7; }
.hr-page { max-width: 1100px; margin: 0 auto; }
.hr-employment.ended { background: #fafbfa; }
.hr-employment.ended .card-head h2 { color: var(--muted); }
.hr-ready { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.hr-ready .progress { width: 90px; }
.hr-sub { font-size: 15px; margin: 14px 0 6px; }
.hr-docs td { vertical-align: top; }
.hr-docs .actions-col { white-space: normal; }
.hr-docs .actions-col .btn { margin: 2px 0; }
.hr-miss summary { cursor: pointer; color: var(--c-orange); font-size: 12.5px; margin-top: 4px; }
.hr-missing { margin: 6px 0 0; padding-left: 18px; font-size: 13px; display: grid; gap: 3px; }
.hr-missing li.block { color: var(--c-red); font-weight: 600; }
.hr-warn { background: #fff8ec; border: 1px solid #f3dcb5; border-radius: 10px; padding: 10px 12px; margin: 8px 0; }
.hr-empty-emp { margin-top: 8px; padding: 12px 14px; border-radius: 12px; background: #f5f7f6; }
.hr-checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 2px 12px; }
.hr-duties { display: grid; gap: 6px; }
.hr-duties summary { cursor: pointer; font-weight: 600; padding: 4px 0; }
.hr-duties textarea, textarea.mono { width: 100%; padding: 8px 10px; border: 1px solid var(--border); border-radius: 9px; font: inherit; }
textarea.mono { font-family: ui-monospace, Consolas, monospace; font-size: 12.5px; }
.hr-fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 4px 16px; font-size: 13px; }
.hr-fields div { display: flex; flex-direction: column; padding: 4px 0; border-bottom: 1px solid #f0f2f1; }
.hr-fields code { font-size: 12px; color: var(--brand); }
.hr-docmeta-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.hr-events summary { cursor: pointer; font-size: 13px; color: var(--muted); margin-top: 8px; }
.hr-events ul { font-size: 12.5px; color: var(--muted); padding-left: 18px; }
.hr-save-bar { position: sticky; bottom: 0; background: rgba(243, 245, 244, .95); padding: 10px; border-radius: 12px; justify-content: flex-end; }
/* Аркуш А4 */
.hr-paper-wrap { overflow-x: auto; padding: 8px 0 24px; }
.hr-a4 { width: 210mm; min-height: 297mm; margin: 0 auto; background: #fff; box-shadow: 0 2px 16px rgba(0, 0, 0, .12); padding: 20mm 15mm 20mm 25mm;
  box-sizing: border-box; font-family: "Times New Roman", Times, serif; font-size: 12pt; line-height: 1.4; color: #000; caret-color: auto; }
.hr-a4.editing { outline: 2px dashed #9fc3b0; outline-offset: 4px; }
.hr-a4 h1 { font-size: 14pt; margin: 10pt 0 8pt; font-weight: 700; letter-spacing: .02em; }
.hr-a4 h3 { font-size: 12pt; margin: 10pt 0 4pt; }
.hr-a4 p { margin: 0 0 6pt; }
.hr-a4 .right { text-align: right; } .hr-a4 .center { text-align: center; }
.hr-a4 .indent { text-indent: 1.25cm; text-align: justify; }
.hr-a4 .small { font-size: 10pt; } .hr-a4 .muted { color: #555; }
.hr-a4 table { width: 100% !important; display: table !important; table-layout: fixed; border-collapse: collapse; margin: 8pt 0; }
.hr-a4 td, .hr-a4 th { overflow-wrap: anywhere; }
.hr-a4 table.grid2 td { width: 50%; vertical-align: top; padding: 2pt 4pt; }
.hr-a4 table.sign { margin-top: 18pt; } .hr-a4 table.sign td { padding: 4pt 0; vertical-align: bottom; }
.hr-a4 table.data td, .hr-a4 table.data th { border: 1px solid #000; padding: 4pt 6pt; text-align: left; vertical-align: top; }
.hr-a4 table.data th { background: #f0f0f0; }
.hr-a4 ol, .hr-a4 ul { margin: 0 0 6pt 1cm; padding: 0; }
@media (max-width: 860px) {
  .hr-paper-wrap { overflow-x: hidden; }
  .hr-a4 { width: 100%; min-height: 0; padding: 18px 16px; font-size: 11.5pt; }
}
/* Друк: документ копіюється в #hrPrintRoot (поза інтерфейсом); поля задає @page — однакові на кожному аркуші, без обрізання. */
@page { size: A4; margin: 20mm 15mm 20mm 25mm; }
#hrPrintRoot { display: none; }
@media print {
  body.hr-printing > *:not(#hrPrintRoot) { display: none !important; }
  html:has(body.hr-printing), body.hr-printing { background: #fff !important; background-color: #fff !important; }
  body.hr-printing { margin: 0 !important; padding: 0 !important; }
  body.hr-printing #hrPrintRoot, body.hr-printing .hr-a4-print { background: #fff !important; }
  body.hr-printing .hr-a4-print > :first-child { margin-top: 0 !important; }
  body.hr-printing #hrPrintRoot { display: block !important; }
  body.hr-printing .hr-a4-print { width: auto !important; min-height: 0 !important; margin: 0 !important; padding: 0 !important; box-shadow: none !important;
    outline: none !important; font-size: 12pt !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .hr-a4-print h1, .hr-a4-print h3 { break-after: avoid; page-break-after: avoid; }
  .hr-a4-print table.sign, .hr-a4-print tr, .hr-a4-print li { break-inside: avoid; page-break-inside: avoid; }
  .hr-a4-print p { orphans: 3; widows: 3; }
}
.hr-attn { color: var(--c-orange); }
.hr-tiles-note { margin: -8px 0 14px; }
.hr-filters { flex-wrap: wrap; }
.hr-filters .filter input[type=date] { min-width: 0; }
.hr-legal { padding-left: 20px; display: grid; gap: 6px; font-size: 14px; }
.hr-emp-history { list-style: none; padding: 0; margin: 0 0 10px; display: grid; gap: 6px; font-size: 14px; }
.hr-emp-history li { padding: 8px 10px; border-radius: 10px; background: #f6f8f7; }
.hr-card-counts { color: var(--muted); }
.hr-a4-preview { min-height: 0; transform-origin: top center; }
.hr-fieldchecks { max-height: 55vh; overflow-y: auto; }
@media (max-width: 600px) {
  .hr-filters .filter, .hr-filters .search { flex: 1 1 100%; }
  .hr-filters .filter select, .hr-filters .filter input { width: 100%; }
}
/* --- Трудові договори (0009) --- */
.hr-a4 .missing { background: #fff1c2; color: #8a5a00; border-radius: 3px; padding: 0 3px; font-family: system-ui, sans-serif; font-size: 10pt; }
.hr-a4 table.parties td { padding: 3pt 4pt; vertical-align: top; }
.hr-alerts { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.hr-alert { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 10px; background: #f6f8f7; font-size: 14px; }
.hr-alert-ic { color: var(--muted); display: inline-grid; }
.hr-alert.missing .hr-alert-ic, .hr-alert.fop_unknown .hr-alert-ic, .hr-alert.no_template .hr-alert-ic, .hr-alert.stale .hr-alert-ic { color: var(--c-orange); }
.hr-alert.review .hr-alert-ic { color: var(--c-blue); }
.hr-more summary { cursor: pointer; font-size: 13px; color: var(--muted); margin-top: 6px; }
.hr-people .person { display: flex; gap: 10px; align-items: center; text-decoration: none; color: inherit; }
.hr-emp-head { display: flex; gap: 12px; align-items: center; margin-bottom: 8px; }
.hr-emp-head p { margin: 2px 0 0; }
.hr-timeline { list-style: none; padding: 0 0 0 16px; margin: 0; border-left: 2px solid var(--border); display: grid; gap: 14px; }
.hr-period { position: relative; padding: 10px 12px; border-radius: 12px; background: #fafbfa; }
.hr-period::before { content: ""; position: absolute; left: -23px; top: 16px; width: 10px; height: 10px; border-radius: 50%; background: var(--border); border: 2px solid #fff; }
.hr-period.active::before { background: var(--c-green); } .hr-period.pending::before { background: var(--c-orange); }
.hr-period.ended, .hr-period.cancelled { opacity: .85; }
.hr-period-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.hr-period-dates { margin: 4px 0 2px; font-size: 14px; }
.hr-vers { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 8px; }
.hr-ver { background: #fff; border: 1px solid #eef1ef; border-radius: 10px; padding: 8px 10px; display: grid; gap: 4px; justify-items: start; }
.hr-ver-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
@media (max-width: 600px) {
  .hr-alert { grid-template-columns: auto 1fr; }
  .hr-alert .btn { grid-column: 1 / -1; justify-self: start; }
  .hr-timeline { padding-left: 12px; }
  .hr-period::before { left: -19px; }
}
@media print { .hr-a4-print .missing { background: none !important; color: #000 !important; } }
.grid2 > .hr-sub.full { grid-column: 1 / -1; margin: 8px 0 0; }
.hr-problem { border-top: 1px solid var(--border, #e5e5e5); padding: 8px 0; }
.hr-problem > summary { cursor: pointer; }
.hr-list { margin: 6px 0 0 18px; padding: 0; }
.hr-list li { margin: 3px 0; }
select.hr-map { max-width: 100%; }
.hr-preview { background: var(--surface-2, #f4f6f4); border-radius: 8px; padding: 8px 10px; }
.hr-status-row { display: flex; gap: 10px; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; margin-bottom: 8px; }
.hr-status-form .check-row { display: flex; gap: 8px; align-items: center; margin: 4px 0; }

/* --- Визнання -------------------------------------------------------------------------------------- */
.rec { --gold: #a8844e; --gold-deep: #8a6a3a; --gold-soft: #f7f1e6; --gold-line: rgba(168, 132, 78, .28); max-width: 1320px; margin: 0 auto; }
.rec-hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; flex-wrap: wrap; margin: 4px 0 22px; }
.rec-eyebrow { margin: 0 0 4px; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--gold-deep); font-weight: 600; }
.rec-title { font-size: clamp(30px, 4.2vw, 44px); font-weight: 700; letter-spacing: -.025em; line-height: 1.05; color: var(--text); }
.rec-status { display: inline-flex; align-items: center; gap: 6px; margin-top: 10px; padding: 5px 12px; border-radius: 999px; font-size: 13px; font-weight: 600; }
.rec-status.final { background: var(--gold-soft); color: var(--gold-deep); border: 1px solid var(--gold-line); }
.rec-status.draft { background: var(--c-orange-bg); color: var(--c-orange); }
.rec-nav { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.rec-nav select { padding: 7px 10px; border: 1px solid var(--border); border-radius: 10px; background: #fff; }
.rec-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; align-items: stretch; }
.rec-card { position: relative; display: flex; flex-direction: column; background: #fff; border-radius: 24px; padding: 22px 22px 18px;
  border: 1px solid rgba(16, 44, 33, .06); box-shadow: 0 1px 2px rgba(16, 44, 33, .04), 0 18px 40px -18px rgba(16, 44, 33, .18); min-width: 0; }
.rec-card::before { content: ""; position: absolute; inset: 0 22% auto; height: 3px; border-radius: 0 0 3px 3px; background: linear-gradient(90deg, transparent, var(--gold), transparent); opacity: .75; }
.rec-card.is-draft { border-style: dashed; border-color: var(--gold-line); }
.rec-head { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 2px; margin-bottom: 16px; }
.rec-laurel { width: 52px; height: 26px; color: var(--gold); }
.rec-kicker { font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--text); }
.rec-group { font-size: 12.5px; color: var(--muted); }
.rec-body { flex: 1; display: flex; flex-direction: column; align-items: center; text-align: center; min-width: 0; }
.rec-photo { display: block; width: 100%; padding: 0; border: 0; background: var(--gold-soft); cursor: zoom-in; overflow: hidden; border-radius: 18px; }
.rec-photo img { display: block; width: 100%; height: 100%; object-fit: cover; }
.rec-photo.rec-person { aspect-ratio: 3 / 4; max-width: 300px; box-shadow: 0 0 0 1px var(--gold-line), 0 0 0 6px #fff, 0 0 0 7px var(--gold-line); margin: 7px auto 0; }
.rec-photo.rec-team { height: auto; }
.rec-photo.rec-team img { height: auto; object-fit: contain; }
.rec-photo.none { cursor: default; display: grid; place-items: center; background: #efebe3; }
.rec-photo.none svg { width: 38%; fill: #d4ccbe; }
.rec-name { margin-top: 18px; font-size: 22px; font-weight: 700; letter-spacing: -.015em; line-height: 1.2; overflow-wrap: anywhere; }
.rec-sub { margin-top: 4px; color: var(--muted); font-size: 14px; }
.rec-empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; min-height: 300px;
  width: 100%; border-radius: 18px; background: repeating-linear-gradient(135deg, #fbfaf7 0 10px, #f7f4ee 10px 20px); color: var(--muted); }
.rec-empty-art .rec-laurel { width: 84px; height: 42px; opacity: .45; }
.rec-empty p { margin: 0; font-size: 15px; font-weight: 600; }
.rec-members { width: 100%; margin-top: 14px; text-align: left; border-top: 1px solid var(--border); padding-top: 10px; }
.rec-members summary { cursor: pointer; font-size: 13.5px; color: var(--gold-deep); font-weight: 600; text-align: center; list-style: none; }
.rec-members summary::-webkit-details-marker { display: none; }
.rec-members ul { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 6px; max-height: 260px; overflow: auto; }
.rec-members li { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; }
.rec-members small { color: var(--muted); text-align: right; }
.rec-warn { list-style: none; margin: 12px 0 0; padding: 10px 12px; border-radius: 12px; background: var(--c-orange-bg); color: var(--warn); font-size: 13px; text-align: left; width: 100%; }
.rec-warn li { display: flex; gap: 6px; align-items: flex-start; }
.rec-warn li + li { margin-top: 4px; }
.rec-tools { display: flex; justify-content: center; margin-top: 16px; }
.rec-finalize { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin: 22px 0 0; padding: 16px 20px;
  border-radius: 18px; background: var(--gold-soft); border: 1px solid var(--gold-line); }
.rec-finalize p { margin: 0; max-width: 720px; }
.rec-history { margin-top: 22px; }
.rec-history summary { cursor: pointer; font-weight: 600; }
.rec-history ul { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 10px; font-size: 14px; }
.rec-history li { border-left: 2px solid var(--gold-line); padding-left: 10px; }
.rec-archive { margin-top: 36px; }
.rec-archive h2 { font-size: 21px; font-weight: 700; letter-spacing: -.01em; margin-bottom: 14px; }
.rec-arch-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.rec-arch { display: grid; gap: 6px; padding: 16px 18px; border-radius: 18px; background: #fff; border: 1px solid rgba(16, 44, 33, .07); color: var(--text); text-decoration: none;
  box-shadow: 0 1px 2px rgba(16, 44, 33, .04); transition: box-shadow .15s, transform .15s; }
.rec-arch:hover { box-shadow: 0 10px 26px -14px rgba(16, 44, 33, .3); transform: translateY(-1px); }
.rec-arch-month { font-weight: 700; font-size: 16px; }
.rec-arch-row { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; }
.rec-arch-row small { color: var(--muted); }
.rec-opts { display: grid; gap: 8px; max-height: 52vh; overflow: auto; padding: 2px; }
.rec-opt { display: flex; align-items: center; gap: 12px; padding: 8px 12px; border: 1px solid var(--border); border-radius: 12px; cursor: pointer; background: #fff; }
.rec-opt:has(input:checked) { border-color: var(--gold); background: var(--gold-soft, #f7f1e6); }
.rec-opt img, .rec-opt-ph { width: 42px; height: 56px; border-radius: 8px; object-fit: cover; flex-shrink: 0; }
.rec-opt-ph { display: grid; place-items: center; background: #efebe3; color: #9b917f; font-weight: 700; font-size: 14px; }
.rec-opt-text { display: grid; min-width: 0; }
.rec-opt-text small { color: var(--muted); }
.rec-shared { margin-top: 16px; }
.rec-shared h3 { font-size: 15px; margin-bottom: 2px; }
.modal .rec-opt:has(input:checked) { border-color: #a8844e; background: #f7f1e6; }
@media (max-width: 1180px) {
  .rec-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rec-card.rec-person { grid-column: 1 / -1; }
  .rec-card.rec-person .rec-photo.rec-person { max-width: 260px; }
}
@media (max-width: 720px) {
  .rec-grid { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .rec-card { padding: 18px 16px 14px; border-radius: 20px; }
  .rec-hero { align-items: flex-start; }
  .rec-empty { min-height: 220px; }
  .rec-finalize .btn { width: 100%; justify-content: center; }
}
.rec-statuses { display: flex; flex-wrap: wrap; gap: 0 8px; }
.rec-pending { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 36px 20px; border-radius: 24px; text-align: center;
  background: repeating-linear-gradient(135deg, #fbfaf7 0 10px, #f7f4ee 10px 20px); border: 1px solid rgba(168, 132, 78, .22); color: #6b6253; }
.rec-pending .rec-laurel { width: 84px; height: 42px; color: #a8844e; opacity: .6; }
.rec-pending p { margin: 0; font-size: 18px; font-weight: 600; }
.rec-pending small { font-size: 14px; max-width: 46ch; }

/* --- Головна: блоки в ряд (дні народження, нові, звільнені), окремий ряд «Зустрічі» + «Завдання» ------------------------- */
.hp-row { display: grid; gap: 18px; margin: 4px 0 18px; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: stretch; }
.hp-row.hp-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.hp-row.hp-cols-1 { grid-template-columns: minmax(0, 1fr); }
.hp-block { background: #fff; border: 1px solid rgba(16, 44, 33, .07); border-radius: 18px; min-width: 0;
  box-shadow: 0 1px 2px rgba(16, 44, 33, .04), 0 8px 24px rgba(16, 44, 33, .05); padding: 20px 20px 16px; display: flex; flex-direction: column; }
.hp-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 16px; }
.hp-head h2 { margin: 0; font-size: 17px; font-weight: 650; letter-spacing: -.01em; display: flex; align-items: center; gap: 8px; }
.hp-head h2 .ic { color: var(--brand); }
.hp-head .card-link { white-space: nowrap; padding-top: 2px; }
.hp-sub { margin: 3px 0 0; color: var(--muted); font-size: 13px; }
.hp-body { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.hp-body > .empty { margin: auto 0; }
.hp-people { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 8px; }
.hp-people.is-collapsed > li:nth-child(n+7) { display: none; }
.hp-tile { min-width: 0; }
.hp-tile a, .hp-tile-in { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 2px; padding: 8px 4px 10px; border-radius: 14px;
  color: inherit; text-decoration: none; transition: background-color .15s ease; }
.hp-tile a:hover { background: #f4f6f5; }
.hp-tile a:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.hp-photo { width: 76px; height: 76px; border-radius: 50%; object-fit: cover; background: var(--brand-soft); margin-bottom: 8px; flex: none;
  box-shadow: 0 0 0 1px rgba(16, 44, 33, .06); }
.hp-initials { display: grid; place-items: center; color: var(--brand); font-weight: 650; font-size: 22px; letter-spacing: .02em; }
.hp-name { font-size: 13.5px; font-weight: 600; line-height: 1.25; overflow-wrap: anywhere; }
.hp-meta { font-size: 12px; color: var(--muted); line-height: 1.35; }
.hp-meta .today { color: var(--accent); font-weight: 700; }
.hp-tile.is-today .hp-photo { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--accent); }
.hp-tile.is-dismissed .hp-photo { filter: grayscale(1); opacity: .85; }
.hp-more { margin: 12px auto 0; background: none; border: 0; color: var(--brand); font: inherit; font-size: 13px; font-weight: 600;
  padding: 6px 14px; border-radius: 20px; cursor: pointer; }
.hp-more:hover { background: var(--brand-soft); }
/* «Зустрічі» і «Завдання»: ПК — поруч; планшет — поруч, вужчі відступи; телефон — один під одним (правило 720px нижче). */
@media (max-width: 1180px) {
  .hp-row.hp-cols-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hp-row.hp-cols-3 > .hp-block:last-child { grid-column: 1 / -1; }
  .hp-row.hp-cols-3 > .hp-block:last-child .hp-people { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .hp-row.hp-cols-3 > .hp-block:last-child .hp-people.is-collapsed > li:nth-child(n+7) { display: none; }
  .hp-work { gap: 14px; }
  .hp-work .hp-block { padding: 18px 16px 14px; }
}
@media (max-width: 720px) {
  .hp-row, .hp-row.hp-cols-2, .hp-row.hp-cols-3 { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .hp-row.hp-cols-3 > .hp-block:last-child { grid-column: auto; }
  .hp-block { padding: 16px; overflow: hidden; }
  /* Смартфон: картки людей — горизонтальна стрічка всередині блоку (сторінка не прокручується вбік). */
  .hp-people, .hp-row.hp-cols-3 > .hp-block:last-child .hp-people { display: flex; overflow-x: auto; gap: 4px; margin: 0 -16px; padding: 0 12px 4px;
    scroll-snap-type: x proximity; overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .hp-people::-webkit-scrollbar { display: none; }
  .hp-people.is-collapsed > li:nth-child(n+7),
  .hp-row.hp-cols-3 > .hp-block:last-child .hp-people.is-collapsed > li:nth-child(n+7) { display: block; }
  .hp-tile { flex: 0 0 100px; scroll-snap-align: start; }
  .hp-more { display: none; }
}
/* --- «Коди доступу» Poster / Ajax (codes.js): у шапці картки — компактний рядок; на телефоні — один під одним ------------- */
.codes-block { margin: 0 0 12px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg); text-align: left; }
.codes-title { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.codes-title .ic { color: var(--brand); }
.codes-items { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 6px 18px; }
.code-item { display: flex; align-items: center; gap: 8px; min-width: 0; min-height: 34px; }
.code-label { font-size: 12px; font-weight: 700; color: var(--muted); flex: 0 0 48px; }
.code-value { flex: 1; min-width: 0; font-weight: 600; overflow-wrap: anywhere; }
.code-value .muted { font-weight: 500; font-size: 13.5px; }
.code-mask { letter-spacing: .12em; }
.code-val { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 14.5px; background: var(--card); border: 1px solid var(--border);
  border-radius: 6px; padding: 1px 6px; user-select: all; }
.code-btns { display: flex; gap: 2px; flex: none; }
.code-btns .icon-btn { width: 34px; height: 34px; }
.codes-card { padding: 14px 16px; }
.codes-card .codes-block { margin: 0; border: 0; padding: 0; background: none; }
.codes-home .codes-title { font-size: 15px; color: inherit; }
@media (max-width: 720px) {
  .codes-items { grid-template-columns: minmax(0, 1fr); }
  .code-btns .icon-btn { width: 40px; height: 40px; }   /* зручне натискання пальцем */
}

/* --- Рейтинг: оцінювання працівників і команд (ratings.js) ------------------------------------- */
.rt { display: grid; gap: 16px; min-width: 0; }
.rt .card { margin-bottom: 0; }
.rt-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.rt-tab { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 999px; text-decoration: none; color: var(--text); background: var(--card); border: 1px solid var(--border); font-weight: 600; font-size: 14px; }
.rt-tab.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.rt-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.rt-month { display: inline-flex; align-items: center; gap: 6px; }
.rt-month strong { min-width: 150px; text-align: center; font-size: 17px; }
.rt-banner { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 16px; border-radius: var(--radius); background: var(--card); border: 1px solid var(--border); font-size: 14px; color: var(--muted); }
.rt-banner > span, .rt-banner > div { flex: 1 1 260px; }
.rt-banner.final { background: var(--brand-soft); border-color: #cfe2d6; color: var(--text); }
.rt-banner.final .ic { color: var(--brand); }
.rt-grid { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 16px; align-items: start; }
.rt-teams { display: grid; gap: 16px; }
.rt-board-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.rt-board-head h2, .rt-h2 { font-size: 17px; }
.rt-h2 { margin-bottom: 10px; }
.rt-h3 { font-size: 15px; margin: 16px 0 6px; }
.rt-list { list-style: none; margin: 0; padding: 0; }
.rt-row { display: grid; grid-template-columns: 34px 44px minmax(0, 1fr) auto auto; align-items: center; gap: 12px; padding: 10px 4px; border-top: 1px solid var(--border); }
.rt-row:first-child { border-top: 0; }
.rt-row.team { grid-template-columns: 34px minmax(0, 1fr) auto auto; }
.rt-row.win { background: linear-gradient(90deg, #fbf5ec, transparent); border-radius: 10px; }
.rt-place { font-weight: 700; font-size: 17px; color: var(--muted); text-align: center; }
.rt-row.top .rt-place { color: var(--accent); }
.rt-ava { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; background: var(--brand-soft); }
.rt-ava.ph { display: grid; place-items: center; font-weight: 700; color: var(--brand); font-size: 15px; }
.rt-who { display: grid; min-width: 0; }
.rt-who b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rt-who small { color: var(--muted); font-size: 12.5px; }
.rt-stats { display: flex; gap: 14px; }
.rt-stat { display: grid; text-align: right; font-size: 13px; }
.rt-stat small, .rt-score small { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .03em; }
.rt-stat i { font-style: normal; color: var(--muted); font-weight: 400; }
.rt-stat.plus b, .rt .plus { color: var(--c-green); }
.rt-stat.minus b, .rt .minus { color: var(--danger); }
.rt-score { display: grid; text-align: right; min-width: 76px; }
.rt-score b { font-size: 20px; letter-spacing: -.01em; }
.rt-none { margin: 8px 0; }
.rt-help summary { cursor: pointer; font-weight: 600; }
/* Оцінювання */
.rt-step h2 { font-size: 16px; display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.rt-n { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); font-size: 13px; font-weight: 700; }
.rt-date { font-size: 16px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: #fff; }
.rt-chips { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; }
.rt-chips.two { grid-template-columns: 1fr 1fr; }
.rt-chip { display: grid; gap: 2px; padding: 12px; border-radius: 12px; border: 1px solid var(--border); background: #fff; font-weight: 600; cursor: pointer; text-align: left; min-height: 48px; }
.rt-chip small { color: var(--muted); font-weight: 500; font-size: 12px; }
.rt-chip.big { text-align: center; font-size: 16px; padding: 16px; }
.rt-chip.on { border-color: var(--brand); background: var(--brand-soft); box-shadow: inset 0 0 0 1px var(--brand); }
.rt-chip.on small { color: var(--brand); }
.rt-warn { display: flex; gap: 8px; align-items: flex-start; color: var(--warn); background: var(--c-orange-bg); padding: 10px 12px; border-radius: 10px; font-size: 14px; margin: 0 0 10px; }
.rt-staff-list { list-style: none; margin: 0 0 10px; padding: 0; }
.rt-staff { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 0; border-top: 1px solid var(--border); }
.rt-staff:first-child { border-top: 0; }
.rt-staff label { display: flex; align-items: center; gap: 10px; min-width: 0; cursor: pointer; }
.rt-staff input { width: 20px; height: 20px; accent-color: var(--brand); flex-shrink: 0; }
.rt-staff label span { display: grid; min-width: 0; }
.rt-staff small { color: var(--muted); font-size: 12.5px; }
.rt-add select { width: 100%; padding: 10px 12px; border: 1px dashed #c5d2cb; border-radius: 10px; background: #fff; font-size: 15px; }
.rt-team-cta { margin-top: 14px; }
.rt-team-cta .btn { width: 100%; justify-content: center; }
.rt-confirm { text-align: center; padding: 4px 0 8px; }
.rt-confirm .rt-big { font-size: 20px; font-weight: 700; margin: 0 0 4px; }
.rt-confirm p { margin: 4px 0; }
.rt-who-card { display: flex; align-items: center; justify-content: space-between; gap: 10px; position: sticky; top: 64px; z-index: 5; }
.rt-who-card > div { display: grid; min-width: 0; }
.rt-who-card b { font-size: 17px; }
.rt-note { margin: 0; }
.rt-cat { padding-top: 0; padding-bottom: 0; margin-bottom: 10px; }
.rt-cat-head { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 56px; padding: 12px 0; border: 0; background: transparent;
  font: inherit; color: inherit; text-align: left; cursor: pointer; }
.rt-cat-title { flex: 1; min-width: 0; font-size: 16px; font-weight: 700; }
.rt-chev { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--brand-soft); color: var(--brand);
  flex-shrink: 0; transition: transform .25s ease; }
.rt-cat.open .rt-chev { transform: rotate(90deg); }
.rt-cat-body { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .25s ease; }
.rt-cat.open .rt-cat-body { grid-template-rows: 1fr; }
.rt-cat-inner { overflow: hidden; min-height: 0; visibility: hidden; transition: visibility 0s linear .25s; }
.rt-cat.open .rt-cat-inner { visibility: visible; transition-delay: 0s; padding-bottom: 12px; }
.rt-cat-tools { display: flex; justify-content: flex-end; padding-top: 2px; border-top: 1px solid var(--border); }
.rt-sub { font-weight: 700; color: var(--brand); white-space: nowrap; }
.rt-sub.down { color: var(--warn); }
.rt-total { display: grid; gap: 0; }
.rt-total > small:first-child { font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
.rt-total b { font-size: 26px; color: var(--brand); }
@media (prefers-reduced-motion: reduce) { .rt-cat-body, .rt-chev, .rt-cat-inner { transition: none; } }
.rt-crits { list-style: none; margin: 0; padding: 0; }
.rt-crit { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--border); }
.rt-crit:first-child { border-top: 0; }
.rt-crit-text { display: grid; justify-items: start; gap: 2px; font-size: 14.5px; min-width: 0; text-align: left; }
.rt-team-cta .btn:disabled { opacity: .5; cursor: not-allowed; }
.rt-group { color: var(--accent); font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; }
.rt-var { margin: 4px 0 0; padding-left: 18px; font-size: 13px; color: var(--muted); }
.rt-var li.me { color: var(--text); }
.rt-crit-ctl { display: grid; justify-items: end; gap: 3px; }
.rt-seg, .rt-step-ctl { display: inline-flex; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: #fff; }
.rt-seg button, .rt-step-ctl button { border: 0; border-left: 1px solid var(--border); background: transparent; min-width: 40px; height: 40px; font-weight: 600; cursor: pointer; }
.rt-seg button:first-child, .rt-step-ctl button:first-child { border-left: 0; }
.rt-seg button.on, .rt-step-ctl button.on { background: var(--brand); color: #fff; }
.rt-step-ctl output { display: grid; place-items: center; min-width: 42px; font-weight: 700; border-left: 1px solid var(--border); }
.rt-result { font-size: 18px; margin: 0 0 4px; }
.rt-result b { font-size: 30px; color: var(--brand); }
.rt-adj-list { list-style: none; margin: 0 0 10px; padding: 0; }
.rt-adj-list li { display: flex; align-items: center; gap: 8px; padding: 4px 0; }
.rt-adj-list li span { font-weight: 700; min-width: 40px; }
.rt-adj-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.rt-comment { width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; font-size: 15px; resize: vertical; }
.rt-savebar { position: sticky; bottom: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 16px; background: rgba(255, 255, 255, .96);
  border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 -4px 18px rgba(16, 44, 33, .08); }
.rt-tie { border: 1px solid var(--border); border-radius: 10px; padding: 8px 12px; margin: 8px 0; }
/* Історія */
.rt-hist { list-style: none; margin: 0; padding: 0; }
.rt-h { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--border); }
.rt-h:first-child { border-top: 0; }
.rt-h.deleted { opacity: .6; }
.rt-h-main { display: grid; gap: 2px; min-width: 0; }
.rt-h-main small { font-size: 12.5px; }
.rt-h-main .badge { justify-self: start; }
.rt-h-score { font-size: 20px; font-weight: 700; text-align: right; }
.rt-h-score small { font-size: 12px; color: var(--muted); font-weight: 500; }
.rt-h-act { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.rt-dtable td:last-child, .rt-dtable th:last-child { text-align: right; white-space: nowrap; }
.rt-dcat th { background: var(--bg); text-align: left; }
.rt-audit { padding-left: 18px; font-size: 14px; }
.rec-status.rating { text-decoration: none; }
@media (max-width: 1100px) { .rt-grid { grid-template-columns: 1fr; } }
@media (max-width: 720px) {
  .rt-row { grid-template-columns: 26px 40px minmax(0, 1fr) auto; gap: 10px; }
  .rt-row.team { grid-template-columns: 26px minmax(0, 1fr) auto; }
  .rt-row .rt-stats { grid-column: 3 / -1; grid-row: 2; justify-content: flex-start; gap: 16px; }
  .rt-row.team .rt-stats { grid-column: 2 / -1; }
  .rt-stat { text-align: left; }
  .rt-ava { width: 40px; height: 40px; }
  .rt-crit { grid-template-columns: 1fr; gap: 8px; }
  .rt-crit-ctl { justify-items: start; grid-auto-flow: column; align-items: center; justify-content: space-between; }
  .rt-seg button, .rt-step-ctl button { min-width: 44px; height: 44px; }
  .rt-h { grid-template-columns: minmax(0, 1fr) auto; }
  .rt-h-act { grid-column: 1 / -1; justify-content: flex-start; }
  .rt-who-card { top: 56px; }
  .rt-savebar { flex-direction: column; align-items: stretch; text-align: center; }
  .rt-month strong { min-width: 120px; }
  .rt-date { width: 100%; }
}
/* Рейтинг: окремі нарахування (додаткові бали, штрафні бали, «Святковий настрій») */
.modal .plus { color: var(--c-green); } .modal .minus { color: var(--danger); }
.rt-tab.bonus { border-color: #b9dcc6; }
.rt-tab.penalty { border-color: #efc4c0; }
.rt-tab.holiday { border-color: #ecd0b4; }
.rt-tab.bonus .ic, .rt-tab.bonus svg { color: var(--c-green); }
.rt-tab.penalty .ic, .rt-tab.penalty svg { color: var(--danger); }
.rt-tab.holiday .ic, .rt-tab.holiday svg { color: var(--accent); }
.rt-tab.on.bonus { background: var(--c-green); border-color: var(--c-green); }
.rt-tab.on.penalty { background: var(--danger); border-color: var(--danger); }
.rt-tab.on.holiday { background: var(--accent); border-color: var(--accent); }
.rt-tab.on svg { color: #fff; }
.rt-q-head h2 { display: flex; align-items: center; gap: 8px; font-size: 18px; margin: 0 0 4px; }
.rt-q-head p { margin: 0; }
.rt-quick.bonus .rt-q-head { border-top: 3px solid var(--c-green); }
.rt-quick.penalty .rt-q-head { border-top: 3px solid var(--danger); }
.rt-quick.holiday .rt-q-head { border-top: 3px solid var(--accent); }
.rt-done { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; margin-bottom: 14px; border-radius: 12px; background: var(--c-green-bg); color: var(--c-green); }
.rt-done b { color: var(--text); }
.rt-reasons { display: grid; gap: 8px; border: 0; padding: 0; margin: 0 0 10px; min-width: 0; }
.rt-reason { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 12px; background: #fff; cursor: pointer; }
.rt-reason input { width: 18px; height: 18px; accent-color: var(--brand); flex-shrink: 0; margin: 0; }
.rt-reason span { flex: 1; min-width: 0; font-weight: 600; }
.rt-reason b { white-space: nowrap; font-size: 14px; }
.rt-reason.on { border-color: var(--brand); background: var(--brand-soft); box-shadow: inset 0 0 0 1px var(--brand); }
.rt-pts-label { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin: 6px 0; }
.rt-pts-fixed { margin: 6px 0; font-size: 15px; }
.rt-pts-fixed b { font-size: 20px; }
.rt-opts { display: flex; gap: 8px; flex-wrap: wrap; }
.rt-opt { position: relative; }
.rt-opt input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.rt-opt span { display: grid; place-items: center; min-width: 64px; min-height: 48px; padding: 0 14px; border: 1px solid var(--border); border-radius: 12px; background: #fff; font-weight: 700; font-size: 17px; }
.rt-opt.on span { border-color: var(--brand); background: var(--brand); color: #fff; }
.rt-opt input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }
.rt-range { display: inline-flex; align-items: center; gap: 6px; }
.rt-range span { font-size: 22px; font-weight: 700; }
.rt-range input { width: 110px; height: 48px; font-size: 18px; font-weight: 700; padding: 0 12px; border: 1px solid var(--border); border-radius: 12px; }
.rt-whos { display: grid; gap: 8px; margin-bottom: 10px; }
.rt-who-opt { display: flex; align-items: center; gap: 10px; min-height: 56px; padding: 8px 12px; border: 1px solid var(--border); border-radius: 12px; background: #fff; cursor: pointer; }
.rt-who-opt input { width: 18px; height: 18px; accent-color: var(--brand); flex-shrink: 0; margin: 0; }
.rt-who-opt > span:last-child { display: grid; min-width: 0; }
.rt-who-opt small { color: var(--muted); font-size: 12.5px; }
.rt-who-opt.team svg { color: var(--brand); flex-shrink: 0; }
.rt-who-opt.on { border-color: var(--brand); background: var(--brand-soft); box-shadow: inset 0 0 0 1px var(--brand); }
.rt-ava.sm { width: 34px; height: 34px; font-size: 13px; flex-shrink: 0; }
.rt-limit { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 10px 12px; margin-bottom: 10px; border-radius: 10px; background: var(--c-orange-bg); color: var(--text); font-size: 14px; }
.rt-limit.full { background: var(--c-red-bg); }
.rt-filters { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; align-items: end; margin-bottom: 10px; }
.rt-f { display: grid; gap: 3px; min-width: 0; }
.rt-f span { font-size: 12px; color: var(--muted); font-weight: 600; }
.rt-f select, .rt-f input { width: 100%; min-width: 0; height: 40px; padding: 0 10px; border: 1px solid var(--border); border-radius: 10px; background: #fff; font-size: 14px; }
.rt-sums { margin: 0 0 6px; }
@media (max-width: 720px) {
  .rt-tabs { display: grid; grid-template-columns: 1fr 1fr; }
  .rt-tab { justify-content: center; padding: 10px 8px; font-size: 13.5px; min-height: 44px; text-align: center; }
  .rt-filters { grid-template-columns: 1fr 1fr; }
  .rt-opt span { min-width: 72px; }
}
.rt-savebar .btn:disabled, .rt-q-save:disabled { opacity: .5; cursor: not-allowed; }
/* Рейтинг з грудня 2026: назва команди / працівника відкриває результати по днях; джерела денного результату */
.rt-link { background: none; border: 0; padding: 0; margin: 0; font: inherit; font-weight: 700; color: inherit; text-align: left; cursor: pointer;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-decoration: underline dotted; text-underline-offset: 3px; min-height: 24px; }
.rt-link:hover, .rt-link:focus-visible { color: var(--brand); }
.rt-days td { vertical-align: top; }
.rt-days tr.auto td { background: #fdf8f0; }
.rt-days tr.none td { color: var(--muted); }
.rt-days td.rt-sh { font-weight: 600; white-space: nowrap; text-align: center; }
.rt-days .rt-src .badge { white-space: normal; text-align: left; overflow-wrap: anywhere; }
.rt-days td { overflow-wrap: anywhere; }
.rt-days td:first-child, .rt-days td:last-child { white-space: nowrap; overflow-wrap: normal; }
.rt-days th { white-space: normal; }
.modal .table-wrap:has(.rt-days) { max-width: 100%; }
@media (max-width: 560px) { .rt-days th, .rt-days td { padding-left: 6px; padding-right: 6px; } }
.rt-days tr.s2 td { border-bottom-width: 2px; }
.rt-src { margin-top: 6px; font-size: 13px; line-height: 1.35; }
/* Вузька колонка рейтингу на ПК (поруч дві колонки) — як на мобільному: показники під назвою, назва не стискається */
.rt-board { container-type: inline-size; }
@container (max-width: 560px) {
  .rt-row { grid-template-columns: 26px 40px minmax(0, 1fr) auto; gap: 10px; }
  .rt-row.team { grid-template-columns: 26px minmax(0, 1fr) auto; }
  .rt-row .rt-stats { grid-column: 3 / -1; grid-row: 2; justify-content: flex-start; gap: 16px; }
  .rt-row.team .rt-stats { grid-column: 2 / -1; }
  .rt-stat { text-align: left; }
}

/* Рейтинг з грудня 2026: більше показників у рядку (середній бал, додаткові, штрафні, відпрацьовано, оцінок, авто) — переносяться, без прокручування */
.rt-stats { flex-wrap: wrap; justify-content: flex-end; row-gap: 6px; min-width: 0; }
.rt-noelig { color: var(--muted); }
@media (max-width: 900px) {
  .rt-row .rt-stats { justify-content: flex-start; column-gap: 14px; }
}

/* Рейтинг: окремі блоки оцінювання команд на зміні */
.rt-teams { list-style: none; margin: 10px 0; padding: 0; display: grid; gap: 8px; }
.rt-tblock { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 12px; }
.rt-tblock > span { display: grid; gap: 2px; min-width: 0; }
.rt-tblock small { color: var(--muted); font-size: 12.5px; overflow-wrap: anywhere; }
.rt-team-cta .rt-tblock .btn { width: auto; flex-shrink: 0; }
.rt-tblock .badge { flex-shrink: 0; }
/* Рейтинг: єдине оцінювання зміни для кількох команд (одна форма, одне збереження) */
.rt-bteams { list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 6px; }
.rt-bteams li { display: grid; gap: 2px; padding: 10px 12px; border-radius: 10px; background: var(--bg, #f6f6f4); }
.rt-bteams small { color: var(--muted); font-size: 12.5px; overflow-wrap: anywhere; }
.rt-modes { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.rt-mode { display: grid; gap: 4px; text-align: left; padding: 14px 16px; border: 1px solid var(--border); border-radius: 14px; background: #fff; font: inherit; color: inherit; cursor: pointer; min-height: 44px; }
.rt-mode small { color: var(--muted); font-size: 13px; }
.rt-mode.on { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand) inset; background: #fbf8f5; }
.rt-ttabs { position: sticky; top: 154px; z-index: 4; display: grid; grid-template-columns: repeat(auto-fit, minmax(104px, 1fr)); gap: 8px; margin: 0 0 10px; padding: 8px; border-radius: 14px; background: rgba(255, 255, 255, .96); border: 1px solid var(--border); }
.rt-ttab { display: grid; gap: 4px; justify-items: start; text-align: left; padding: 10px 12px; border: 1px solid transparent; border-radius: 10px; background: transparent; font: inherit; color: inherit; cursor: pointer; min-width: 0; min-height: 44px; }
.rt-ttab b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.rt-ttab small { color: var(--muted); font-size: 12px; }
.rt-ttab.on { background: #fbf8f5; border-color: var(--brand); }
.rt-btools { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 10px; }
.rt-btools .btn { white-space: normal; text-align: left; }
.rt-scope { display: flex; align-items: center; gap: 6px; margin: 4px 0 10px; }
.rt-sum td, .rt-sum th { white-space: nowrap; }
.rt-sum td:first-child { white-space: normal; }
.rt-batch .rt-savebar .rt-total > span { overflow-wrap: anywhere; }
.rt-hg { list-style: none; border: 1px solid var(--border); border-radius: 14px; padding: 12px 14px; margin: 0 0 10px; }
.rt-hg-head { display: grid; gap: 3px; }
.rt-hg-res { display: flex; flex-wrap: wrap; gap: 4px 8px; font-size: 15px; }
.rt-hg-res i { color: var(--muted); font-style: normal; }
.rt-hg-res .del { color: var(--muted); text-decoration: line-through; }
.rt-hsub { margin-top: 8px; padding-left: 0; }
.rt-hsub > .rt-h:last-child { border-bottom: 0; }
@media (max-width: 640px) {
  .rt-modes { grid-template-columns: 1fr; }
  .rt-ttabs { position: static; padding: 6px; gap: 6px; grid-template-columns: repeat(auto-fit, minmax(92px, 1fr)); }
  .rt-ttab { padding: 8px; }
}
.rt-savebar .rt-total .rt-tm { font-size: 15px; line-height: 1.4; }
.rt-savebar .rt-total .rt-tm b { font-size: 18px; }

/* --- Ролі й права (03.12.2026) --- */
.role-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; margin-bottom: 10px; }
.role-card { display: grid; gap: 4px; text-align: left; padding: 12px 14px; border: 1px solid var(--border); border-radius: 12px; background: #fff; font: inherit; cursor: pointer; color: inherit; }
.role-card b { font-weight: 700; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.role-card small { color: var(--muted); font-size: 12.5px; line-height: 1.35; }
.role-card:hover:not(:disabled) { border-color: var(--brand); }
.role-card.current { border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); background: #f2f7f4; cursor: default; }
.role-card:disabled { opacity: .55; cursor: not-allowed; }
.role-card:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.acc-role-tail { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 6px; }
.role-chip { display: inline-block; font-weight: 600; }
.role-chip.role-owner { color: var(--brand); }
.acc-manual { margin-left: 6px; font-size: 11px; vertical-align: middle; }
.acc-unset { margin-left: 6px; font-size: 12px; }
.acc-row.manual, .acc-act-row.manual { background: linear-gradient(90deg, #fff4e8, transparent 70%); }
.acc-act-row { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; border-radius: 8px; }
.acc-effective { margin: 0; padding-left: 18px; columns: 2 280px; column-gap: 24px; font-size: 14px; }
.acc-effective li { break-inside: avoid; padding: 2px 0; }
.acc-effective li.manual { font-weight: 600; }
.acc-mode { border: 1px solid var(--border); border-radius: 10px; padding: 8px 12px; margin: 0 0 10px; display: grid; gap: 6px; }
.acc-mode legend { font-weight: 600; padding: 0 4px; }
@media (max-width: 600px) { .role-cards { grid-template-columns: 1fr 1fr; } .acc-effective { columns: 1; } }
/* Ролі й права, етап 2: підсумок попереднього перегляду, системні дозволи поза роллю */
.acc-counts { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 8px; }
.acc-act-row.locked { opacity: .7; justify-content: space-between; padding: 2px 0; }
.acc-act-row.locked .acc-act { display: inline-flex; align-items: center; gap: 6px; }

/* «Роль і права» → блок «Кадрові документи» (04.12.2026) */
.acc-hr-sum { display: block; margin-top: 2px; }
.acc-hr-row > .acc-hr { flex: 1 1 100%; margin-top: 0; }
.acc-hr .acc-hr-sec .acc-acts { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 4px 16px; }
.acc-hr-sec { margin: 10px 0 4px 12px; }
.acc-hr-sec + .acc-hr-sec { border-top: 1px dashed var(--border); padding-top: 6px; }
.acc-hr-sec h4 { margin: 0 0 4px; font-size: 13px; font-weight: 700; }
.acc-hr-sec .acc-act { align-items: flex-start; }
.acc-hr-sec .acc-act input { margin-top: 3px; flex: none; }
.chip-radio.acc-custom { cursor: default; }
.chip-radio.acc-custom span { background: #fff4e8; border-color: #f0a35b; color: #8a4300; }
@media (max-width: 600px) { .acc-hr-sec { margin-left: 0; } .acc-hr .acc-hr-sec .acc-acts { grid-template-columns: 1fr; } }
