@font-face {
  font-family: "Google Sans";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/fonts/googlesans-cyrillic.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Google Sans";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/fonts/googlesans-cyrillic-ext.woff2") format("woff2");
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
@font-face {
  font-family: "Google Sans";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/fonts/googlesans-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Google Sans";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/fonts/googlesans-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --bg: #f4f6fb;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --ink: #0f172a;
  --ink-2: #334155;
  --muted: #64748b;
  --muted-2: #94a3b8;
  --line: #e5eaf2;
  --line-2: #eef2f7;
  --brand: #2563eb;
  --brand-2: #1d4ed8;
  --brand-soft: #eff6ff;
  --navy: #0b1526;
  --green: #4e7b5f;
  --green-bg: #f3faf5;
  --green-line: #d2e7d9;
  --amber: #8a6d24;
  --amber-bg: #fdfaee;
  --amber-line: #efe3b9;
  --orange: #a26340;
  --orange-bg: #fdf6f1;
  --orange-line: #eed7c5;
  --red: #a05252;
  --red-bg: #fdf5f4;
  --red-line: #f0d8d5;
  --slate: #475569;
  --slate-bg: #f1f5f9;
  --slate-line: #e2e8f0;
  --violet: #6d28d9;
  --violet-bg: #f5f3ff;
  --violet-line: #ddd6fe;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 10px 26px -24px rgba(15, 23, 42, 0.5);
  --font: "Google Sans", "Segoe UI", system-ui, -apple-system, Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body { min-height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 13.5px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: "kern" 1, "liga" 1;
}

body.no-scroll { overflow: hidden; }

a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-2); }

button, input, select, textarea { font-family: inherit; }

h1, h2, h3, h4, p { margin: 0; }

.ico { flex: none; display: block; }

/* ---------- boot ---------- */
.boot-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 14px;
  color: var(--muted);
}
.boot-logo {
  width: 58px;
  height: 58px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  font-size: 28px;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.boot-text { font-size: 13px; }

/* ---------- layout ---------- */
.layout { min-height: 100vh; }

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 244px;
  z-index: 40;
  display: flex;
  flex-direction: column;
  padding: 20px 14px 16px;
  color: var(--ink-2);
  background: #fff;
  border-right: 1px solid var(--line);
  transition: transform 0.22s ease;
}

.brand {
  padding: 2px 8px 18px;
  border-bottom: 1px solid var(--line-2);
}
.brand-word {
  color: var(--ink);
  font-size: 18px;
  font-weight: 650;
  letter-spacing: -0.3px;
  line-height: 1.2;
}
.brand-company {
  margin-top: 3px;
  max-width: 190px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav { display: flex; flex-direction: column; gap: 3px; margin-top: 14px; flex: 1; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 11px;
  border-radius: 8px;
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
}
.nav-item:hover { background: #f1f3f4; color: var(--ink); }
.nav-item.active {
  color: #1a73e8;
  background: #e8f0fe;
  font-weight: 600;
  box-shadow: none;
}
.nav-item .ico { opacity: 0.9; }
.nav-badge {
  margin-left: auto;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: #e8f0fe;
  color: #1a73e8;
  font-size: 10.5px;
  font-weight: 700;
}

.content {
  margin-left: 244px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 28px;
  background: rgba(244, 246, 251, 0.88);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.topbar-left { display: flex; align-items: center; gap: 14px; min-width: 0; }
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.btn.mobile-menu { display: none; }

.view {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 24px 28px 56px;
}

.nav-scrim {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 35;
  background: rgba(15, 23, 42, 0.45);
}

/* ---------- page head ---------- */
.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.page-title {
  font-size: 24px;
  font-weight: 720;
  letter-spacing: -0.45px;
  line-height: 1.22;
}
.page-sub { color: var(--muted); font-size: 13px; margin-top: 5px; max-width: 620px; }
.page-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-left: auto; }
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 600;
  margin-bottom: 10px;
}
.back-link:hover { color: var(--brand); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid transparent;
  border-radius: 9px;
  padding: 8px 13px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.05s;
  text-decoration: none;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.6; cursor: default; transform: none; }
.btn-primary {
  background: var(--brand);
  color: #fff;
  box-shadow: 0 10px 20px -14px rgba(37, 99, 235, 0.95);
}
.btn-primary:hover { background: var(--brand-2); color: #fff; }
.btn-ghost { background: #fff; border-color: var(--line); color: var(--ink-2); }
.btn-ghost:hover { background: var(--surface-2); border-color: #cbd5e1; color: var(--ink); }
.btn-danger { background: #fff; border-color: var(--red-line); color: var(--red); }
.btn-danger:hover { background: var(--red-bg); }
.btn-sm { padding: 6px 10px; border-radius: 8px; font-size: 12.5px; }
.btn-sm .ico { width: 14px; height: 14px; }
.btn-icon {
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink-2);
}
.btn-icon:hover { background: var(--surface-2); }

/* ---------- inputs ---------- */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label { font-size: 11.5px; font-weight: 650; color: var(--muted); }
.field .hint { font-size: 10.5px; color: var(--muted-2); font-weight: 400; }
.input, .select, textarea.input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--ink);
  font-size: 13.5px;
  line-height: 1.25;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.input::placeholder { color: #a7b4c7; }
.input:focus, .select:focus, textarea.input:focus {
  border-color: #93c5fd;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}
.select {
  appearance: none;
  padding-right: 34px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 11px center;
}
textarea.input { resize: vertical; min-height: 76px; }

.search-box { position: relative; flex: 1; min-width: 220px; }
.search-box .ico { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted-2); }
.search-box .input { padding-left: 38px; }

.filter-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.filter-bar .field { min-width: 150px; flex: 0 1 180px; }
.filter-bar .search-box { flex: 1 1 260px; }
.filter-bar .filter-reset { margin-left: 2px; }

/* ---------- cards/stats ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 15px 18px;
  border-bottom: 1px solid var(--line-2);
}
.card-title { font-size: 14px; font-weight: 680; letter-spacing: -0.1px; }
.card-sub { color: var(--muted); font-size: 11px; margin-top: 2px; }
.card-body { padding: 16px 18px; }
.card-body.tight { padding: 0; }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.stat-card {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 15px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  color: inherit;
  overflow: hidden;
  transition: transform 0.12s, box-shadow 0.12s, border-color 0.12s;
}
a.stat-card:hover {
  transform: translateY(-1px);
  border-color: #d7e1ef;
  box-shadow: 0 2px 4px rgba(15, 23, 42, 0.05), 0 16px 34px -24px rgba(15, 23, 42, 0.5);
  color: inherit;
}
.stat-icon {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  flex: none;
  background: var(--brand-soft);
  color: var(--brand);
}
.stat-value { font-size: 24px; font-weight: 760; line-height: 1; letter-spacing: -0.7px; font-variant-numeric: tabular-nums; }
.stat-label { color: var(--muted); font-size: 11.5px; margin-top: 5px; line-height: 1.3; }
.stat-note { color: var(--muted-2); font-size: 10px; margin-top: 6px; }
.stat-card.is-red .stat-icon { background: var(--red-bg); color: var(--red); }
.stat-card.is-orange .stat-icon { background: var(--orange-bg); color: var(--orange); }
.stat-card.is-amber .stat-icon { background: var(--amber-bg); color: var(--amber); }
.stat-card.is-green .stat-icon { background: var(--green-bg); color: var(--green); }
.stat-card.is-slate .stat-icon { background: var(--slate-bg); color: var(--slate); }
.stat-card::after {
  content: "";
  position: absolute;
  right: -30px;
  top: -40px;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: rgba(37, 99, 235, 0.035);
}

/* ---------- tones ---------- */
.tone-expired { --tone: var(--red); --tone-bg: var(--red-bg); --tone-line: var(--red-line); }
.tone-critical { --tone: var(--orange); --tone-bg: var(--orange-bg); --tone-line: var(--orange-line); }
.tone-warning { --tone: var(--amber); --tone-bg: var(--amber-bg); --tone-line: var(--amber-line); }
.tone-ok { --tone: var(--green); --tone-bg: var(--green-bg); --tone-line: var(--green-line); }
.tone-none { --tone: var(--slate); --tone-bg: var(--slate-bg); --tone-line: var(--slate-line); }
.tone-archived { --tone: #64748b; --tone-bg: #f8fafc; --tone-line: #e2e8f0; }

/* ---------- chips / badges / avatars ---------- */
:where(.chip, .badge, .cal-event, .doc-card) {
  --tone: var(--slate);
  --tone-bg: var(--slate-bg);
  --tone-line: var(--slate-line);
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  border: 1px solid var(--tone-line);
  border-radius: 999px;
  background: var(--tone-bg);
  color: var(--tone);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.25;
  white-space: nowrap;
}
.chip .dot, .badge .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex: none;
}
.chip b { font-weight: 750; }
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 9px;
  border: 1px solid var(--tone-line);
  border-radius: 999px;
  background: var(--tone-bg);
  color: var(--tone);
  font-size: 11.5px;
  font-weight: 650;
  line-height: 1.25;
  white-space: nowrap;
}
.badge-lg { padding: 5px 11px; font-size: 12px; }

.avatar {
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex: none;
  font-weight: 750;
  letter-spacing: 0.2px;
  user-select: none;
}

/* ---------- table ---------- */
.table-wrap { overflow: auto; }
table.data {
  width: 100%;
  min-width: 860px;
  border-collapse: separate;
  border-spacing: 0;
}
table.data th {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 10px 14px;
  background: #f8fafc;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
}
table.data td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--line-2);
  vertical-align: middle;
  font-size: 13px;
}
table.data tbody tr:last-child td { border-bottom: 0; }
table.data tbody tr:hover { background: #fafcff; }
table.data td.actions { white-space: nowrap; }
table.data td.actions .btn { margin-left: 4px; }
.table-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 20px;
  border-top: 1px solid var(--line-2);
  color: var(--muted);
  font-size: 12px;
}

.emp-cell { display: flex; align-items: center; gap: 10px; min-width: 240px; }
.emp-name { display: block; color: var(--ink); font-weight: 650; font-size: 13px; line-height: 1.3; }
.emp-name:hover { color: var(--brand); }
.emp-sub { color: var(--muted); font-size: 11px; margin-top: 2px; line-height: 1.3; }
.emp-position { color: var(--ink-2); max-width: 300px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.deadline-label { display: none; }
.doc-rail { display: flex; flex-wrap: wrap; gap: 4px; max-width: 520px; }
.doc-rail .chip { padding: 3px 6px; font-size: 10.5px; }
.doc-rail .chip .dot { width: 5px; height: 5px; }
.doc-rail .chip b { font-weight: 700; }

table.data tbody tr.row-expired td:first-child { box-shadow: inset 4px 0 0 #e7b5b0; }
table.data tbody tr.row-critical td:first-child { box-shadow: inset 4px 0 0 #ecc5a8; }
table.data tbody tr.row-warning td:first-child { box-shadow: inset 4px 0 0 #ead28a; }
table.data tbody tr.row-ok td:first-child { box-shadow: inset 4px 0 0 #b7dac3; }

/* ---------- dashboard ---------- */
.dash-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(300px, 1fr);
  gap: 14px;
  margin-bottom: 16px;
}
.attention-list { display: flex; flex-direction: column; }
.attention-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 18px;
  border-bottom: 1px solid var(--line-2);
  color: inherit;
}
.attention-item:last-child { border-bottom: 0; }
.attention-item:hover { background: #fafcff; color: inherit; }
.att-main { flex: 1; min-width: 0; }
.att-name {
  font-size: 13px;
  font-weight: 650;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.att-sub {
  color: var(--muted);
  font-size: 11px;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.att-doc { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex: none; }
.att-date { color: var(--muted); font-size: 11px; }
.att-days { color: var(--tone, var(--muted)); font-size: 11.5px; font-weight: 700; }

.upcoming { display: flex; flex-direction: column; gap: 12px; }
.upcoming-item { display: flex; align-items: center; gap: 10px; }
.up-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.up-main { flex: 1; min-width: 0; }
.up-main b {
  display: block;
  font-size: 12.5px;
  font-weight: 650;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.up-main span { display: block; color: var(--muted); font-size: 10.5px; margin-top: 1px; }
.upcoming-item .badge { font-size: 10.5px; padding: 3px 7px; }

.type-list { display: flex; flex-direction: column; gap: 13px; }
.type-row { display: flex; flex-direction: column; gap: 6px; }
.type-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.type-name { display: flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 600; min-width: 0; }
.type-name span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.type-dot { width: 9px; height: 9px; border-radius: 3px; flex: none; }
.stack {
  display: flex;
  gap: 2px;
  height: 7px;
  border-radius: 999px;
  background: var(--line-2);
  overflow: hidden;
}
.stack span { display: block; height: 100%; min-width: 0; }
.stack .s-expired { background: #e0aaa5; }
.stack .s-critical { background: #e8be9f; }
.stack .s-warning { background: #e6cd85; }
.stack .s-ok { background: #a9d0b6; }
.stack .s-none { background: #dde4ec; }
.type-counts { color: var(--muted); font-size: 10.5px; white-space: nowrap; flex: none; }
.type-counts b { color: var(--ink-2); }

.onboarding {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  padding: 24px 26px;
  margin-bottom: 18px;
  border: 1px solid #dbeafe;
  border-radius: var(--radius);
  background: linear-gradient(135deg, #eff6ff, #ffffff 65%);
}
.onboarding h2 { font-size: 18px; letter-spacing: -0.2px; }
.onboarding p { color: var(--muted); font-size: 13px; margin-top: 6px; max-width: 640px; }
.onboarding-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- calendar ---------- */
.cal-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  padding: 13px 18px;
  border-bottom: 1px solid var(--line-2);
}
.cal-title { font-size: 17px; font-weight: 750; letter-spacing: -0.2px; text-transform: capitalize; }
.cal-nav { display: flex; align-items: center; gap: 6px; }
.cal-filters { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding: 12px 20px; border-bottom: 1px solid var(--line-2); }
.cal-filter {
  padding: 4px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
}
.cal-filter:hover { border-color: #cbd5e1; color: var(--ink-2); }
.cal-filter.active { background: var(--ink); border-color: var(--ink); color: #fff; }
.cal-filter .type-dot { display: inline-block; margin-right: 5px; vertical-align: -1px; }

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  border-top: 1px solid var(--line-2);
}
.cal-weekday {
  padding: 8px 8px;
  background: #f8fafc;
  border-right: 1px solid var(--line-2);
  border-bottom: 1px solid var(--line-2);
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-align: center;
  text-transform: uppercase;
}
.cal-weekday:nth-child(7) { border-right: 0; }
.cal-day {
  min-height: 104px;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: #fff;
  border-right: 1px solid var(--line-2);
  border-bottom: 1px solid var(--line-2);
  cursor: pointer;
  transition: background 0.12s;
}
.cal-day:nth-child(7n) { border-right: 0; }
.cal-day:hover { background: #f8fbff; }
.cal-day.muted { background: #fbfcfe; color: var(--muted-2); }
.cal-day.today { background: #eff6ff; }
.cal-day.selected { box-shadow: inset 0 0 0 2px #93c5fd; }
.cal-day-num {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: 11.5px;
  font-weight: 700;
}
.cal-day.today .cal-day-num { background: var(--brand); color: #fff; }
.cal-events { display: flex; flex-direction: column; gap: 3px; overflow: hidden; }
.cal-event {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 3px 5px;
  border: 1px solid var(--tone-line);
  border-left: 3px solid var(--tone);
  border-radius: 5px;
  background: var(--tone-bg);
  color: var(--tone);
  font-size: 10px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cal-event:hover { color: var(--tone); filter: brightness(0.97); }
.cal-event .tdot { width: 5px; height: 5px; border-radius: 50%; background: var(--tone); flex: none; }
.cal-more { color: var(--muted); font-size: 9.5px; padding-left: 3px; }
.cal-legend {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  padding: 11px 20px;
  border-top: 1px solid var(--line-2);
  color: var(--muted);
  font-size: 11px;
}
.cal-legend span { display: inline-flex; align-items: center; gap: 5px; }
.cal-legend i { width: 7px; height: 7px; border-radius: 50%; }

.day-panel { margin-top: 16px; }
.day-list { display: flex; flex-direction: column; }
.day-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line-2);
  color: inherit;
}
.day-item:last-child { border-bottom: 0; }
.day-item:hover { color: inherit; }
.day-main { flex: 1; min-width: 0; }
.day-name { font-size: 12.5px; font-weight: 650; }
.day-sub { color: var(--muted); font-size: 11px; margin-top: 2px; }

/* ---------- employee profile ---------- */
.profile-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 20px 22px;
  margin-bottom: 14px;
}
.profile-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.profile-main { display: flex; align-items: center; gap: 15px; min-width: 280px; }
.profile-name { font-size: 21px; font-weight: 730; letter-spacing: -0.4px; line-height: 1.2; }
.profile-sub { color: var(--muted); font-size: 12.5px; margin-top: 4px; }
.profile-badges { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 9px; }
.profile-info {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 14px 22px;
  padding-top: 16px;
  border-top: 1px solid var(--line-2);
}
.profile-info span { display: block; color: var(--muted); font-size: 10px; font-weight: 650; text-transform: uppercase; letter-spacing: 0.4px; }
.profile-info b { display: block; color: var(--ink-2); font-size: 12.5px; font-weight: 650; margin-top: 3px; }

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin: 20px 0 10px;
}
.section-title { font-size: 15.5px; font-weight: 700; letter-spacing: -0.2px; }
.section-sub { color: var(--muted); font-size: 11.5px; margin-top: 3px; }

.doc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(272px, 1fr)); gap: 12px; }
.doc-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 15px;
  border: 1px solid var(--line);
  border-top: 3px solid var(--tone);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
}
.doc-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.doc-card-title { font-size: 13px; font-weight: 700; line-height: 1.3; }
.doc-card-sub { color: var(--muted); font-size: 10.5px; margin-top: 3px; }
.doc-card .badge { font-size: 10.5px; padding: 3px 7px; }
.doc-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 12px;
  padding: 10px 11px;
  border-radius: 9px;
  background: var(--surface-2);
}
.doc-meta span { display: block; color: var(--muted); font-size: 10px; }
.doc-meta b { display: block; color: var(--ink-2); font-size: 11.5px; font-weight: 650; margin-top: 2px; word-break: break-word; }
.doc-days {
  display: flex;
  align-items: baseline;
  gap: 6px;
  color: var(--tone);
  font-size: 22px;
  font-weight: 780;
  letter-spacing: -0.7px;
  line-height: 1;
}
.doc-days small { color: var(--muted); font-size: 10.5px; font-weight: 600; letter-spacing: 0; }
.doc-actions { display: flex; gap: 5px; flex-wrap: wrap; margin-top: auto; }
.doc-actions .btn { padding: 5px 8px; font-size: 11.5px; border-radius: 7px; }
.doc-history { border-top: 1px dashed var(--line); padding-top: 8px; }
.doc-history summary { color: var(--muted); font-size: 10.5px; cursor: pointer; outline: none; }
.doc-history summary:hover { color: var(--ink-2); }
.history-row { display: flex; justify-content: space-between; gap: 10px; padding: 5px 0 0; color: var(--muted); font-size: 10.5px; }
.history-row b { color: var(--ink-2); font-weight: 600; }

.audit-list { display: flex; flex-direction: column; }
.audit-item { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line-2); }
.audit-item:last-child { border-bottom: 0; }
.audit-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--brand);
  margin-top: 5px;
  flex: none;
  box-shadow: 0 0 0 4px var(--brand-soft);
}
.audit-main { flex: 1; min-width: 0; }
.audit-action { font-size: 12.5px; font-weight: 600; }
.audit-details { color: var(--muted); font-size: 11px; margin-top: 2px; }
.audit-date { color: var(--muted-2); font-size: 10.5px; white-space: nowrap; }

/* ---------- modal ---------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 5vh 16px;
  overflow: auto;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(3px);
}
.modal {
  width: 100%;
  max-width: 580px;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 30px 80px -20px rgba(15, 23, 42, 0.55);
  animation: modal-in 0.16s ease-out;
}
.modal-lg { max-width: 860px; }
@keyframes modal-in {
  from { opacity: 0; transform: translateY(8px) scale(0.99); }
  to { opacity: 1; transform: none; }
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line-2);
}
.modal-head h2 { font-size: 16px; font-weight: 720; letter-spacing: -0.2px; }
.modal-body { padding: 18px 20px; max-height: 72vh; overflow: auto; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }
.modal-text { color: var(--muted); font-size: 13px; line-height: 1.55; }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
.form-grid .full { grid-column: 1 / -1; }
.form-row.three { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; }
.form-section { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line-2); }
.form-section h3 { font-size: 13px; font-weight: 750; margin-bottom: 4px; }
.form-section .hint { color: var(--muted); font-size: 11px; margin-bottom: 10px; }

.doc-input {
  padding: 11px 12px;
  margin-bottom: 9px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fff;
}
.doc-input:last-child { margin-bottom: 0; }
.doc-input-head { display: flex; align-items: center; gap: 7px; margin-bottom: 9px; font-size: 12px; }
.doc-input-head b { font-weight: 650; }
.doc-input-head .hint { margin-left: auto; color: var(--muted-2); font-size: 10px; }

/* ---------- import ---------- */
.dropzone {
  border: 2px dashed #cbd5e1;
  border-radius: var(--radius);
  background: #fbfdff;
  padding: 38px 22px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.dropzone:hover, .dropzone.drag { border-color: #93c5fd; background: #eff6ff; }
.dropzone-icon {
  width: 54px;
  height: 54px;
  margin: 0 auto 12px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: var(--brand-soft);
  color: var(--brand);
}
.dropzone-title { font-size: 15px; font-weight: 700; }
.dropzone-sub { color: var(--muted); font-size: 12px; margin-top: 5px; }
.dropzone-note { color: var(--muted-2); font-size: 10.5px; margin-top: 12px; }

.import-file {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-2);
}
.file-icon {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: #fff;
  border: 1px solid var(--line);
  color: var(--brand);
  flex: none;
}
.file-main { flex: 1; min-width: 0; }
.file-name { font-size: 12.5px; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-sub { color: var(--muted); font-size: 10.5px; margin-top: 2px; }

.notice {
  display: flex;
  gap: 10px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--ink-2);
  font-size: 12px;
  line-height: 1.45;
}
.notice .ico { color: var(--brand); margin-top: 1px; }
.notice.is-warn { border-color: var(--amber-line); background: var(--amber-bg); color: #78350f; }
.notice.is-warn .ico { color: var(--amber); }
.notice.is-danger { border-color: var(--red-line); background: var(--red-bg); color: #7f1d1d; }
.notice.is-danger .ico { color: var(--red); }
.notice ul { margin: 4px 0 0; padding-left: 16px; }

.mapping { display: flex; flex-wrap: wrap; gap: 6px; }
.mapping-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  font-size: 10.5px;
  color: var(--muted);
}
.mapping-item b { color: var(--ink-2); font-weight: 650; }
.mapping-item code {
  padding: 1px 4px;
  border-radius: 4px;
  background: var(--surface-2);
  color: var(--brand);
  font-family: ui-monospace, Consolas, monospace;
  font-size: 10px;
}

.option-row { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--ink-2); cursor: pointer; }
.option-row input { accent-color: var(--brand); }
.option-group { display: flex; flex-wrap: wrap; gap: 14px; }

.import-result { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.result-cell {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface-2);
  text-align: center;
}
.result-cell b { display: block; font-size: 22px; font-weight: 780; letter-spacing: -0.5px; }
.result-cell span { display: block; color: var(--muted); font-size: 10.5px; margin-top: 3px; }

.history-table { width: 100%; border-collapse: collapse; }
.history-table th { text-align: left; color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: 0.4px; padding: 8px 12px; border-bottom: 1px solid var(--line); }
.history-table td { padding: 10px 12px; border-bottom: 1px solid var(--line-2); font-size: 12px; }
.history-table tr:last-child td { border-bottom: 0; }

/* ---------- settings ---------- */
.settings-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.settings-grid .span-2 { grid-column: 1 / -1; }
.stacked { display: flex; flex-direction: column; gap: 13px; }
.threshold-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.legend-list { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.legend-item { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; }
.legend-item .badge { min-width: 92px; justify-content: center; }

.type-settings { display: flex; flex-direction: column; }
.type-settings-row {
  display: grid;
  grid-template-columns: 26px minmax(180px, 1.4fr) 110px 110px 70px;
  gap: 10px;
  align-items: end;
  padding: 12px 0;
  border-bottom: 1px solid var(--line-2);
}
.type-settings-row:last-child { border-bottom: 0; }
.type-settings-row .field > label { font-size: 10px; }
.type-settings-row input[type="color"] {
  width: 100%;
  height: 39px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  cursor: pointer;
}
.check-field { display: flex; align-items: center; gap: 6px; height: 39px; color: var(--ink-2); font-size: 12px; }
.check-field input { accent-color: var(--brand); }
.req-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.req-bulk { display: flex; gap: 6px; flex-wrap: wrap; }
.req-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px 14px; margin-top: 10px; }
.req-grid .check-field { height: auto; }
.settings-note { color: var(--muted); font-size: 11px; line-height: 1.5; margin-top: 10px; }
.settings-note b { color: var(--ink-2); }

/* ---------- empty / loading / toast ---------- */
.empty { padding: 48px 20px; text-align: center; }
.empty-icon {
  width: 54px;
  height: 54px;
  margin: 0 auto 12px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--muted-2);
}
.empty h3 { font-size: 14.5px; font-weight: 700; }
.empty p { color: var(--muted); font-size: 12.5px; margin-top: 5px; max-width: 420px; margin-left: auto; margin-right: auto; }
.empty-actions { display: flex; justify-content: center; gap: 8px; margin-top: 14px; flex-wrap: wrap; }

/* ---------- misc states ---------- */
table.data tr.is-fired { opacity: 0.55; }
table.data tr.is-fired:hover { opacity: 0.8; }
button.doc-card { font: inherit; color: inherit; }
button.doc-card:hover { border-color: #c7d7ef; box-shadow: 0 10px 26px -20px rgba(15, 23, 42, 0.6); }

.skeleton-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.skeleton { border-radius: 12px; background: linear-gradient(90deg, #eef2f7, #f8fafc, #eef2f7); background-size: 200% 100%; animation: shimmer 1.2s infinite; }
.skeleton-card { height: 92px; }
.skeleton-block { height: 330px; margin-top: 16px; border-radius: var(--radius); }
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  flex: none;
}
.spinner.dark { border-color: rgba(15, 23, 42, 0.15); border-top-color: var(--brand); }
@keyframes spin { to { transform: rotate(360deg); } }

.toast-root {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: min(360px, calc(100vw - 40px));
}
.toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 12px;
  background: #0f172a;
  color: #fff;
  font-size: 12.5px;
  line-height: 1.4;
  box-shadow: 0 18px 40px -18px rgba(15, 23, 42, 0.7);
  animation: toast-in 0.18s ease-out;
}
.toast.success { border-left: 3px solid #22c55e; }
.toast.error { border-left: 3px solid #ef4444; }
.toast .ico { margin-top: 1px; }
@keyframes toast-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

.error-screen { max-width: 520px; margin: 12vh auto; padding: 28px; text-align: center; }
.error-screen h2 { font-size: 18px; margin-bottom: 8px; }
.error-screen p { color: var(--muted); font-size: 13px; margin-bottom: 16px; }

/* ---------- login / company / viewer / admin ---------- */
.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(120% 90% at 0% 0%, rgba(37, 99, 235, 0.26), transparent 55%),
    linear-gradient(160deg, #0b1526, #0e1a2f 55%, #0a1322);
}
.login-card {
  width: 100%;
  max-width: 390px;
  padding: 32px 30px 26px;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 40px 90px -30px rgba(2, 6, 23, 0.75);
}
.login-brand { font-size: 26px; font-weight: 700; letter-spacing: -0.6px; }
.login-sub { color: var(--muted); font-size: 12.5px; margin-top: 6px; line-height: 1.45; }
.login-form { display: flex; flex-direction: column; gap: 14px; margin-top: 24px; }
.login-submit { width: 100%; padding: 10px; margin-top: 2px; }
.login-error { padding: 9px 11px; border: 1px solid var(--red-line); border-radius: 9px; background: var(--red-bg); color: var(--red); font-size: 12px; line-height: 1.4; }
.login-note { margin-top: 18px; text-align: center; color: var(--muted-2); font-size: 11px; }

.company-switch {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  max-width: 230px;
}
.company-switch .ico { color: var(--muted-2); flex: none; }
.company-switch select {
  min-width: 0;
  max-width: 190px;
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 12.5px;
  font-weight: 650;
  color: var(--ink-2);
  outline: none;
  cursor: pointer;
}
.company-static {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 240px;
  color: var(--ink-2);
  font-size: 12.5px;
  font-weight: 650;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.company-static .ico { color: var(--muted-2); }

.doc-card-badges { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.doc-file-chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 7px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 10.5px;
}
.doc-title-btn { padding: 0; border: 0; background: none; font: inherit; color: var(--ink); text-align: left; cursor: pointer; }
.doc-title-btn:hover { color: var(--brand); }

.viewer-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.viewer-title { font-size: 15px; font-weight: 700; }
.viewer-sub { color: var(--muted); font-size: 12px; margin-top: 3px; }
.viewer-place { display: inline-flex; align-items: center; gap: 5px; margin-top: 6px; color: var(--muted); font-size: 11.5px; }
.viewer-place .ico { color: var(--muted-2); }
.viewer-files { display: flex; flex-direction: column; gap: 14px; }
.viewer-file { overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.viewer-image { display: block; width: 100%; max-height: 440px; object-fit: contain; background: #f8fafc; }
.viewer-frame { display: block; width: 100%; height: 440px; border: 0; background: #fff; }
.viewer-file-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px 12px; border-top: 1px solid var(--line-2); background: #fff; }
.viewer-file-main { flex: 1; min-width: 150px; }
.viewer-file-name { font-size: 12.5px; font-weight: 650; word-break: break-word; }
.viewer-file-sub { color: var(--muted); font-size: 10.5px; margin-top: 2px; }
.viewer-upload { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line-2); }
.viewer-upload .hint { color: var(--muted); font-size: 11px; }
.viewer-empty { padding: 26px 12px; text-align: center; }
.viewer-empty h3 { font-size: 15px; margin-top: 10px; }
.viewer-empty p { max-width: 420px; margin: 6px auto 14px; color: var(--muted); font-size: 12.5px; line-height: 1.5; }
.viewer-loading { padding: 30px; text-align: center; color: var(--muted); font-size: 12.5px; }

.matrix-wrap { overflow-x: auto; }
.access-matrix { width: 100%; min-width: 520px; border-collapse: collapse; }
.access-matrix th,
.access-matrix td { padding: 9px 10px; border-bottom: 1px solid var(--line-2); text-align: center; font-size: 12px; }
.access-matrix th { background: #f8fafc; color: var(--muted); font-size: 10.5px; font-weight: 700; letter-spacing: 0.3px; text-transform: uppercase; }
.access-matrix th:first-child,
.access-matrix td:first-child { text-align: left; }
.matrix-viewer { font-weight: 600; white-space: nowrap; }
.matrix-self { color: var(--muted-2); }
.matrix-check { width: 16px; height: 16px; accent-color: var(--brand); cursor: pointer; }
.admin-table { min-width: 640px; }

/* ---------- крупнее типографика ---------- */
body { font-size: 14.5px; }
.brand-word { font-size: 19px; }
.brand-company { font-size: 11.5px; }
.nav-item { font-size: 14px; }
.page-title { font-size: 26px; }
.page-sub { font-size: 13.5px; }
.btn { font-size: 13.5px; }
.btn-sm { font-size: 13px; }
.input, .select, textarea.input { font-size: 14px; }
.field > label { font-size: 12px; }
.card-title { font-size: 15px; }
.card-sub { font-size: 11.5px; }
.stat-value { font-size: 26px; }
.stat-label { font-size: 12px; }
.stat-note { font-size: 10.5px; }
table.data { min-width: 900px; }
table.data th { font-size: 10.5px; }
table.data td { font-size: 13.5px; }
.emp-name { font-size: 13.5px; }
.emp-sub { font-size: 11.5px; }
.chip { font-size: 11.5px; }
.badge { font-size: 12px; }
.doc-rail .chip { font-size: 11px; }
.doc-card-title { font-size: 14px; }
.doc-card-sub { font-size: 11px; }
.doc-meta span { font-size: 10.5px; }
.doc-meta b { font-size: 12px; }
.doc-days { font-size: 24px; }
.audit-action { font-size: 13px; }
.audit-details { font-size: 11.5px; }
.modal-head h2 { font-size: 17px; }
.modal-text { font-size: 13.5px; }
.history-table th { font-size: 10.5px; }
.history-table td { font-size: 12.5px; }
.settings-note { font-size: 11.5px; }
.dropzone-title { font-size: 15.5px; }
.dropzone-sub { font-size: 12.5px; }
.cal-title { font-size: 18px; }
.cal-day-num { font-size: 12px; }
.login-brand { font-size: 28px; }
.login-sub { font-size: 13px; }
.login-note { font-size: 11.5px; }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dash-grid { grid-template-columns: 1fr; }
  .settings-grid { grid-template-columns: 1fr; }
  .profile-info { grid-template-columns: repeat(3, minmax(120px, 1fr)); }
}

@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); box-shadow: 0 24px 60px -20px rgba(2, 6, 23, 0.6); }
  .layout.nav-open .sidebar { transform: none; }
  .layout.nav-open .nav-scrim { display: block; }
  .content { margin-left: 0; }
  .topbar { padding: 0 16px; height: 58px; }
  .view { padding: 18px 16px 48px; }
  .btn.mobile-menu { display: inline-flex; }
  .import-result { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .table-foot { flex-wrap: wrap; gap: 6px; }
}

@media (max-width: 760px) {
  table.data { min-width: 0; width: 100%; }
  .table-wrap { overflow: visible; }
  table.data thead { display: none; }
  table.data tbody tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px 12px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--line-2);
  }
  table.data tbody tr:last-child { border-bottom: 0; }
  table.data td { padding: 0; border: 0; }
  table.data td:nth-child(1),
  table.data td:nth-child(2) { grid-column: 1 / -1; }
  table.data td:nth-child(3) { grid-column: 1; align-self: center; }
  table.data td.deadline.is-empty { display: none; }
  table.data td:nth-child(4) { grid-column: 2; justify-self: end; align-self: center; }
  .deadline-label { display: inline; color: var(--muted); font-size: 11px; font-weight: 400; }
  table.data td.actions { grid-column: 1 / -1; }
  table.data td.actions .btn { width: 100%; }
  .emp-cell { min-width: 0; }
  .doc-rail { max-width: none; }
}

@media (max-width: 720px) {
  .stats-grid { gap: 10px; }
  .stat-card { padding: 13px; gap: 10px; }
  .stat-icon { width: 34px; height: 34px; border-radius: 10px; }
  .stat-value { font-size: 23px; }
  .stat-label { font-size: 11px; }
  .stat-note { display: none; }
  .page-title { font-size: 23px; }
  .page-head { gap: 12px; margin-bottom: 14px; }
  .form-grid, .form-row.three, .threshold-row { grid-template-columns: 1fr; }
  .filter-bar .field, .filter-bar .search-box { flex: 1 1 100%; min-width: 0; }
  .filter-bar .filter-reset { padding-bottom: 0; }
  .profile-info { grid-template-columns: 1fr 1fr; min-width: 0; gap: 12px 18px; }
  .profile-card { padding: 16px; gap: 16px; }
  .profile-name { font-size: 19px; }
  .doc-grid { grid-template-columns: 1fr; }
  .cal-day { min-height: 62px; padding: 4px; gap: 3px; }
  .cal-day-num { width: 20px; height: 20px; font-size: 10.5px; }
  .cal-weekday { padding: 6px 2px; font-size: 9px; }
  .cal-events { flex-direction: row; flex-wrap: wrap; gap: 3px; margin-top: auto; }
  .cal-event {
    width: 7px;
    height: 7px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: var(--tone);
    font-size: 0;
    overflow: hidden;
  }
  .cal-event .tdot, .cal-more { display: none; }
  .cal-toolbar { padding: 12px 14px; }
  .cal-title { font-size: 15px; }
  .type-settings-row { grid-template-columns: 24px 1fr 1fr; }
  .type-settings-row .field:nth-child(4) { grid-column: 2; }
  .type-settings-row .check-field { height: auto; }
  .onboarding { padding: 18px; }
  .onboarding-actions { width: 100%; }
  .onboarding-actions .btn { flex: 1 1 auto; }
  .modal-backdrop { padding: 12px 10px 24px; }
  .modal { border-radius: 14px; }
  .modal-body { padding: 16px; max-height: 78vh; }
  .modal-head { padding: 14px 16px; }
  .topbar-actions .btn span { display: none; }
  .topbar-actions .btn { padding: 8px 10px; }
  .toast-root { right: 12px; bottom: 12px; width: calc(100vw - 24px); }
  .day-item { flex-wrap: wrap; }
  .day-item .badge { order: 3; }
}

@media (max-width: 600px) {
  .card-head { flex-direction: column; align-items: stretch; gap: 8px; }
  .card-head .btn { align-self: flex-start; }
  .page-head { margin-bottom: 12px; }
  .back-link { margin-bottom: 8px; }
  .company-switch { max-width: 158px; height: 30px; padding: 0 6px; }
  .company-switch select { max-width: 118px; font-size: 12px; }
  .company-static { max-width: 150px; }
  .topbar-left { gap: 8px; }
  .viewer-frame { height: 320px; }
  .login-card { padding: 26px 20px 22px; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat-card { flex-direction: column; gap: 8px; }
  .page-actions { width: 100%; }
  .page-actions .btn { flex: 1 1 auto; }
  .profile-info { grid-template-columns: 1fr 1fr; }
  .doc-card-head { gap: 8px; }
  .doc-days { font-size: 20px; }
  .modal-actions .btn { flex: 1 1 auto; }
}

