/* Booritass — панель. Розовое матовое стекло, мягкое свечение кнопок. */
:root {
  --bg: #f6dbe5;
  --ink: #2a0f1c;
  --muted: #7a5867;
  --line: rgba(122, 22, 66, .12);
  --glass: rgba(255, 255, 255, .62);
  --glass-strong: rgba(255, 255, 255, .8);
  --glass-border: rgba(255, 255, 255, .85);
  --rose: #ff4f9a;
  --rose-hot: #ff2f86;
  --rose-ink: #c2185b;

  --expired: #c62842;
  --expired-bg: #ffdfe4;
  --soon: #a35f00;
  --soon-bg: #ffefd2;
  --missing: #7a6470;
  --missing-bg: #f1e6eb;
  --ok: #13805a;
  --ok-bg: #d9f3e7;

  --radius: 18px;
  --ease: cubic-bezier(.22, 1, .36, 1);
  --glow: 0 0 18px rgba(255, 79, 154, .5), 0 0 44px rgba(255, 79, 154, .25);
  --glow-strong: 0 0 24px rgba(255, 79, 154, .7), 0 0 64px rgba(255, 79, 154, .35);
  --shadow: 0 10px 40px rgba(122, 22, 66, .1);
  --display: "Unbounded", "Inter Tight", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { min-height: 100%; }
body {
  margin: 0; min-height: 100vh; color: var(--ink);
  font: 500 15px/1.5 "Inter Tight", system-ui, -apple-system, "Segoe UI", sans-serif;
  background: linear-gradient(170deg, #fbe8ef 0%, var(--bg) 45%, #efc6d6 100%) fixed;
  -webkit-font-smoothing: antialiased;
}
.bg-blobs { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.bg-blobs span { position: absolute; border-radius: 50%; filter: blur(70px); opacity: .55; animation: drift 24s ease-in-out infinite alternate; }
.bg-blobs span:nth-child(1) { width: 520px; height: 520px; left: -160px; top: 30%; background: #ff8fbe; }
.bg-blobs span:nth-child(2) { width: 460px; height: 460px; right: -120px; top: -140px; background: #ffb6d3; animation-duration: 30s; }
.bg-blobs span:nth-child(3) { width: 380px; height: 380px; right: 18%; bottom: -200px; background: #f9a8d4; animation-duration: 20s; }
@keyframes drift { to { transform: translate(60px, -40px) scale(1.1); } }

a { color: var(--rose-ink); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
h1 { font: 600 26px/1.15 var(--display); letter-spacing: -.035em; margin: 0 0 6px; }
h2 { font-size: 17px; font-weight: 650; letter-spacing: -.01em; margin: 0 0 14px; }
h3 { font-size: 15px; font-weight: 650; margin: 0 0 6px; }
hr { border: 0; border-top: 1px solid var(--line); margin: 18px 0; }
code { background: rgba(255, 79, 154, .1); color: var(--rose-ink); padding: 1px 7px; border-radius: 6px; font-size: 13px; }
pre { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.nowrap { white-space: nowrap; }
.top-gap { margin-top: 18px; }
:focus-visible { outline: 2px solid var(--rose); outline-offset: 2px; }

/* ---------- шапка: плавающая стеклянная пилюля ---------- */
.topbar {
  position: sticky; top: 14px; z-index: 20; margin: 14px auto 0; max-width: 1240px; width: calc(100% - 28px);
  display: flex; align-items: center; gap: 18px; padding: 7px 8px 7px 14px; border-radius: 999px;
  background: var(--glass); border: 1px solid var(--glass-border);
  backdrop-filter: blur(20px) saturate(1.5); -webkit-backdrop-filter: blur(20px) saturate(1.5);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, .8);
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand-name { font: 700 15px var(--display); letter-spacing: .01em; text-transform: uppercase; }
.brand-mark {
  display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 11px; flex-shrink: 0;
  background: linear-gradient(135deg, #ff6aa8, var(--rose-hot)); box-shadow: 0 0 16px rgba(255, 79, 154, .55);
}
.brand-mark svg { width: 18px; height: 18px; fill: #fff; }
.tabs { display: flex; gap: 2px; flex: 1; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a {
  color: var(--muted); padding: 9px 15px; border-radius: 999px; white-space: nowrap; font-size: 14px;
  transition: background .25s var(--ease), color .25s var(--ease), box-shadow .25s var(--ease);
}
.tabs a:hover { background: rgba(255, 255, 255, .7); color: var(--ink); text-decoration: none; }
.tabs a.active { background: var(--ink); color: #fff; box-shadow: 0 0 16px rgba(255, 79, 154, .45); }
.logout {
  display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 14px;
  padding: 9px 14px; border-radius: 999px; transition: background .25s;
}
.logout:hover { background: rgba(255, 255, 255, .7); color: var(--ink); text-decoration: none; }
.logout svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.container { max-width: 1240px; margin: 0 auto; padding: 34px 20px 60px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head p { margin: 0; max-width: 720px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ---------- стеклянные карточки ---------- */
.card {
  background: var(--glass); border: 1px solid var(--glass-border); border-radius: var(--radius); padding: 22px;
  backdrop-filter: blur(18px) saturate(1.4); -webkit-backdrop-filter: blur(18px) saturate(1.4);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, .8);
}
.card.narrow { max-width: 640px; }
.card.empty { text-align: center; padding: 48px 20px; }
.table-card { padding: 0; overflow: hidden; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* появление блоков */
@media (prefers-reduced-motion: no-preference) {
  .container > * { animation: rise .7s var(--ease) both; }
  .container > *:nth-child(2) { animation-delay: .06s; }
  .container > *:nth-child(3) { animation-delay: .12s; }
  .container > *:nth-child(4) { animation-delay: .18s; }
  .container > *:nth-child(n+5) { animation-delay: .24s; }
  .checks > .card { animation: rise .7s var(--ease) both; }
  .checks > .card:nth-child(2) { animation-delay: .05s; }
  .checks > .card:nth-child(3) { animation-delay: .1s; }
  .checks > .card:nth-child(4) { animation-delay: .15s; }
  .checks > .card:nth-child(n+5) { animation-delay: .2s; }
}
@keyframes rise { from { opacity: 0; transform: translateY(16px); } }

/* ---------- формы ---------- */
label { display: flex; flex-direction: column; gap: 5px; font-size: 13px; color: var(--muted); }
input, select, textarea {
  font: inherit; font-weight: 500; color: var(--ink); padding: 10px 13px; min-width: 0; min-height: 44px;
  border: 1px solid rgba(122, 22, 66, .14); border-radius: 12px; background: rgba(255, 255, 255, .78);
  transition: border-color .2s, box-shadow .2s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--rose); box-shadow: 0 0 0 4px rgba(255, 79, 154, .16); }
input[type=checkbox] { min-height: 0; width: 20px; height: 20px; accent-color: var(--rose-hot); }
input[type=file] { padding: 9px; }
input.num { width: 92px; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.inline { display: inline; }
.filters { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; align-items: center; }
.filters input[type=search] { flex: 1; min-width: 220px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px;
  font: inherit; font-size: 14px; font-weight: 600; padding: 10px 18px; border-radius: 999px; cursor: pointer;
  border: 1px solid rgba(255, 255, 255, .9); background: rgba(255, 255, 255, .72); color: var(--ink);
  transition: transform .3s var(--ease), box-shadow .3s var(--ease), background .25s;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); background: #fff; box-shadow: 0 6px 20px rgba(122, 22, 66, .12); }
.btn:active { transform: translateY(0); }
.btn-primary { background: linear-gradient(135deg, #ff6aa8, var(--rose-hot)); border-color: transparent; color: #fff; box-shadow: var(--glow); }
.btn-primary:hover { background: linear-gradient(135deg, #ff6aa8, var(--rose-hot)); box-shadow: var(--glow-strong); }
.btn-danger { color: var(--expired); }
.btn-danger:hover { background: var(--expired-bg); }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-small { min-height: 36px; padding: 6px 13px; font-size: 13px; }
.btn-wide { width: 100%; }
.icon-btn {
  border: 0; background: none; color: var(--muted); font-size: 20px; cursor: pointer; line-height: 1;
  width: 36px; height: 36px; border-radius: 50%; transition: background .2s, color .2s;
}
.icon-btn:hover { color: var(--expired); background: var(--expired-bg); }

.flash { padding: 12px 16px; border-radius: 14px; margin-bottom: 18px; font-weight: 600; border: 1px solid rgba(255, 255, 255, .7); backdrop-filter: blur(10px); }
.flash-ok { background: rgba(217, 243, 231, .85); color: var(--ok); }
.flash-error { background: rgba(255, 223, 228, .9); color: var(--expired); }

/* ---------- статусы ---------- */
.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 650; white-space: nowrap; }
.badge-expired { background: var(--expired-bg); color: var(--expired); }
.badge-soon { background: var(--soon-bg); color: var(--soon); }
.badge-missing { background: var(--missing-bg); color: var(--missing); }
.badge-ok { background: var(--ok-bg); color: var(--ok); }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 7px; vertical-align: middle; }
.dot-expired { background: var(--expired); box-shadow: 0 0 8px var(--expired); }
.dot-soon { background: #e39400; }
.dot-missing { background: #c3b2ba; }
.dot-ok { background: var(--ok); }
.legend { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 14px; }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 22px; }
.stat {
  position: relative; overflow: hidden; display: flex; flex-direction: column; gap: 2px; padding: 18px 20px;
  border-radius: var(--radius); color: var(--muted); font-size: 14px;
  background: var(--glass); border: 1px solid var(--glass-border);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); box-shadow: var(--shadow);
  transition: transform .4s var(--ease), box-shadow .4s var(--ease);
}
.stat::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 4px; }
.stat:hover { text-decoration: none; transform: translateY(-4px); box-shadow: 0 16px 40px rgba(122, 22, 66, .16); }
.stat-num { font: 600 36px/1.1 var(--display); letter-spacing: -.05em; }
.stat-expired::before { background: var(--expired); } .stat-expired .stat-num { color: var(--expired); }
.stat-soon::before { background: #e39400; } .stat-soon .stat-num { color: var(--soon); }
.stat-missing::before { background: #c3b2ba; } .stat-missing .stat-num { color: var(--missing); }
.stat-ok::before { background: var(--ok); } .stat-ok .stat-num { color: var(--ok); }
.stat-expired:hover { box-shadow: 0 16px 40px rgba(198, 40, 66, .2); }

/* ---------- таблицы ---------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 650; background: rgba(255, 255, 255, .45); }
tbody tr { transition: background .2s; }
tbody tr:hover { background: rgba(255, 255, 255, .45); }
tr:last-child td { border-bottom: 0; }
td a { font-weight: 600; }
table.compact td, table.compact th { padding: 8px 8px; font-size: 14px; }
.card > table.compact { margin: 0 -8px; width: calc(100% + 16px); }

.matrix th:not(.sticky) { min-width: 128px; }
.matrix .sticky { position: sticky; left: 0; z-index: 1; min-width: 250px; background: rgba(255, 246, 249, .96); box-shadow: 1px 0 0 var(--line); }
.cell { white-space: nowrap; font-size: 14px; font-variant-numeric: tabular-nums; }
.cell a { color: inherit; display: block; font-weight: 500; }
.cell a:hover { text-decoration: none; }
.cell-expired { background: var(--expired-bg); color: var(--expired); }
.cell-expired a, .cell-soon a { font-weight: 700; }
.cell-soon { background: var(--soon-bg); color: var(--soon); }
.cell-missing { color: #b6a3ac; }
.cell-ok { color: var(--ink); }

/* ---------- карточка сотрудника ---------- */
.checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 14px; }
.check { padding: 18px; scroll-margin-top: 96px; position: relative; overflow: hidden; }
.check::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; }
.check-expired::before { background: var(--expired); box-shadow: 0 0 12px var(--expired); }
.check-soon::before { background: #e39400; }
.check-missing::before { background: #c3b2ba; }
.check-ok::before { background: var(--ok); }
.check-head { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.check p { margin: 10px 0; }
details summary { cursor: pointer; color: var(--rose-ink); font-size: 14px; font-weight: 600; margin-top: 6px; width: fit-content; }
.record-form { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; align-items: end; }
.record-form .wide { grid-column: 1 / -1; }

.steps { padding-left: 20px; }
.steps li { margin-bottom: 7px; }
.errors { color: var(--expired); font-size: 14px; }
.digest { white-space: pre-wrap; background: rgba(255, 255, 255, .55); padding: 16px; border-radius: 14px; font: inherit; font-size: 14px; }

/* ---------- вход ---------- */
.login-wrap { min-height: calc(100vh - 94px); display: grid; place-items: center; }
.login-box { width: 100%; max-width: 400px; padding: 30px 28px 28px; background: var(--glass-strong); }
.login-box h1 { margin-top: 18px; }
.login-box p { margin: 0 0 22px; }
.brand-mark-lg { width: 52px; height: 52px; border-radius: 16px; box-shadow: var(--glow); }
.brand-mark-lg svg { width: 26px; height: 26px; }
.back-link { display: block; font-size: 13px; color: var(--muted); margin-bottom: 18px; }

/* ---------- телефон ---------- */
@media (max-width: 800px) {
  .topbar { top: 8px; margin-top: 8px; width: calc(100% - 16px); gap: 6px; padding: 6px; flex-wrap: wrap; border-radius: 24px; }
  .brand { padding-left: 4px; }
  .brand-name { font-size: 13px; }
  .tabs { order: 3; flex-basis: 100%; }
  .tabs a { padding: 8px 13px; }
  .logout { margin-left: auto; }
  .container { padding: 22px 14px 48px; }
  h1 { font-size: 22px; }
  .grid2 { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .stat { padding: 14px 16px; }
  .stat-num { font-size: 30px; }
  .matrix .sticky { min-width: 168px; }
  .checks { grid-template-columns: 1fr; }
  .record-form { grid-template-columns: 1fr; }
  .card { padding: 18px; }
  input, select, textarea { font-size: 16px; } /* iOS не зумит поле */
  .filters input[type=search] { min-width: 100%; }
  .login-wrap { min-height: calc(100vh - 140px); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
