/* ДБР Офіс — тема «службовий планшет» з NGlaw (ui/styles.css) */
:root {
  color-scheme: dark;
  --bezel: #050506; --screen: #0b0c0f; --rim: rgba(196, 189, 227, 0.3);
  --card: #111216; --card-line: #1a1b20; --row: #16171b; --row-hover: #1c1d22; --field: #15161a;
  --line: #1f2126; --line-strong: #2a2c33;
  --text: #eef0f4; --text-2: #b4b8c1; --muted: #858a94;
  --blue: #8db8ff; --blue-ink: #0b1830; --blue-text: #9cc2ff; --navy: #1b2a44; --navy-line: #2b4470; --link: #5b9cff;
  --green: #4ade80; --green-bg: #12241a; --red: #ffa3a3; --red-bg: #361619; --amber: #f6cf74; --amber-bg: #30260f;
  --violet: #c9b8ff; --violet-bg: #251f42; --teal: #5eead4; --teal-bg: #0f2c2a;
  --font: 'Gilroy', 'Manrope', 'Segoe UI', system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bezel); color: var(--text); font: 500 13px/1.45 var(--font); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.hidden { display: none !important; }
.muted { color: var(--muted); }

/* ---- корпус планшета */
.bezel { max-width: 1440px; margin: 18px auto; padding: 10px; border-radius: 30px; background: linear-gradient(160deg, #16171c, #07080a);
  border: 1px solid var(--rim); box-shadow: 0 30px 80px rgba(0, 0, 0, .7), inset 0 1px 0 rgba(255, 255, 255, .08); }
.screen { position: relative; min-height: calc(100vh - 58px); border-radius: 22px; overflow: hidden; background: var(--screen); display: flex; flex-direction: column; isolation: isolate; }
.blob { position: absolute; z-index: -1; border-radius: 50%; pointer-events: none; }
.blob.b1 { width: 560px; height: 560px; left: -140px; top: -180px; background: radial-gradient(circle, rgba(91, 156, 255, .2), transparent 65%); animation: drift 16s ease-in-out infinite; }
.blob.b2 { width: 600px; height: 600px; right: -180px; top: 260px; background: radial-gradient(circle, rgba(201, 184, 255, .13), transparent 65%); animation: drift 20s ease-in-out infinite reverse; }
@keyframes drift { 0%, 100% { transform: translate(0, 0); } 50% { transform: translate(34px, -24px); } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(141, 184, 255, .55); } 60% { box-shadow: 0 0 0 7px rgba(141, 184, 255, 0); } }
@media (prefers-reduced-motion: reduce) { .blob, .doc-row, .dot { animation: none !important; } }
@media (max-width: 700px) { .bezel { margin: 0; padding: 0; border-radius: 0; border: 0; } .screen { border-radius: 0; min-height: 100vh; } }

/* ---- статус-рядок */
.status { display: flex; align-items: center; gap: 16px; height: 46px; padding: 0 18px; background: rgba(5, 5, 6, .55); border-bottom: 1px solid rgba(255, 255, 255, .06); backdrop-filter: blur(12px); font-size: 12.5px; }
.status-org { display: flex; align-items: center; gap: 8px; font-weight: 800; letter-spacing: .14em; font-size: 11.5px; color: var(--text-2); }
.status-org img { height: 22px; }
.status-clock { margin: 0 auto; font: 700 12.5px 'JetBrains Mono', monospace; color: var(--text-2); }
.status-bot { display: flex; align-items: center; gap: 7px; color: var(--green); font-weight: 700; }
.status-bot.off { color: var(--muted); }
.status-bot .led { width: 6px; height: 6px; border-radius: 50%; background: var(--green); box-shadow: 0 0 8px var(--green); }
.status-bell { position: relative; width: 34px; height: 34px; border-radius: 10px; border: 1px solid rgba(255, 255, 255, .08); background: rgba(255, 255, 255, .04); color: var(--text-2); display: flex; align-items: center; justify-content: center; }
.bell-dot { position: absolute; top: 6px; right: 7px; width: 7px; height: 7px; border-radius: 50%; background: var(--red); box-shadow: 0 0 6px var(--red); }
@media (max-width: 800px) { .status-org { font-size: 0; } .status-org img { height: 24px; } }

/* ---- бокове меню */
.shell { flex: 1; display: flex; flex-wrap: wrap; min-height: 0; }
.side { flex: 1 1 250px; max-width: 272px; box-sizing: border-box; padding: 18px 14px; display: flex; flex-direction: column; gap: 18px; background: rgba(17, 18, 22, .55); border-right: 1px solid rgba(255, 255, 255, .05); backdrop-filter: blur(16px); }
.brand { display: flex; align-items: center; gap: 10px; padding: 0 6px; }
.brand img { height: 40px; filter: drop-shadow(0 0 12px rgba(141, 184, 255, .35)); }
.brand span { display: flex; flex-direction: column; }
.brand b { font-size: 17px; font-weight: 800; }
.brand small { font-size: 11.5px; color: var(--muted); }
.btn.create { height: 44px; border: 0; border-radius: 12px; background: linear-gradient(135deg, #9cc2ff, #7aa6f5); color: var(--blue-ink); font-weight: 800; box-shadow: 0 8px 24px rgba(141, 184, 255, .3), inset 0 1px 0 rgba(255, 255, 255, .5); }
.create-row { display: flex; flex-direction: column; gap: 6px; margin-top: -4px; }
.btn.create2 { flex: none; min-height: 38px; white-space: nowrap; justify-content: flex-start; height: 38px; padding: 0 10px; border-radius: 11px; font-size: 13px; font-weight: 700; background: rgba(141, 184, 255, .1); border: 1px solid rgba(141, 184, 255, .28); color: var(--blue-text); gap: 7px; }
.btn.create2:hover { background: rgba(141, 184, 255, .18); }
.btn.create:hover { filter: brightness(1.06); color: var(--blue-ink); }
.side-group { display: flex; flex-direction: column; gap: 3px; }
.side-label { padding: 0 12px 6px; font-size: 11px; font-weight: 800; letter-spacing: .12em; color: var(--dim); }
.navi { display: flex; align-items: center; gap: 12px; min-height: 42px; padding: 0 12px; border-radius: 12px; font-weight: 700; color: var(--text-2); border: 1px solid transparent; transition: background .15s, color .15s; }
.navi:hover { background: rgba(255, 255, 255, .04); color: var(--text); }
.navi-ic { display: flex; color: var(--muted); }
.navi-t { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.navi.active { background: linear-gradient(135deg, rgba(141, 184, 255, .22), rgba(141, 184, 255, .06)); border-color: rgba(141, 184, 255, .35); color: #dce9ff; box-shadow: 0 0 22px rgba(141, 184, 255, .15); }
.navi.active .navi-ic { color: var(--blue); }
.navi .count { min-width: 22px; height: 20px; padding: 0 7px; border-radius: 7px; font-size: 11.5px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; background: var(--blue); color: var(--blue-ink); }
.navi .count.muted-count { background: var(--line); color: var(--text-2); }
.navi .count.red-count { background: var(--red-bg); color: var(--red); }
.me-card { margin-top: auto; padding: 14px; border-radius: 16px; background: linear-gradient(135deg, rgba(27, 42, 68, .8), rgba(17, 18, 22, .8)); border: 1px solid rgba(43, 68, 112, .8); display: flex; flex-direction: column; gap: 10px; }
.me-card:hover, .me-card.active { border-color: var(--blue); box-shadow: 0 0 22px rgba(141, 184, 255, .15); color: var(--text); }
.me-row { display: flex; align-items: center; gap: 10px; }
.me-row .avatar { width: 40px; height: 40px; border-radius: 12px; }
.me-name { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.me-name small { font-size: 11.5px; color: var(--blue-text); }
.me-gear { color: var(--muted); display: flex; }
.rank-bar { display: flex; gap: 4px; }
.rank-bar span { flex: 1; height: 4px; border-radius: 2px; background: var(--line-strong); }
.rank-bar span.on { background: var(--blue); box-shadow: 0 0 6px rgba(141, 184, 255, .5); }
@media (max-width: 900px) {
  .side { max-width: none; flex-basis: 100%; padding: 12px; gap: 10px; border-right: 0; border-bottom: 1px solid rgba(255, 255, 255, .05); }
  .side-group { flex-direction: row; flex-wrap: wrap; gap: 6px; }
  .side-label, .case-link, .me-card .rank-bar, .brand small { display: none; }
  .create-row { margin-top: 0; width: 100%; flex-direction: row; }
  .create-row .btn.create2 { flex: 1; justify-content: center; }
  .navi { min-height: 38px; background: var(--field); border-color: var(--line); }
  .me-card { margin-top: 0; padding: 8px 10px; }
}

/* ---- головна: привітання й плитки */
.hero { position: relative; overflow: hidden; padding: 22px 24px; border-radius: 20px; background: linear-gradient(120deg, rgba(27, 42, 68, .95), rgba(37, 31, 66, .85));
  border: 1px solid rgba(141, 184, 255, .25); box-shadow: 0 20px 50px rgba(0, 0, 0, .35), inset 0 1px 0 rgba(255, 255, 255, .08); }
.hero-crest { position: absolute; right: 24px; top: -30px; height: 210px; opacity: .08; }
.hero-date { font-size: 12.5px; color: var(--blue-text); font-weight: 700; }
.hero h1 { margin: 4px 0 14px; font-size: 26px; }
.tiles-row { display: flex; flex-wrap: wrap; gap: 12px; }
.tile { flex: 1 1 180px; padding: 16px 18px; border-radius: 16px; background: rgba(11, 12, 15, .55); border: 1px solid rgba(255, 255, 255, .07); backdrop-filter: blur(10px); display: flex; flex-direction: column; gap: 8px; transition: transform .15s, border-color .15s; }
.tile:hover { transform: translateY(-2px); border-color: rgba(141, 184, 255, .35); color: var(--text); }
.tile-l { display: flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 700; }
.tile-v { font-size: 30px; font-weight: 800; letter-spacing: -.5px; }
.tile-s { font-size: 12px; color: var(--muted); }

/* ---- рядки документів з іконкою типу */
.doc-row { flex-direction: row !important; align-items: center; gap: 14px !important; padding: 14px 16px !important; border-radius: 14px !important; background: rgba(22, 23, 27, .72) !important;
  border: 1px solid rgba(255, 255, 255, .04) !important; transition: transform .15s, border-color .15s; }
.doc-row:hover { transform: translateX(2px); border-color: rgba(141, 184, 255, .25) !important; }
.doc-row.hot { background: linear-gradient(90deg, rgba(27, 42, 68, .9), rgba(22, 23, 27, .75)) !important; border-color: rgba(43, 68, 112, .9) !important; }
.type-ic { width: 42px; height: 42px; flex: none; border-radius: 12px; display: flex; align-items: center; justify-content: center; background: rgba(255, 255, 255, .04); border: 1px solid rgba(255, 255, 255, .06); }
.doc-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.doc-main .title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.type-t { font-size: 11.5px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.mono { font: 600 11.5px 'JetBrains Mono', monospace; color: var(--muted); }
.dot { animation: pulse 2s infinite; }
.search { display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 12px; border-radius: 11px; background: rgba(5, 5, 6, .5); border: 1px solid rgba(255, 255, 255, .07); color: var(--muted); flex: 0 1 300px; }
.search input { border: 0; background: transparent; min-height: 0; padding: 0; outline: none; }
@media (max-width: 700px) {
  .doc-row .type-ic { display: none; } .doc-row { flex-wrap: wrap; }
  .hero { padding: 16px; } .hero h1 { font-size: 21px; } .hero-crest { height: 140px; }
  .tiles-row { gap: 8px; } .tile { flex: 1 1 80px; padding: 10px 12px; gap: 4px; } .tile-v { font-size: 22px; } .tile-s { display: none; } .tile-l { font-size: 11.5px; }
  .status { gap: 10px; padding: 0 12px; } .status-clock { font-size: 11.5px; } .status-bot { font-size: 0; gap: 4px; }
  .main { padding: 16px 12px 20px; }
}

.main { flex: 999 1 600px; min-width: 0; display: flex; flex-direction: column; gap: 18px; padding: 22px 26px 26px; }
h1 { margin: 0; font-size: 22px; font-weight: 800; letter-spacing: -0.3px; }
h2 { margin: 0; font-size: 15px; font-weight: 800; }
.sub { margin: 2px 0 0; color: var(--muted); font-size: 12.5px; }
.back { align-self: flex-start; font-size: 12.5px; font-weight: 700; color: var(--link); }

.cols { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-start; }
.col-main { flex: 999 1 560px; min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.col-side { flex: 1 1 340px; min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.card { background: rgba(17, 18, 22, .72); backdrop-filter: blur(14px); box-shadow: 0 20px 50px rgba(0, 0, 0, .28); border: 1px solid rgba(255, 255, 255, .06); border-radius: 20px; padding: 18px; display: flex; flex-direction: column; gap: 10px; }
.card.accent { border-color: var(--navy-line); box-shadow: 0 0 22px rgba(141, 184, 255, 0.1); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }

.list { display: flex; flex-direction: column; gap: 6px; }
.row { display: flex; flex-direction: column; gap: 6px; padding: 12px 14px; border-radius: 12px; background: var(--row); border: 1px solid transparent; }
.row:hover { background: var(--row-hover); }
.row.hot { background: var(--navy); border-color: var(--navy-line); }
.row .title { font-size: 13.5px; font-weight: 700; }
.row .meta { color: var(--muted); font-size: 12px; }
.pills { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.pill { font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 6px; color: var(--muted); background: var(--line); }
.pill.right { margin-left: auto; }
.pill.blue { color: var(--blue-text); background: #22385c; }
.pill.amber { color: var(--amber); background: var(--amber-bg); }
.pill.red { color: var(--red); background: var(--red-bg); }
.pill.green { color: var(--green); background: var(--green-bg); }
.pill.violet { color: var(--violet); background: var(--violet-bg); }
.pill.teal { color: var(--teal); background: var(--teal-bg); }
.empty { padding: 28px; text-align: center; color: var(--muted); border-radius: 12px; background: var(--row); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 14px; border-radius: 11px; border: 1px solid var(--line); background: var(--field); color: var(--text-2); font-weight: 700; }
.btn:hover { background: var(--row-hover); color: var(--text); }
.btn.primary { background: linear-gradient(135deg, #9cc2ff, #7aa6f5); border-color: transparent; color: var(--blue-ink); font-weight: 800; box-shadow: 0 8px 22px rgba(141, 184, 255, .28), inset 0 1px 0 rgba(255, 255, 255, .45); }
.btn.primary:hover { color: var(--blue-ink); filter: brightness(1.06); }
.btn.navy { background: var(--navy); border-color: var(--navy-line); color: var(--blue-text); font-weight: 800; }
.btn.danger { background: var(--red-bg); border-color: #4a2226; color: var(--red); font-weight: 800; }
.btn.dashed { background: transparent; border-style: dashed; border-color: var(--line-strong); }
.btn:disabled { opacity: 0.5; cursor: default; }
.btns { display: flex; flex-wrap: wrap; gap: 8px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field > span, .label { font-size: 12px; font-weight: 700; color: var(--muted); }
input, textarea, select { width: 100%; min-height: 40px; padding: 9px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--field); color: var(--text); }
textarea { resize: vertical; line-height: 1.55; }
.choice { display: flex; flex-wrap: wrap; gap: 6px; }
.choice button { height: 40px; padding: 0 14px; border-radius: 11px; border: 1px solid var(--line); background: var(--field); color: var(--text-2); font-weight: 700; }
.choice button[aria-pressed='true'] { background: var(--blue); border-color: var(--blue); color: var(--blue-ink); font-weight: 800; box-shadow: 0 0 18px rgba(141, 184, 255, 0.3); }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.tiles button { min-height: 64px; padding: 12px 14px; text-align: left; border-radius: 12px; border: 1px solid transparent; background: var(--row); font-weight: 800; }
.tiles button[aria-pressed='true'] { background: var(--navy); border-color: var(--navy-line); color: #dce9ff; }
.links { display: flex; flex-wrap: wrap; gap: 6px; }
.link { display: inline-flex; align-items: center; height: 28px; padding: 0 10px; border-radius: 8px; background: var(--line); color: var(--blue-text); font-size: 12px; font-weight: 700; }
.err { padding: 10px 12px; border-radius: 12px; background: var(--red-bg); color: var(--red); font-weight: 700; }
.note { font-size: 12px; color: var(--muted); }
.ev { display: flex; flex-direction: column; gap: 3px; padding: 10px 12px; border-radius: 12px; background: var(--row); }
.ev .line { display: flex; justify-content: space-between; gap: 12px; }
.ev .when { font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.ev .text { color: var(--text-2); white-space: pre-wrap; }

/* лічильники, «нове», сповіщення */
.nav .count.muted-count { background: var(--line-strong); color: var(--text-2); }
.nav.active .count.muted-count { background: var(--blue-ink); color: var(--blue-text); }
.nav .count.red-count { background: var(--red-bg); color: var(--red); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--blue); box-shadow: 0 0 8px var(--blue); }
.toast { position: fixed; right: 20px; bottom: 20px; z-index: 50; padding: 12px 16px; border-radius: 12px; background: var(--navy); border: 1px solid var(--navy-line);
  color: #dce9ff; font-weight: 700; box-shadow: 0 10px 30px rgba(0,0,0,.5); transform: translateY(20px); opacity: 0; transition: .3s; }
.toast.show { transform: none; opacity: 1; }

/* журнал заслуг: прогрес */
.prog { display: flex; flex-direction: column; gap: 6px; }
.prog-l { display: flex; justify-content: space-between; gap: 10px; }
.prog-l .ok { color: var(--green); font-weight: 800; }
.prog-bar { height: 8px; border-radius: 4px; background: var(--line); overflow: hidden; }
.prog-bar span { display: block; height: 100%; border-radius: 4px; background: linear-gradient(90deg, #7aa6f5, #9cc2ff); box-shadow: 0 0 10px rgba(141, 184, 255, .5); transition: width .6s; }
.prog-bar span.ok { background: linear-gradient(90deg, #22c55e, #4ade80); box-shadow: 0 0 10px rgba(74, 222, 128, .5); }

/* AI асистент */
.ai-box { display: flex; flex-direction: column; gap: 10px; padding: 14px; border-radius: 14px; background: var(--violet-bg); border: 1px solid #3a3166; }
.btn.ai { background: var(--violet); border-color: var(--violet); color: #1d1638; font-weight: 800; box-shadow: 0 0 18px rgba(201, 184, 255, 0.25); }
.note.warn { color: var(--amber); }

/* кабінет */
.me.active { border-color: var(--navy-line); background: var(--navy); color: #dce9ff; }
.slots { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.slot { display: flex; flex-direction: column; gap: 8px; }
.slot-box { height: 130px; border-radius: 12px; background: #fff; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.slot-box img { max-width: 90%; max-height: 110px; }
.slot-box .muted { color: #8a8f99; }
.toggle { flex-direction: row !important; align-items: center; gap: 10px; cursor: pointer; }
.toggle input { width: 18px; min-height: 18px; height: 18px; accent-color: var(--blue); }
label.btn { cursor: pointer; }

/* аркуш документа — як у NGlaw cases.js */
.paper { position: relative; padding: 40px 56px 48px; border-radius: 14px; background: #fff; color: #000; font-family: Tinos, 'Times New Roman', Times, serif; font-size: 16px; line-height: 1.55; display: flex; flex-direction: column; gap: 14px; }
.paper .crest { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.paper .crest img { height: 78px; }
.paper .org { font: 700 17px Arimo, Arial, sans-serif; letter-spacing: 0.13em; color: #0b1a33; text-align: center; }
.paper .rule { margin: 4px 40px 6px; border-top: 2px solid #0b1a33; border-bottom: 1px solid #0b1a33; height: 2px; }
.paper .stamp { position: absolute; top: 34px; right: 40px; padding: 5px 12px; border: 2px solid #b11; border-radius: 6px; color: #b11; font: 700 12px Arimo, Arial, sans-serif; letter-spacing: 0.2em; transform: rotate(-6deg); opacity: 0.85; }
.paper .to { align-self: flex-end; text-align: right; }
.paper .kind { text-align: center; font-size: 20px; font-weight: 700; letter-spacing: 0.2em; margin-top: 8px; }
.paper .body { text-align: justify; }
.paper a { color: #1155cc; text-decoration: underline; }
.paper .res { max-width: 340px; padding: 10px 12px; border: 1.5px solid #1a4fd6; border-radius: 4px; color: #1a4fd6; font-style: italic; font-size: 14px; }
.paper .res b { display: block; font: 700 10.5px Arimo, Arial, sans-serif; letter-spacing: 0.12em; font-style: normal; }
.paper .org-sub { font: 700 11px Arimo, Arial, sans-serif; letter-spacing: 0.08em; color: #333; text-align: center; }
.paper .head-row { display: flex; justify-content: space-between; gap: 20px; font-size: 13px; }
.paper .about { text-align: center; font-weight: 700; margin-top: -6px; }
.paper .body p { margin: 0 0 7px; }
.paper .b-par { text-indent: 36px; text-align: justify; }
.paper .b-center { text-align: center; font-weight: 700; margin: 12px 0 8px !important; }
.paper .b-sub { font-weight: 700; margin-top: 10px !important; }
.paper .b-item { text-align: justify; }
.paper .miss { background: #ffeb99; border-radius: 3px; padding: 0 2px; }
.preview-col { flex: 1 1 460px; position: sticky; top: 12px; }
.preview-col .paper { font-size: 12.5px; padding: 26px 28px 30px; gap: 10px; }
.preview-col .paper .crest img { height: 52px; }
.preview-col .paper .org { font-size: 13px; }
.preview-col .paper .kind { font-size: 16px; }
.preview-col .paper .stamp { top: 18px; right: 18px; }
.preview-col .paper .seal { height: 80px; }
.preview-col .paper .sig { height: 44px; }
@media (max-width: 1000px) { .preview-col { position: static; } }
.paper .sig-row { display: flex; align-items: center; gap: 14px; }
.paper .sig { height: 60px; }
.paper .seal { height: 110px; opacity: 0.9; transform: rotate(-8deg); }
.paper .sign { display: flex; justify-content: space-between; align-items: center; gap: 20px; flex-wrap: wrap; margin-top: 10px; }

.dossier .d-quote { margin: 6px 0 10px; padding: 4px 0 4px 14px; border-left: 3px solid #c9d3e3; }
.dossier .d-quote .b-par { text-indent: 0; }
.dossier .d-photos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 6px 0 12px; }
.dossier .d-photos img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border: 1px solid #c9d3e3; border-radius: 3px; break-inside: avoid; }
.dossier .d-note { color: #666; font-size: .9em; margin-bottom: 16px; }
.dossier .d-flow { margin: 4px 0 10px; padding-left: 20px; }
.dossier .d-flow li { margin: 4px 0; overflow-wrap: anywhere; }
@media (max-width: 700px) { .paper .body, .paper .b-par, .paper .b-item { text-align: left; } .paper .b-par { text-indent: 20px; } }
@media (max-width: 700px) { .paper { padding: 28px 22px; font-size: 15px; } .paper .stamp { right: 16px; top: 16px; } }

.login { flex: 1; display: flex; align-items: center; justify-content: center; padding: 40px 18px; }
.login .card { max-width: 420px; width: 100%; align-items: center; text-align: center; gap: 14px; padding: 32px 28px; }
.login img { height: 96px; }
.discord { background: #5865f2; border-color: #5865f2; color: #fff; font-weight: 800; height: 46px; width: 100%; }
.discord:hover { background: #4752c4; color: #fff; }

/* матеріали справи й збірка справи (оформлення як у NGlaw) */
.sub-card { padding: 14px; border-radius: 14px; background: var(--row); display: flex; flex-direction: column; gap: 10px; }
.dossier-wrap { display: flex; flex-direction: column; gap: 18px; max-width: 900px; width: 100%; margin: 0 auto; }
.paper.dossier { min-height: 1100px; }
.paper .d-h { font-size: 20px; margin: 4px 0 8px; }
.paper .d-line { margin: 0 0 5px; }
.paper .divider { display: flex; align-items: center; gap: 10px; }
.paper .divider img { height: 26px; filter: grayscale(1) brightness(.2); }
.paper .divider span { flex: 1; border-top: 1.5px solid #222; }
.paper.cover { justify-content: space-between; }
.paper .crest.big img { height: 170px; }
.paper .crest.big .org { font-size: 20px; letter-spacing: .24em; margin-top: 14px; }
.paper .case-card { margin: 10px 30px; padding: 30px 34px 24px; border: 1px solid #c8ccd6; border-left: 6px solid #0b1a33; }
.paper .case-card .kind { font: 700 12px Arimo, Arial, sans-serif; letter-spacing: .3em; color: #667; }
.paper .case-card .num { font-size: 32px; font-weight: 700; color: #0b1a33; margin-top: 6px; }
.paper .case-card .name { font-size: 22px; font-style: italic; }
.paper .case-card table { width: 100%; margin-top: 22px; border-collapse: collapse; font-size: 16px; }
.paper .case-card td { padding: 7px 0; border-top: 1px solid #e3e5ea; vertical-align: top; }
.paper .case-card td:first-child { width: 48%; color: #555; }
.paper .case-card td:last-child { font-weight: 700; }
.paper .cover-foot { text-align: center; font: 12px Arimo, Arial, sans-serif; color: #777; letter-spacing: .08em; }
.paper .d-sign { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin: 10px 0; }
.paper .muted-ink { color: #888; border-top: 1px solid #000; padding-top: 2px; font-size: 12px; min-width: 160px; display: inline-block; text-align: center; }
.appendix-label { font-weight: 800; color: var(--text-2); margin-top: 10px; }

@page { size: A4; margin: 14mm 16mm; }
@media print {
  .no-print, .appendix-label { display: none !important; }
  .dossier-wrap { gap: 0; max-width: none; }
  .paper.dossier, .dossier-wrap .paper { page-break-after: always; break-after: page; min-height: auto; }
  :root { color-scheme: light; }
  html, body, .screen, .main { background: #fff !important; }
  .dossier-wrap .paper { box-shadow: none; }
  .screen { border: 0; margin: 0; }
  .status, .side, .blob, .back, .col-side, .btns, h1, .sub, .pills { display: none !important; }
  .bezel { margin: 0; padding: 0; border: 0; box-shadow: none; background: #fff; }
  .main { padding: 0; }
  .paper { border-radius: 0; padding: 0; }
}

/* законодавство */
.law-row { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.law-ref { color: var(--blue-text); font-weight: 700; }
.law-snip { font-size: 12.5px; line-height: 1.45; }
.paper.law-text { white-space: pre-wrap; text-align: left; line-height: 1.6; }
.search.law-search { flex: none; height: 46px; margin-bottom: 14px; max-width: 640px; }
.search.law-search input { flex: 1; font-size: 15px; }

/* фото */
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 8px; margin-top: 8px; }
.photo { position: relative; aspect-ratio: 1; border-radius: 11px; overflow: hidden; background: rgba(255, 255, 255, .04); border: 1px solid rgba(255, 255, 255, .08); }
.photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-x { position: absolute; top: 5px; right: 5px; width: 26px; height: 26px; border-radius: 8px; border: 0; background: rgba(0, 0, 0, .65); color: #fff; font-size: 17px; line-height: 1; cursor: pointer; }

/* сортування й фільтри */
.toolbar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px; margin: 2px 0 12px; }
.tb-sel { display: flex; flex-direction: column; gap: 4px; font-size: 11.5px; font-weight: 700; color: var(--muted); letter-spacing: .02em; }
.tb-sel select { height: 34px; min-height: 0; padding: 0 30px 0 10px; border-radius: 10px; font-size: 13px; font-weight: 600; width: auto; max-width: 220px; }
.tb-count { margin-left: auto; font-size: 12.5px; color: var(--muted); padding-bottom: 8px; }
@media (max-width: 700px) { .tb-sel { flex: 1 1 calc(50% - 8px); } .tb-sel select { max-width: none; width: 100%; } }

/* панель керівництва */
.seg { display: inline-flex; padding: 3px; border-radius: 12px; background: rgba(255, 255, 255, .04); border: 1px solid rgba(255, 255, 255, .07); }
.seg button { height: 32px; padding: 0 12px; border: 0; border-radius: 9px; background: transparent; color: var(--text-2); font-weight: 700; font-size: 13px; cursor: pointer; }
.seg button[aria-pressed='true'] { background: var(--navy); color: #dce9ff; }
.chart-wrap { position: relative; }
.act-chart { width: 100%; height: auto; display: block; }
.act-chart .grid line { stroke: rgba(255, 255, 255, .07); stroke-width: 1; }
.act-chart text { fill: var(--muted); font-size: 10.5px; font-family: 'JetBrains Mono', monospace; }
.act-chart .bar path { fill: #5B8DE6; }
.act-chart .bar.on path { fill: #8DB8FF; }
.chart-tip { position: absolute; transform: translateX(-50%); pointer-events: none; padding: 5px 9px; border-radius: 8px; background: #0B0C0F; border: 1px solid rgba(141, 184, 255, .35); color: var(--text); font-size: 12px; font-weight: 700; white-space: nowrap; }
.table-wrap { overflow-x: auto; }
table.agents { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 720px; }
table.agents th { text-align: left; padding: 0 0 6px; }
table.agents th button { border: 0; background: none; padding: 4px 8px; border-radius: 8px; color: var(--muted); font-size: 11.5px; font-weight: 800; letter-spacing: .02em; cursor: pointer; }
table.agents th button[aria-pressed='true'] { color: var(--blue-text); background: rgba(141, 184, 255, .1); }
table.agents td { padding: 9px 8px; border-top: 1px solid rgba(255, 255, 255, .06); color: var(--text-2); }
table.agents td.n { font-family: 'JetBrains Mono', monospace; text-align: right; color: var(--text); }
table.agents th:nth-child(n+4):nth-child(-n+7) button { float: right; }
table.agents tr.idle td:first-child b { color: var(--muted); }
.lead-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin-bottom: 14px; }
@media (min-width: 1100px) { .lead-tiles { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 700px) { .lead-tiles { grid-template-columns: 1fr 1fr; } .lead-tiles .tile-v { font-size: 24px; } }
@media (max-width: 700px) { .lead-grid { grid-template-columns: 1fr; } }

/* модальне вікно */
.modal { position: fixed; inset: 0; z-index: 50; background: rgba(0, 0, 0, .6); backdrop-filter: blur(4px); display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal-card { width: min(560px, 100%); max-height: 92vh; overflow: auto; padding: 22px; border-radius: 18px; background: #14161B; border: 1px solid rgba(255, 255, 255, .1); box-shadow: 0 30px 80px rgba(0, 0, 0, .6); display: flex; flex-direction: column; gap: 12px; }
.modal-card h2 { margin: 0; }
.radio-row { flex-direction: row !important; align-items: flex-start; gap: 10px; cursor: pointer; }
.radio-row input { width: auto; min-height: 0; margin-top: 3px; }
.close-note { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; color: var(--amber, #F2C14E); }
.d-close { margin: 0 0 6px; }
@media print { .close-note { display: none; } }

.due-alert { display: flex; align-items: center; gap: 10px; margin-top: 10px; padding: 10px 14px; border-radius: 12px; background: rgba(242, 193, 78, .1); border: 1px solid rgba(242, 193, 78, .3); color: #F5D58A; font-size: 13.5px; }
.due-alert.over { background: rgba(255, 120, 120, .1); border-color: rgba(255, 120, 120, .35); color: #FFB3B3; }
.pills .right { margin-left: auto; }

/* знайомство й довідка */
.modal-card.tour { width: min(520px, 100%); gap: 10px; }
.modal-card.tour p { margin: 0; color: var(--text-2); line-height: 1.55; font-size: 14px; }
.modal-card.tour b, .help-p b { color: var(--text); }
.tour-ic { width: 48px; height: 48px; border-radius: 14px; display: flex; align-items: center; justify-content: center; background: rgba(141, 184, 255, .12); border: 1px solid rgba(141, 184, 255, .3); color: var(--blue-text); }
.tour-ic.sm { width: 34px; height: 34px; border-radius: 10px; flex: none; }
.tour-dots { display: flex; gap: 6px; justify-content: center; margin: 6px 0 2px; }
.tour-dots span { width: 7px; height: 7px; border-radius: 50%; background: rgba(255, 255, 255, .15); }
.tour-dots span.on { width: 20px; border-radius: 4px; background: var(--blue); }
.help-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 14px; align-items: start; }
.help-p { margin: 0 0 8px; color: var(--text-2); line-height: 1.55; font-size: 14px; }

/* ======================================================================
   ТЕМА «СКЛО» (обрано 08.11.2026): живе тло, матові панелі, білі основні кнопки
   ====================================================================== */
:root {
  --bezel: #06070b; --screen: transparent;
  --card: rgba(255, 255, 255, .06); --card-line: rgba(255, 255, 255, .12);
  --row: rgba(255, 255, 255, .055); --row-hover: rgba(255, 255, 255, .09); --field: rgba(255, 255, 255, .06);
  --line: rgba(255, 255, 255, .1); --line-strong: rgba(255, 255, 255, .18);
  --text: #f2f5fa; --text-2: #c5cbd6; --muted: #9aa3b5; --dim: #7c8597;
  --navy: rgba(140, 175, 255, .16); --navy-line: rgba(140, 175, 255, .34);
  --glass-bg: linear-gradient(140deg, rgba(255, 255, 255, .105), rgba(255, 255, 255, .04));
  --glass-line: rgba(255, 255, 255, .14);
  --glass-blur: blur(26px) saturate(1.4);
  --glass-shadow: 0 24px 60px rgba(0, 0, 0, .35), inset 0 1px 0 rgba(255, 255, 255, .2);
  --ease: cubic-bezier(.2, .8, .2, 1);
}
html, body { background: var(--bezel); min-height: 100%; }
.glass { background: var(--glass-bg); border: 1px solid var(--glass-line); backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur); box-shadow: var(--glass-shadow); }

/* живе тло */
.bg { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.bg .blob { position: absolute; border-radius: 50%; will-change: transform; }
.bg .b1 { width: 820px; height: 820px; left: -220px; top: -300px; background: radial-gradient(circle, rgba(79, 128, 255, .5), transparent 62%); animation: blobA 22s ease-in-out infinite; }
.bg .b2 { width: 760px; height: 760px; right: -220px; top: 18%; background: radial-gradient(circle, rgba(168, 85, 247, .38), transparent 62%); animation: blobB 26s ease-in-out infinite; }
.bg .b3 { width: 680px; height: 680px; left: 30%; bottom: -380px; background: radial-gradient(circle, rgba(20, 184, 166, .3), transparent 62%); animation: blobA 30s ease-in-out infinite reverse; }
.bg-crest { position: absolute; right: 6%; top: 16%; height: 58vh; opacity: .05; }
@keyframes blobA { 0%, 100% { transform: translate(0, 0) scale(1); } 50% { transform: translate(90px, 50px) scale(1.12); } }
@keyframes blobB { 0%, 100% { transform: translate(0, 0) scale(1); } 50% { transform: translate(-80px, -40px) scale(1.08); } }

/* каркас: скляне меню зліва, рядок пошуку зверху */
.layout { display: flex; gap: 18px; max-width: 1560px; margin: 0 auto; padding: 16px; min-height: 100vh; }
.col { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.side { position: sticky; top: 16px; align-self: flex-start; width: 264px; max-width: none; flex: none; height: calc(100vh - 32px); overflow-y: auto; scrollbar-width: none;
  border-radius: 28px; padding: 18px 14px; gap: 16px; border-right: 1px solid var(--glass-line); }
.side::-webkit-scrollbar { display: none; }
.brand img { filter: drop-shadow(0 4px 14px rgba(120, 160, 255, .5)); }
.brand small { color: var(--muted); }
.btn.create { background: #fff; color: #14203a; box-shadow: 0 10px 30px rgba(255, 255, 255, .16); }
.btn.create:hover { color: #14203a; filter: none; transform: translateY(-1px); box-shadow: 0 14px 34px rgba(255, 255, 255, .22); }
.btn.create2 { background: rgba(255, 255, 255, .07); border-color: rgba(255, 255, 255, .14); color: var(--text); }
.btn.create2:hover { background: rgba(255, 255, 255, .13); }
.navi { color: var(--text-2); border-radius: 14px; }
.navi:hover { background: rgba(255, 255, 255, .07); }
.navi.active { background: rgba(255, 255, 255, .15); border-color: rgba(255, 255, 255, .16); color: #fff; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .22); }
.navi.active .navi-ic { color: #fff; }
.navi .count { background: #fff; color: #14203a; border-radius: 10px; }
.navi .count.muted-count { background: rgba(255, 255, 255, .12); color: var(--text-2); }
.navi .count.red-count { background: #ff6b6b; color: #fff; }
.me-card { background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .1); }
.me-card:hover, .me-card.active { border-color: rgba(255, 255, 255, .3); box-shadow: none; }
.me-name small { color: #cfe0ff; }
.rank-bar span { background: rgba(255, 255, 255, .12); }
.rank-bar span.on { background: #fff; box-shadow: 0 0 8px rgba(255, 255, 255, .45); }

.topbar { position: sticky; top: 16px; z-index: 20; display: flex; align-items: center; gap: 14px; height: 58px; padding: 0 10px 0 12px; border-radius: 20px; font-size: 12.5px; }
.top-crest { display: none; }
.top-crest img { height: 30px; }
.top-search { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; height: 40px; padding: 0 8px 0 12px; border-radius: 13px; border: 1px solid transparent; background: transparent; color: var(--muted); font-weight: 600; text-align: left; transition: background .15s; }
.top-search span { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-search:hover { background: rgba(255, 255, 255, .06); color: var(--text-2); }
kbd { font: 700 11px 'JetBrains Mono', monospace; padding: 4px 7px; border-radius: 7px; background: rgba(255, 255, 255, .1); color: var(--text-2); }
.status-clock { margin: 0; color: var(--text-2); }
.status-bot { color: #86efac; }
.status-bell { width: 40px; height: 40px; border-radius: 13px; border-color: rgba(255, 255, 255, .14); background: rgba(255, 255, 255, .08); color: #fff; }
.bell-dot { background: #ff6b6b; box-shadow: 0 0 8px #ff6b6b; }
.main { padding: 4px 4px 30px; gap: 16px; }

/* картки й рядки — скло */
.card { background: var(--glass-bg); border: 1px solid var(--glass-line); backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur); box-shadow: var(--glass-shadow); border-radius: 26px; padding: 20px 22px; }
.card.accent { border-color: rgba(255, 255, 255, .22); box-shadow: var(--glass-shadow); }
.hero { background: var(--glass-bg); border: 1px solid var(--glass-line); backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur); box-shadow: var(--glass-shadow); border-radius: 28px; padding: 26px 28px; }
.hero-date { color: #cfe0ff; }
.hero h1 { font-size: 30px; letter-spacing: -.6px; }
.tile { border-radius: 22px; background: rgba(255, 255, 255, .07); border-color: rgba(255, 255, 255, .12); backdrop-filter: none; transition: transform .2s var(--ease), background .2s, border-color .2s; }
.tile:hover { transform: translateY(-3px); background: rgba(255, 255, 255, .11); border-color: rgba(255, 255, 255, .24); }
.tile-s { color: var(--text-2); }
.row { border-radius: 16px; border: 1px solid rgba(255, 255, 255, .06); transition: background .15s, transform .2s var(--ease), border-color .15s; }
.row.hot { background: rgba(140, 175, 255, .14); border-color: rgba(140, 175, 255, .3); }
.doc-row { background: rgba(255, 255, 255, .05) !important; border: 1px solid rgba(255, 255, 255, .07) !important; border-radius: 18px !important; }
.doc-row:hover { transform: translateY(-1px); background: rgba(255, 255, 255, .085) !important; border-color: rgba(255, 255, 255, .18) !important; }
.doc-row.hot { background: linear-gradient(90deg, rgba(140, 175, 255, .2), rgba(255, 255, 255, .05)) !important; border-color: rgba(140, 175, 255, .32) !important; }
.type-ic { border-radius: 14px; background: rgba(255, 255, 255, .06); border-color: rgba(255, 255, 255, .1); }
.empty { background: rgba(255, 255, 255, .04); border: 1px dashed rgba(255, 255, 255, .1); border-radius: 16px; }
.pill { border-radius: 8px; background: rgba(255, 255, 255, .1); color: var(--text-2); }
.pill.blue { background: rgba(140, 175, 255, .2); color: #cfe0ff; }
.pill.amber { background: rgba(242, 193, 78, .18); color: #f5d58a; }
.pill.red { background: rgba(255, 107, 107, .2); color: #ffc2c2; }
.pill.green { background: rgba(74, 222, 128, .18); color: #a7f3c8; }
.pill.violet { background: rgba(196, 150, 255, .2); color: #e7d6ff; }
.pill.teal { background: rgba(94, 234, 212, .18); color: #a7f5e8; }
.btn { border-radius: 13px; border-color: rgba(255, 255, 255, .12); background: rgba(255, 255, 255, .07); color: var(--text); transition: background .15s, transform .12s, box-shadow .15s; }
.btn:hover { background: rgba(255, 255, 255, .12); }
.btn:active { transform: scale(.97); }
.btn.primary { background: #fff; color: #14203a; box-shadow: 0 10px 26px rgba(255, 255, 255, .14); }
.btn.primary:hover { color: #14203a; filter: none; box-shadow: 0 12px 30px rgba(255, 255, 255, .22); }
.btn.navy { background: rgba(140, 175, 255, .18); border-color: rgba(140, 175, 255, .34); color: #dce9ff; }
.btn.danger { background: rgba(255, 107, 107, .16); border-color: rgba(255, 107, 107, .32); color: #ffc2c2; }
.btn.dashed { border-color: rgba(255, 255, 255, .22); }
input, textarea, select { border-radius: 12px; border-color: rgba(255, 255, 255, .12); background: rgba(255, 255, 255, .06); transition: border-color .15s, background .15s; }
input:focus, textarea:focus, select:focus { border-color: rgba(255, 255, 255, .34); background: rgba(255, 255, 255, .09); outline: none; }
select option { background: #151821; }
.choice button { border-radius: 12px; background: rgba(255, 255, 255, .06); border-color: rgba(255, 255, 255, .12); }
.choice button[aria-pressed='true'] { background: #fff; border-color: #fff; color: #14203a; box-shadow: none; }
.tiles button { border-radius: 16px; }
.tiles button[aria-pressed='true'] { background: rgba(255, 255, 255, .16); border-color: rgba(255, 255, 255, .26); color: #fff; }
.link { background: rgba(255, 255, 255, .08); color: #cfe0ff; }
.ev { background: rgba(255, 255, 255, .05); border-radius: 14px; }
.search { border-radius: 13px; background: rgba(255, 255, 255, .06); border-color: rgba(255, 255, 255, .12); }
.seg { background: rgba(255, 255, 255, .06); border-color: rgba(255, 255, 255, .1); }
.seg button[aria-pressed='true'] { background: #fff; color: #14203a; }
.prog-bar { background: rgba(255, 255, 255, .1); }
.modal { background: rgba(3, 4, 8, .5); backdrop-filter: blur(6px); }
.modal-card { background: linear-gradient(140deg, rgba(40, 46, 66, .82), rgba(22, 25, 36, .86)); border: 1px solid rgba(255, 255, 255, .16); backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur); border-radius: 26px; }
.toast { background: rgba(30, 36, 54, .85); border-color: rgba(255, 255, 255, .16); backdrop-filter: var(--glass-blur); border-radius: 16px; }
.due-alert { border-radius: 16px; }
.login .card { background: var(--glass-bg); }
table.agents td { border-top-color: rgba(255, 255, 255, .07); }
.act-chart .bar path { fill: #8fb4ff; }
.act-chart .bar.on path { fill: #fff; }

/* ---- анімації: появи й переходи (вимикаються, якщо в системі вимкнено рух) */
@keyframes pageIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes popIn { from { opacity: 0; transform: translateY(14px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes shimmer { from { background-position: -400px 0; } to { background-position: 400px 0; } }
/* сторінка зʼявляється одразу цілою, без анімації прозорості: на iPhone (Safari) під час такої анімації не працює
   розмиття матових панелей — герб на фоні спершу видно чітко, а потім він «замилюється» */
.modal-card { animation: popIn .28s var(--ease) both; }
.skel-page { display: flex; flex-direction: column; gap: 14px; }
.skel-page i, .skel { display: block; border-radius: 22px; background: linear-gradient(90deg, rgba(255, 255, 255, .05) 0, rgba(255, 255, 255, .1) 40%, rgba(255, 255, 255, .05) 80%) 0 0 / 800px 100%; animation: shimmer 1.3s linear infinite; }
.skel-list { margin-top: 18px; gap: 10px; } .skel-list i { height: 62px !important; border-radius: 16px; }
.skel-page i:nth-child(1) { height: 150px; } .skel-page i:nth-child(2) { height: 64px; } .skel-page i:nth-child(3) { height: 320px; }
.count.bump { animation: popIn .35s var(--ease); }
@media (prefers-reduced-motion: reduce) {
  .bg .blob, .main.page-in, .modal-card, .skel-page i, .skel, .count.bump, .doc-row, .dot { animation: none !important; }
  .row, .tile, .btn, .doc-row { transition: none !important; }
}

/* ---- телефон і планшет: нижня скляна панель замість бокового меню */
.tabbar { display: none; }
@media (max-width: 900px) {
  .layout { padding: 10px 10px calc(96px + env(safe-area-inset-bottom)); gap: 0; }
  .col { gap: 12px; }
  .side { display: none; }
  .side.sheet-open { display: flex !important; position: fixed; z-index: 60; left: 8px; right: 8px; top: auto; bottom: calc(92px + env(safe-area-inset-bottom)); width: auto; height: auto; max-height: 72vh;
    flex-direction: column; flex-wrap: nowrap; animation: popIn .25s var(--ease) both; background: linear-gradient(140deg, rgba(40, 46, 66, .9), rgba(22, 25, 36, .92)); }
  .side.sheet-open .side-group { flex-direction: column; gap: 3px; }
  .side.sheet-open .side-label, .side.sheet-open .case-link, .side.sheet-open .rank-bar { display: revert; }
  .side.sheet-open .side-label { display: block; }
  .side.sheet-open .navi { min-height: 44px; background: transparent; border-color: transparent; }
  .side.sheet-open .navi.active { background: rgba(255, 255, 255, .15); }
  .sheet-shade { position: fixed; inset: 0; z-index: 55; background: rgba(3, 4, 8, .5); backdrop-filter: blur(4px); }
  .tabbar:not(.hidden) { display: flex; position: fixed; z-index: 50; left: 10px; right: 10px; bottom: calc(10px + env(safe-area-inset-bottom)); height: 68px; padding: 0 6px; border-radius: 26px;
    align-items: center; justify-content: space-around; background: linear-gradient(140deg, rgba(40, 46, 66, .72), rgba(22, 25, 36, .78)); }
  .tab { position: relative; display: flex; flex-direction: column; align-items: center; gap: 3px; min-width: 58px; padding: 6px 4px; border: 0; background: none; color: var(--muted); font-size: 10.5px; font-weight: 700; }
  .tab.on { color: #fff; }
  .tab .count { position: absolute; top: 0; left: 50%; margin-left: 6px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; font-size: 10.5px; font-weight: 800; display: flex; align-items: center; justify-content: center; background: #fff; color: #14203a; }
  .tab .count.red-count { background: #ff6b6b; color: #fff; }
  .tab-plus { width: 54px; height: 54px; margin-top: -30px; border-radius: 19px; border: 0; background: #fff; color: #14203a; display: flex; align-items: center; justify-content: center; box-shadow: 0 10px 28px rgba(255, 255, 255, .22); }
  .topbar { top: 10px; height: 54px; gap: 8px; }
  .top-crest { display: flex; }
  .top-search span { display: none; }
  .top-search { flex: 0 0 auto; width: 40px; padding: 0; justify-content: center; background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .14); color: #fff; margin-left: auto; }
  .top-search kbd, .status-bot { display: none; }
  .card { padding: 16px; border-radius: 22px; }
  .hero { padding: 18px; border-radius: 24px; }
  .hero h1 { font-size: 22px; }
  /* на телефоні скло легше — менше навантаження */
  :root { --glass-blur: blur(14px); }
  .bg .blob { animation-duration: 40s; }
}
@media print { .bg, .tabbar, .topbar, .side { display: none !important; } .layout { display: block; padding: 0; } }

/* пошук Ctrl K */
.palette-wrap { align-items: flex-start; padding-top: 12vh; }
.palette { width: min(640px, 100%); padding: 10px; gap: 6px; max-height: 70vh; }
.pal-input { display: flex; align-items: center; gap: 10px; padding: 0 12px; height: 52px; border-radius: 16px; background: rgba(255, 255, 255, .07); color: var(--muted); }
.pal-input input { border: 0; background: transparent; min-height: 0; padding: 0; font-size: 16px; color: var(--text); }
.pal-input input:focus { background: transparent; }
.pal-res { overflow-y: auto; display: flex; flex-direction: column; gap: 8px; padding: 4px 2px 2px; }
.pal-hint { padding: 10px 12px; margin: 0; }
.pal-group { display: flex; flex-direction: column; gap: 2px; }
.pal-group .side-label { padding: 8px 12px 4px; }
.pal-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 13px; color: var(--text); }
.pal-item.on { background: rgba(255, 255, 255, .12); }
.pal-ic { width: 34px; height: 34px; flex: none; border-radius: 11px; display: flex; align-items: center; justify-content: center; background: rgba(255, 255, 255, .08); color: #cfe0ff; }
.pal-t { display: flex; flex-direction: column; min-width: 0; }
.pal-t b, .pal-t small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pal-t small { color: var(--muted); font-size: 12px; }
@media (max-width: 900px) { .palette-wrap { padding-top: 10px; } .palette { max-height: 80vh; } }
body { background: transparent; }
.side > * { flex-shrink: 0; }
.side .btn.create { height: 46px; }

/* перевірка справи перед закриттям */
.check-box { margin: 12px 0 4px; padding: 12px 14px; border-radius: 12px; background: rgba(246, 207, 116, .07); border: 1px solid rgba(246, 207, 116, .22); }
.check-box:has(.check-h.ok) { background: rgba(74, 222, 128, .07); border-color: rgba(74, 222, 128, .22); }
.check-box .check-h { display: flex; align-items: center; gap: 7px; margin: 0; font-weight: 600; font-size: 13.5px; color: #F6CF74; }
.check-box .check-h.ok { color: #4ADE80; }
.check-box ul { margin: 8px 0 6px; padding: 0; list-style: none; display: grid; gap: 5px; font-size: 13px; color: var(--text-2); }
.check-box li .pill { min-width: 26px; justify-content: center; margin-right: 4px; }
.check-box .note { margin: 4px 0 0; }

/* сповіщення: дзвіночок з лічильником і панель */
button.status-bell { cursor: pointer; font: inherit; padding: 0; }
.bell-n { position: absolute; top: -5px; right: -5px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: #ff5a5a; color: #fff; font: 700 10.5px/18px Inter, system-ui, sans-serif; font-style: normal; text-align: center; box-shadow: 0 0 0 2px rgba(10, 12, 20, .9), 0 0 10px rgba(255, 90, 90, .6); }
.notes-shade { position: fixed; inset: 0; z-index: 60; }
.notes-pop { position: fixed; z-index: 61; top: 78px; right: 24px; width: min(400px, calc(100vw - 24px)); max-height: min(560px, calc(100vh - 100px)); display: flex; flex-direction: column; border-radius: 20px; overflow: hidden;
  background: linear-gradient(140deg, rgba(40, 46, 66, .92), rgba(22, 25, 36, .95)); border: 1px solid rgba(255, 255, 255, .16); backdrop-filter: blur(24px) saturate(1.4); -webkit-backdrop-filter: blur(24px) saturate(1.4); box-shadow: 0 30px 80px rgba(0, 0, 0, .55); animation: popIn .22s var(--ease) both; }
.notes-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 16px; border-bottom: 1px solid rgba(255, 255, 255, .08); }
.notes-head .btn { height: 30px; padding: 0 10px; font-size: 12.5px; }
.notes-list { overflow: auto; padding: 6px; }
.note-row { display: flex; gap: 10px; align-items: flex-start; padding: 10px; border-radius: 13px; color: var(--text); text-decoration: none; position: relative; }
.note-row:hover { background: rgba(255, 255, 255, .06); }
.note-row.unread { background: rgba(120, 160, 255, .07); }
.note-ic { flex: none; width: 32px; height: 32px; border-radius: 10px; display: flex; align-items: center; justify-content: center; background: rgba(255, 255, 255, .06); }
.note-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; font-size: 13px; }
.note-main b { font-weight: 600; font-size: 13.5px; }
.note-main span { color: var(--text-2); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
.note-main small { color: var(--text-3, #8a90a0); font-size: 11.5px; }
.note-row .dot { position: absolute; top: 14px; right: 12px; }
@media (max-width: 760px) { .notes-pop { top: 70px; right: 12px; left: 12px; width: auto; max-height: calc(100vh - 170px); } }

/* кадрові справи */
.staff-head { display: flex; gap: 14px; align-items: center; }
.staff-head > .avatar { width: 64px; height: 64px; border-radius: 18px; flex: none; }
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.stat-grid span { display: flex; flex-direction: column; padding: 10px 12px; border-radius: 12px; background: rgba(255, 255, 255, .05); }
.stat-grid b { font-size: 22px; font-weight: 700; }
.stat-grid small { color: var(--text-2); font-size: 12px; }
.row.revoked { opacity: .62; }
.hr-add .seg { flex-wrap: wrap; }
@media (max-width: 760px) { .staff-head > .avatar { width: 52px; height: 52px; } }

/* меню «Кадри»: відділи з підменю співробітників */
.side-sub > summary { list-style: none; cursor: pointer; }
.side-sub > summary::-webkit-details-marker { display: none; }
.side-sub > summary::after { content: '›'; margin-left: 2px; color: var(--muted); font-size: 16px; transition: transform .15s; }
.side-sub[open] > summary::after { transform: rotate(90deg); }
.side-sub-list { display: flex; flex-direction: column; gap: 2px; margin: 2px 0 6px 18px; padding-left: 8px; border-left: 1px solid rgba(255, 255, 255, .1); max-height: 320px; overflow: auto; }
.navi.sub { min-height: 34px; gap: 9px; font-size: 13px; font-weight: 600; }
.sub-av { width: 20px; height: 20px; border-radius: 6px; flex: none; object-fit: cover; }
.sub-rank { color: var(--muted); font-size: 11px; font-weight: 700; flex: none; }
.sub-pen { min-width: 16px; height: 16px; padding: 0 4px; border-radius: 5px; background: rgba(255, 90, 90, .2); color: #ff9b9b; font-size: 10.5px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; }
@media (max-width: 900px) { .side:not(.sheet-open) .side-sub, .side:not(.sheet-open) #sideStaff .side-label { display: none; } }

/* досьє співробітника */
.crumbs { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; color: var(--text-2); }
.crumbs > span { color: var(--muted); }
.crumb-nav { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; }
.crumb-nav .btn { height: 30px; min-width: 30px; padding: 0 10px; justify-content: center; font-size: 16px; }
.crumb-nav .btn[aria-disabled] { opacity: .35; pointer-events: none; }
.crumb-nav small { color: var(--muted); font-weight: 700; }
.dossier-head { position: relative; overflow: hidden; display: grid; grid-template-columns: auto 1fr auto; gap: 18px; align-items: center; padding: 20px 22px; border-radius: 22px;
  background: linear-gradient(120deg, rgba(27, 42, 68, .9), rgba(37, 31, 66, .8)); border: 1px solid rgba(141, 184, 255, .25); box-shadow: 0 20px 50px rgba(0, 0, 0, .3), inset 0 1px 0 rgba(255, 255, 255, .08); }
.dossier-head > .avatar { width: 84px; height: 84px; border-radius: 20px; border: 2px solid rgba(255, 255, 255, .18); }
.dh-kicker { display: block; font-size: 11px; font-weight: 800; letter-spacing: .14em; color: var(--blue-text, #9cc2ff); }
.dossier-head h1 { margin: 4px 0 8px; }
.dh-facts { display: grid; grid-template-columns: repeat(2, minmax(110px, auto)); gap: 8px 18px; margin: 0; position: relative; z-index: 1; }
.dh-facts div { display: flex; flex-direction: column; }
.dh-facts dt { font-size: 11px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.dh-facts dd { margin: 0; font-weight: 700; font-size: 13.5px; }
.dh-crest { position: absolute; right: -10px; top: -30px; height: 190px; opacity: .07; pointer-events: none; }
@media (max-width: 760px) {
  .dossier-head { grid-template-columns: auto 1fr; padding: 16px; gap: 12px; }
  .dossier-head > .avatar { width: 60px; height: 60px; border-radius: 16px; }
  .dh-facts { grid-column: 1 / -1; }
  .crumb-nav { margin-left: 0; width: 100%; }
}
