:root {
  --bg:#202123;
  --card:#2f3036;
  --card2:#28292f;
  --text:#ececf1;
  --muted:#b4b6bf;
  --accent:#19c37d;
  --accent2:#10a37f;
  --blue:#7aa7ff;
  --border:#444654;
  --shadow:rgba(0,0,0,.28);
  --ok:#173f2c;
  --warn:#4a3b16;
  --bad:#4a1f24;
  --ok-border:#23a56f;
  --warn-border:#e0a800;
  --bad-border:#e05260;
  --input:#343541;
  --topbar:#111216;
}
html[data-theme="light"] {
  --bg:#f7f7f8;
  --card:#ffffff;
  --card2:#f1f2f4;
  --text:#202123;
  --muted:#6b7280;
  --accent:#f2a11f;
  --accent2:#ffb84d;
  --blue:#1f4e79;
  --border:#d9d9e3;
  --shadow:rgba(20,37,63,.08);
  --ok:#e8f7ee;
  --warn:#fff5d6;
  --bad:#fdecec;
  --ok-border:#22a06b;
  --warn-border:#e0a800;
  --bad-border:#dc3545;
  --input:#ffffff;
  --topbar:#ffffff;
}
* { box-sizing:border-box; }
body { margin:0; font-family:Arial, sans-serif; background:var(--bg); color:var(--text); }
a { color:var(--blue); text-decoration:none; }
a:hover { text-decoration:underline; }
.topbar { display:flex; align-items:center; gap:24px; background:var(--topbar); color:var(--text); padding:12px 24px; border-bottom:1px solid var(--border); position:sticky; top:0; z-index:10; }
.topbar a { color:var(--text); opacity:.92; margin-right:14px; }
.brand { font-weight:700; font-size:18px; white-space:nowrap; }
.brand-sun { color:#f9c21b; margin-right:6px; }
.topbar-right { margin-left:auto; display:flex; align-items:center; gap:14px; }
.user { color:var(--muted); white-space:nowrap; }
.container { max-width:1180px; margin:24px auto; padding:0 18px; }
h1 { margin:0 0 18px; font-size:28px; line-height:1.2; }
h2 { margin-top:28px; }
.login-card, .form-card { background:var(--card); border:1px solid var(--border); border-radius:16px; padding:24px; box-shadow:0 10px 30px var(--shadow); }
.login-card { max-width:390px; margin:80px auto; }
label { display:block; font-weight:700; margin:12px 0 6px; }
input, select, textarea { width:100%; padding:11px 12px; border:1px solid var(--border); border-radius:10px; font:inherit; background:var(--input); color:var(--text); }
textarea { resize:vertical; }
button, .btn { display:inline-block; border:1px solid var(--border); background:var(--card2); padding:10px 14px; border-radius:10px; cursor:pointer; color:var(--text); font-weight:700; font:inherit; }
button.primary, .btn.primary { background:var(--accent); color:#101114; border-color:var(--accent); }
html[data-theme="dark"] button.primary, html[data-theme="dark"] .btn.primary { color:#05130d; }
button.danger, .btn.danger { background:#7f1d1d; color:#fff; border-color:#991b1b; }
html[data-theme="light"] button.danger, html[data-theme="light"] .btn.danger { background:#dc3545; color:#fff; border-color:#dc3545; }
button.small, .btn.small { padding:6px 9px; border-radius:8px; font-size:12px; }
button:hover, .btn:hover { text-decoration:none; filter:brightness(1.05); }
.copy-btn.copied { background:var(--ok-border); color:#fff; border-color:var(--ok-border); }
.hint, .muted { color:var(--muted); font-size:13px; }
.messages { margin-bottom:18px; }
.msg { padding:12px 14px; border-radius:10px; margin-bottom:8px; border:1px solid var(--border); background:var(--card); }
.msg.error { background:var(--bad); border-color:var(--bad-border); }
.msg.ok { background:var(--ok); border-color:var(--ok-border); }
.cards { display:grid; grid-template-columns:repeat(auto-fit,minmax(180px,1fr)); gap:14px; margin:18px 0; }
.card { background:var(--card); border:1px solid var(--border); border-radius:16px; padding:18px; box-shadow:0 8px 22px var(--shadow); }
.card b { display:block; font-size:28px; margin-bottom:4px; }
.card span { color:var(--muted); }
.actions, .form-actions, .report-actions, .row-actions { display:flex; gap:8px; flex-wrap:wrap; align-items:center; }
.actions { margin:18px 0 26px; }
.page-head { display:flex; justify-content:space-between; gap:16px; align-items:flex-start; margin-bottom:16px; }
.data-table { width:100%; border-collapse:separate; border-spacing:0; background:var(--card); border:1px solid var(--border); border-radius:14px; overflow:hidden; box-shadow:0 8px 22px var(--shadow); }
.data-table th, .data-table td { border-bottom:1px solid var(--border); padding:10px 12px; text-align:left; vertical-align:top; }
.data-table th { background:var(--card2); color:var(--text); font-weight:700; }
.data-table tr:last-child td { border-bottom:none; }
.data-table.compact th, .data-table.compact td { font-size:13px; padding:7px 8px; }
.form-card.grid2 { display:grid; grid-template-columns:1fr 1fr; gap:4px 18px; }
.form-card .full { grid-column:1 / -1; }
.inline-form { display:inline; margin:0; }
.inline-form button { margin:0; }
.status-хороший td { background:var(--ok); }
.status-плохой td { background:var(--bad); }
.status-неполный-проверить td, .status-проверить td { background:var(--warn); }
.engineer-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(240px,1fr)); gap:14px; margin:14px 0 24px; }
.engineer-tile { background:var(--card); border:1px solid var(--border); border-left:6px solid var(--border); border-radius:16px; padding:16px; box-shadow:0 8px 22px var(--shadow); }
.engineer-tile h3 { margin:4px 0 8px; font-size:16px; }
.engineer-tile b { display:block; font-size:22px; line-height:1.15; margin-bottom:8px; }
.engineer-tile p { margin:0; color:var(--muted); font-size:13px; line-height:1.35; }
.tile-kind { display:inline-block; font-size:11px; text-transform:uppercase; letter-spacing:.04em; color:var(--muted); background:var(--card2); border-radius:999px; padding:3px 8px; }
.tile-good { border-left-color:var(--ok-border); }
.tile-warn { border-left-color:var(--warn-border); }
.tile-bad { border-left-color:var(--bad-border); }
.tile-action { border-left-color:var(--blue); }
.tile-neutral { border-left-color:#94a3b8; }
.two-cols { display:grid; grid-template-columns:1fr 1fr; gap:18px; align-items:start; }
.check-list, .bad-list { background:var(--card); border:1px solid var(--border); border-radius:14px; padding:14px 18px 14px 32px; margin:8px 0 18px; }
.check-list li, .bad-list li { margin:6px 0; }
details.full-days { margin-top:22px; }
details.full-days summary { cursor:pointer; font-weight:700; background:var(--card); border:1px solid var(--border); border-radius:14px; padding:12px 14px; margin-bottom:10px; }
.theme-switch { width:168px; height:38px; border-radius:999px; position:relative; padding:0; overflow:hidden; display:flex; align-items:center; justify-content:space-between; border:1px solid var(--border); background:#30303a; color:#fff; font-weight:800; font-size:11px; letter-spacing:.03em; }
.theme-switch span { position:relative; z-index:2; pointer-events:none; }
.theme-day { padding-left:14px; color:#fff; }
.theme-night { padding-right:14px; color:#f6f6f6; }
.theme-knob { position:absolute !important; z-index:1 !important; width:34px; height:34px; top:1px; right:2px; border-radius:50%; background:#fff; box-shadow:0 2px 7px rgba(0,0,0,.25); transition:.18s ease; }
html[data-theme="light"] .theme-switch { background:#f7a832; color:#fff; border-color:#f7a832; }
html[data-theme="light"] .theme-knob { right:132px; background:#fff; }
html[data-theme="light"] .theme-night { opacity:.1; }
html[data-theme="dark"] .theme-day { opacity:.1; }
.share-wrap { min-height:70vh; display:flex; align-items:center; justify-content:center; }
.share-card { width:min(760px,100%); background:var(--card); border:1px solid var(--border); border-radius:22px; padding:28px; box-shadow:0 18px 45px var(--shadow); display:grid; grid-template-columns:150px 1fr; gap:28px; align-items:center; }
.share-file-icon { width:140px; height:170px; border-radius:16px; background:var(--card2); border:1px solid var(--border); position:relative; display:flex; align-items:center; justify-content:center; font-size:30px; color:#fff; box-shadow:0 8px 22px var(--shadow); }
.share-file-icon.pdf { background:#b91c1c; }
.share-file-icon.docx { background:#1f4e99; }
.file-corner { position:absolute; top:0; right:0; border-top:36px solid rgba(255,255,255,.9); border-left:36px solid rgba(255,255,255,.25); width:0; height:0; }
.file-name { word-break:break-all; color:var(--muted); background:var(--card2); border-radius:10px; padding:10px 12px; }
.btn.big { padding:12px 18px; font-size:16px; }
@media (max-width: 860px) {
  .topbar { flex-wrap:wrap; }
  .topbar-right { margin-left:0; width:100%; justify-content:space-between; }
  .form-card.grid2, .two-cols, .share-card { grid-template-columns:1fr; }
  .page-head { display:block; }
  .data-table { display:block; overflow-x:auto; }
  .theme-switch { width:150px; }
  html[data-theme="light"] .theme-knob { right:114px; }
}

/* v0006 UI improvements */
.data-table.zebra tr:nth-child(odd):not(:first-child) td { background:rgba(255,255,255,.025); }
.data-table.zebra tr:nth-child(even):not(:first-child) td { background:rgba(0,0,0,.08); }
html[data-theme="light"] .data-table.zebra tr:nth-child(odd):not(:first-child) td { background:#ffffff; }
html[data-theme="light"] .data-table.zebra tr:nth-child(even):not(:first-child) td { background:#f3f4f6; }
.data-table.zebra tr:hover td { filter:brightness(1.05); }
.status-хороший td { background:var(--ok) !important; }
.status-плохой td { background:var(--bad) !important; }
.status-неполный-проверить td, .status-проверить td { background:var(--warn) !important; }

.entity-line { display:flex; align-items:center; gap:12px; min-width:0; }
.avatar { display:inline-flex; align-items:center; justify-content:center; flex:0 0 auto; color:#fff; font-weight:800; background:linear-gradient(135deg,var(--avatar-a),var(--avatar-b)); box-shadow:0 8px 18px var(--shadow); user-select:none; }
.avatar-lg { width:48px; height:48px; border-radius:999px; font-size:21px; }
.avatar-sm { width:32px; height:32px; border-radius:999px; font-size:14px; }
.object-icon { display:inline-flex; align-items:center; justify-content:center; flex:0 0 auto; background:linear-gradient(135deg,var(--card2),var(--input)); border:1px solid var(--border); box-shadow:0 8px 18px var(--shadow); color:var(--accent); user-select:none; }
.object-icon-lg { width:48px; height:48px; border-radius:12px; font-size:24px; }

.pagination { display:flex; align-items:center; justify-content:space-between; gap:12px; margin:16px 0 4px; color:var(--muted); }
.pagination > div { display:flex; gap:8px; flex-wrap:wrap; }
.btn.disabled, .btn.disabled:hover { opacity:.45; cursor:not-allowed; filter:none; }

.toggle-line { display:flex; align-items:center; gap:12px; padding:12px 14px; border:1px solid var(--border); border-radius:14px; background:var(--card2); cursor:pointer; }
.toggle-line input { position:absolute; opacity:0; pointer-events:none; }
.toggle-line small { display:block; color:var(--muted); font-weight:400; margin-top:3px; }
.toggle-ui { width:52px; height:30px; border-radius:999px; background:#4b5563; position:relative; flex:0 0 auto; transition:.18s ease; }
.toggle-ui::after { content:""; position:absolute; width:24px; height:24px; left:3px; top:3px; border-radius:50%; background:#fff; box-shadow:0 2px 7px rgba(0,0,0,.28); transition:.18s ease; }
.toggle-line input:checked + .toggle-ui { background:var(--accent); }
.toggle-line input:checked + .toggle-ui::after { transform:translateX(22px); }

.report-page .readable-block .data-table.compact th,
.report-page .readable-block .data-table.compact td { font-size:17px; padding:11px 12px; line-height:1.35; }
.report-page .readable-block .hint,
.report-page details.full-days summary { font-size:17px; line-height:1.35; }
.report-page .check-list li,
.report-page .bad-list li { font-size:16px; line-height:1.45; }

@media (max-width: 860px) {
  .pagination { align-items:flex-start; flex-direction:column; }
  .avatar-lg, .object-icon-lg { width:42px; height:42px; }
  .report-page .readable-block .data-table.compact th,
  .report-page .readable-block .data-table.compact td { font-size:15px; }
}

.pwa-install-btn {
  padding:8px 11px;
  border-radius:999px;
  border-color:var(--accent);
  background:transparent;
  color:var(--accent);
  font-size:13px;
  line-height:1;
}
.pwa-install-btn:hover {
  background:var(--accent);
  color:#05130d;
}
.pwa-install-btn[hidden] {
  display:none !important;
}
