:root { --bg: #f6f7f9; --card: #fff; --line: #e3e6ea; --text: #1d2330; --muted: #6b7280; --acc: #2563eb;
         --ok: #16a34a; --bad: #dc2626; --warn: #d97706; }
* { box-sizing: border-box; }
body { margin: 0; font: 14px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--text); }
header { display: flex; align-items: center; gap: 16px; padding: 10px 20px; background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 2; }
header nav a { margin-right: 12px; color: var(--muted); text-decoration: none; }
header nav a.on { color: var(--text); font-weight: 600; }
.brand { font-size: 16px; }
.grow { flex: 1; }
#bal { font-weight: 600; }
#bal.neg { color: var(--bad); }
#who { color: var(--muted); }
a { color: var(--acc); }
main { padding: 20px; max-width: 1400px; margin: 0 auto; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 16px; margin-bottom: 16px; }
.auth { max-width: 360px; margin: 60px auto; }
.auth h2 { margin-top: 0; }
label { display: block; margin: 10px 0 4px; color: var(--muted); font-size: 13px; }
input, select { width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; font: inherit; background: #fff; }
input.sm { width: 110px; padding: 4px 6px; }
button { padding: 7px 14px; border: 1px solid var(--line); border-radius: 6px; background: #fff; font: inherit; cursor: pointer; }
button.pri { background: var(--acc); border-color: var(--acc); color: #fff; }
button.red { color: var(--bad); }
button:disabled { opacity: .5; cursor: default; }
.bar { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; flex-wrap: wrap; }
.bar input[type=search] { width: 240px; }
table { width: 100%; border-collapse: collapse; background: var(--card); }
th, td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
th { font-weight: 600; color: var(--muted); font-size: 12px; position: sticky; top: 49px; background: var(--card); cursor: pointer; user-select: none; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tr:hover td { background: #fafbfc; }
td.cb, th.cb { width: 32px; }
.muted { color: var(--muted); }
.err { color: var(--bad); margin-top: 10px; min-height: 1em; }
.tag { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 12px; }
.tag.on { background: #dcfce7; color: var(--ok); }
.tag.off { background: #f1f5f9; color: var(--muted); }
.tag.stop { background: #fee2e2; color: var(--bad); }
.tag.wait { background: #fef3c7; color: var(--warn); }
.sw { position: relative; display: inline-block; width: 36px; height: 20px; vertical-align: middle; }
.sw input { opacity: 0; width: 0; height: 0; }
.sw span { position: absolute; inset: 0; background: #cbd5e1; border-radius: 20px; transition: .15s; cursor: pointer; }
.sw span:before { content: ""; position: absolute; width: 16px; height: 16px; left: 2px; top: 2px; background: #fff; border-radius: 50%; transition: .15s; }
.sw input:checked + span { background: var(--ok); }
.sw input:checked + span:before { transform: translateX(16px); }
#toast { position: fixed; bottom: 20px; right: 20px; background: #111827; color: #fff; padding: 10px 16px; border-radius: 6px; max-width: 420px; }
.note { background: #fff7ed; border: 1px solid #fed7aa; padding: 10px 14px; border-radius: 6px; margin-bottom: 12px; }
h3 { margin: 0 0 12px; }
/* ------------------------------------------------------------------ экран «Проекты» (js/projects.js) */
main.wide { max-width: none; }
.pj-cols { display: grid; grid-template-columns: 360px minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 1100px) { .pj-cols { grid-template-columns: 1fr; } }
.pj-cols textarea, .pj textarea { width: 100%; min-height: 90px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; font: 12px/1.4 Consolas, monospace; resize: vertical; }
.pj .ch { display: flex; justify-content: space-between; align-items: center; cursor: pointer; user-select: none; margin: 0; }
.pj .card.closed .cbody { display: none; }
.pj .card.closed .ch .arr { transform: rotate(-90deg); }
.pj .cbody { margin-top: 12px; }
.pj .ck { display: flex; gap: 8px; align-items: center; margin: 10px 0; color: var(--text); font-size: 13px; }
.pj .ck input { width: auto; }
.pj .chips { display: flex; gap: 6px; flex-wrap: wrap; margin: 6px 0 2px; }
.pj .chip { padding: 2px 10px; font-size: 12px; border-radius: 999px; background: #eff6ff; color: var(--acc); cursor: pointer; user-select: none; border: 1px solid #dbeafe; }
.pj .chip:hover { background: #dbeafe; }
.pj .chip.muted { background: #f1f5f9; color: var(--muted); border-color: var(--line); }
.pj .chip.on { background: var(--acc); color: #fff; border-color: var(--acc); }
.pj .chip .cnt { opacity: .75; margin-left: 4px; }
.pj .hint { font-size: 12px; color: var(--muted); margin-top: 8px; }
.pj .kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; margin-bottom: 16px; }
.pj .kpi { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; }
.pj .kpi .v { font-size: 20px; font-weight: 600; font-variant-numeric: tabular-nums; }
.pj .kpi .v small { font-size: 12px; font-weight: 500; margin-left: 4px; }
.pj .kpi .l { color: var(--muted); font-size: 12px; }
.pj .kpi.ok { background: #ecfdf5; border-color: #a7f3d0; }
.pj .kpi.blue { background: #eff6ff; border-color: #bfdbfe; }
.pj .bulk { background: #f8fafc; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; }
.pj .bulk input, .pj .bulk select { width: auto; padding: 4px 6px; font-size: 13px; }
.pj .bulk button { padding: 4px 10px; font-size: 13px; }
.pj .gbar { background: #fffbeb; border: 1px solid #fde68a; border-radius: 8px; padding: 8px 10px; }
.pj .tw { overflow-x: auto; }
.pj table th { top: 0; }
.pj td { vertical-align: middle; }
.pj td.dom b { font-size: 14px; }
.pj .lsub { font-size: 12px; color: var(--muted); font-family: Consolas, monospace; }
.pj .lsub a { text-decoration: none; font-weight: 600; }
.pj .bdg { display: inline-block; padding: 0 6px; margin-left: 6px; border-radius: 6px; font-size: 11px; background: #f1f5f9; color: var(--muted); border: 1px solid var(--line); vertical-align: 1px; }
.pj .bdg.w { background: #dcfce7; color: #047857; border-color: #a7f3d0; font-weight: 600; }
.pj .bdg.c2 { background: #fef3c7; color: #b45309; border-color: #fde68a; font-weight: 600; }
.pj .bdg.c1 { background: #fee2e2; color: #b91c1c; border-color: #fecaca; font-weight: 600; }
.pj .bdg.mr { background: #ede9fe; color: #6d28d9; border-color: #ddd6fe; }
.pj .grpb { display: inline-block; padding: 1px 10px; border-radius: 999px; font-size: 12px; background: #eff6ff; color: var(--acc); border: 1px solid #bfdbfe; cursor: pointer; }
.pj .grpb.empty { background: none; color: var(--muted); border-style: dashed; }
.pj .ed { color: var(--muted); cursor: pointer; margin-left: 4px; font-size: 12px; }
.pj tr.root td { background: #f8fafc; font-weight: 600; cursor: pointer; }
.pj tr.root .arr { display: inline-block; width: 14px; transition: transform .1s; }
.pj tr.root.open .arr { transform: rotate(90deg); }
.pj tr.sub td.dom { padding-left: 26px; }
.pj .acts { text-align: right; }
.pj .acts a, .pj .acts button { display: inline-block; padding: 2px 8px; margin-left: 4px; border: 1px solid var(--line); border-radius: 6px; background: #fff; text-decoration: none; font-size: 13px; line-height: 20px; }
.pj .acts a.off { opacity: .35; pointer-events: none; }
.pj .ok { color: var(--ok); }
.pj .bad { color: var(--bad); }
.pj .warn { color: var(--warn); }
.pj .res td { white-space: normal; }
.pj .rq { min-width: 260px; }
