/* Team web version for heads and admin. Design: canvas "Personal OS" → «Команда · Веб». Tokens come from app.css. */
body.web #bg { background: radial-gradient(60% 520px at 85% 0%, var(--glow) 0%, transparent 70%); }
body.web { font-size: 15px; }
.shell { position: relative; z-index: 1; max-width: 1600px; margin: 0 auto; display: flex; min-height: 100vh; }
.side { width: 248px; flex-shrink: 0; padding: 24px 16px; display: flex; flex-direction: column; gap: 20px;
  border-right: 1px solid var(--line); position: sticky; top: 0; height: 100vh; box-sizing: border-box; }
.brand { display: flex; align-items: center; gap: 10px; padding: 0 8px; }
.brand .logo { width: 32px; height: 32px; border-radius: 10px; background: var(--lime); color: var(--on-lime); display: flex;
  align-items: center; justify-content: center; font-weight: 700; }
.brand b { display: block; font-size: 16px; }
.brand span { display: block; font-size: 12px; color: var(--muted); }
.side nav { display: flex; flex-direction: column; gap: 2px; }
.side nav a { height: 44px; padding: 0 12px; border-radius: 12px; display: flex; align-items: center; gap: 12px;
  text-decoration: none; color: var(--muted); font-size: 15px; font-weight: 500; }
.side nav a[aria-current="page"] { background: var(--seg-on); color: var(--text); font-weight: 600; }
.side nav a:hover { color: var(--text); }
.side nav .tag { margin-left: auto; height: 20px; padding: 0 8px; border-radius: 10px; border: 1px dashed var(--s-new-line);
  color: var(--text-2); font-size: 11px; font-weight: 600; display: inline-flex; align-items: center; }
.me-box { margin-top: auto; padding: 12px; border-radius: 16px; background: var(--card); border: 1px solid var(--line);
  display: flex; align-items: center; gap: 10px; }
.me-box .grow { flex: 1; min-width: 0; }
.me-box b { display: block; font-size: 14px; }
.me-box span { display: block; font-size: 12px; color: var(--muted); }
.btn { height: 40px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--card);
  color: var(--text); font-size: 14px; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; text-decoration: none; }
.btn.primary { height: 44px; border-radius: 22px; background: var(--lime); color: var(--on-lime); border: none; font-weight: 600;
  font-size: 15px; justify-content: center; padding: 0 18px; }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--s-bad); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.sm { height: 32px; padding: 0 10px; border-radius: 10px; font-size: 13px; }

#view { flex: 1; min-width: 0; padding: 28px 32px 48px; display: flex; flex-direction: column; gap: 22px; }
.head { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }
.head .t { flex: 1 1 280px; min-width: 0; }
.head h1 { margin: 0; font-size: 28px; font-weight: 700; letter-spacing: -0.02em; }
.head .sub { font-size: 14px; margin-top: 4px; }
.search { flex: 0 1 320px; min-width: 200px; height: 44px; padding: 0 14px; border-radius: 22px; background: var(--card);
  border: 1px solid var(--line-2); display: flex; align-items: center; gap: 8px; color: var(--faint); }
.search input { flex: 1; min-width: 0; border: none; background: transparent; color: var(--text); font-size: 15px; outline: none; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.filters label.sel { height: 36px; padding: 0 6px 0 12px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--card);
  display: inline-flex; align-items: center; gap: 6px; font-size: 14px; color: var(--muted); }
.filters select { border: none; background: transparent; color: var(--text); font-size: 14px; height: 34px; outline: none; }
.filters select option { background: var(--sheet); }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.tile { padding: 18px; border-radius: 20px; background: var(--card); border: 1px solid var(--line); }
.tile span { font-size: 13px; color: var(--muted); }
.tile b { display: block; font-size: 34px; font-weight: 700; letter-spacing: -0.02em; margin: 4px 0 2px; }
.tile small { font-size: 13px; color: var(--faint); }
.tile.bad b { color: var(--s-bad); }
.tile.warn b { color: var(--s-review); }
.tile.good small { color: var(--s-done); }
.grid2 { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 16px; align-items: start; }
.panel { padding: 18px; border-radius: 22px; background: var(--card); border: 1px solid var(--line); display: flex;
  flex-direction: column; gap: 12px; min-width: 0; }
.panel h2 { margin: 0; font-size: 17px; font-weight: 600; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.panel h2 a, .panel h2 button.link { font-size: 13px; font-weight: 500; background: none; border: none; color: var(--lime); cursor: pointer; }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.load { display: flex; align-items: center; gap: 12px; }
.load .who { width: 180px; flex-shrink: 0; display: flex; align-items: center; gap: 10px; min-width: 0; }
.load .who b { display: block; font-size: 14px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.load .who span { display: block; font-size: 12px; color: var(--muted); }
.bar3 { flex: 1; height: 10px; border-radius: 5px; background: var(--inset); display: flex; overflow: hidden; }
.bar3 i { display: block; height: 100%; }
.c-work { background: var(--s-work); } .c-bad { background: var(--s-bad); } .c-review { background: var(--s-review); }
.load .n { width: 64px; text-align: right; font-size: 13px; color: var(--muted); }
.load .n b { color: var(--text); font-size: 15px; }
.dept { padding: 14px; border-radius: 16px; background: var(--inset); display: flex; flex-direction: column; gap: 8px; }
.dept .top3 { display: flex; gap: 18px; }
.dept .top3 b { font-size: 20px; display: block; }
.dept .top3 span { font-size: 12px; color: var(--muted); }
.progress { height: 6px; border-radius: 3px; background: var(--line-2); overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--s-done); }

/* board */
.board { display: grid; grid-template-columns: repeat(4, minmax(240px, 1fr)); gap: 14px; overflow-x: auto; padding-bottom: 8px; }
.col { border-radius: 20px; background: var(--card); border: 1px solid var(--line); padding: 12px; display: flex; flex-direction: column;
  gap: 10px; min-height: 300px; }
.col.drop { border-color: var(--lime); background: color-mix(in srgb, var(--card) 90%, var(--lime)); }
.col h3 { margin: 0 4px; font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.col h3 .cnt { color: var(--muted); font-weight: 500; }
.kcard { padding: 12px; border-radius: 14px; background: var(--inset); border: 1px solid var(--line); cursor: grab;
  display: flex; flex-direction: column; gap: 8px; text-align: left; color: var(--text); width: 100%; }
.kcard:active { cursor: grabbing; }
.kcard.dragging { opacity: .4; }
.kcard .tt { font-size: 14px; font-weight: 500; line-height: 1.35; }
.kcard .cl { font-size: 12px; color: var(--muted); }
.kcard .ft { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.kcard .av { width: 24px; height: 24px; font-size: 11px; }
.kcard .cm { font-size: 12px; color: var(--faint); }

/* table */
.tbl-wrap { border-radius: 20px; background: var(--card); border: 1px solid var(--line); overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); padding: 12px 14px; border-bottom: 1px solid var(--line);
  white-space: nowrap; cursor: pointer; user-select: none; }
.tbl td { padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: none; }
.tbl tr.sel td { background: var(--lime-soft); }
.tbl tbody tr:hover td { background: var(--chip); }
.tbl .ttl { font-weight: 500; cursor: pointer; }
.tbl .ttl small { display: block; color: var(--faint); font-weight: 400; font-size: 12px; }
.tbl .person { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.tbl .person .av { width: 24px; height: 24px; font-size: 11px; }
.tbl input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--lime); }
.bulk { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 14px; border-radius: 16px;
  background: var(--lime-soft); color: var(--text); font-size: 14px; }
.pager { display: flex; align-items: center; justify-content: space-between; font-size: 13px; color: var(--muted); }

/* clients */
.split { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 16px; align-items: start; }
.list-btn { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px; border-radius: 14px; border: none;
  background: transparent; color: var(--text); text-align: left; }
.list-btn[aria-current="true"] { background: var(--seg-on); }
.list-btn .grow { flex: 1; min-width: 0; }
.list-btn b { display: block; font-size: 14px; font-weight: 500; }
.list-btn span.s { display: block; font-size: 12px; color: var(--muted); }
.line { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); }
.line:first-of-type { border-top: none; }
.line .grow { flex: 1; min-width: 0; }
.line b { display: block; font-size: 14px; font-weight: 500; }
.line span.s { display: block; font-size: 12px; color: var(--muted); }
.summary { font-size: 14px; line-height: 1.55; color: var(--text-2); white-space: pre-line; }

/* drawer (task card) */
#drawer { position: fixed; inset: 0; z-index: 15; background: rgba(0, 0, 0, 0.45); display: flex; justify-content: flex-end; }
#drawer .dpanel { width: min(520px, 100%); height: 100%; overflow: auto; background: var(--bg); border-left: 1px solid var(--line);
  padding: 20px; display: flex; flex-direction: column; gap: 12px; box-sizing: border-box; }
#drawer .dock { position: sticky; bottom: -20px; left: auto; right: auto; padding: 10px 0 0; margin: 0 -20px -20px; padding: 10px 20px 20px; }
#sheet { align-items: center; }
#sheet .panel { border-radius: 24px; max-width: 520px; padding: 20px; }
#toast { bottom: 24px; }

/* login */
.login { max-width: 420px; margin: 12vh auto; padding: 32px; border-radius: 28px; background: var(--card); border: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 16px; text-align: center; position: relative; z-index: 1; }
.login h1 { margin: 0; font-size: 24px; }
.login p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.5; }
.login .code { font-family: ui-monospace, Menlo, monospace; font-size: 13px; padding: 10px; border-radius: 12px; background: var(--inset);
  color: var(--text-2); user-select: all; }

@media (max-width: 1100px) { .grid2, .split { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 860px) {
  .shell { flex-direction: column; }
  .side { width: auto; height: auto; position: static; border-right: none; border-bottom: 1px solid var(--line); padding: 14px; gap: 12px; }
  .side nav { flex-direction: row; overflow-x: auto; }
  .side nav a { white-space: nowrap; }
  .me-box { display: none; }
  #view { padding: 18px 14px 40px; }
  .load .who { width: 120px; }
}
.panel .search, .filters .search { flex: 0 0 auto; height: 44px; }
.filters .search { flex: 1 1 260px; }

/* reports: on/off switch (the schedule toggles) */
.switch { position: relative; flex-shrink: 0; width: 44px; height: 26px; }
.switch input { position: absolute; inset: 0; width: 44px; height: 26px; margin: 0; opacity: 0; cursor: pointer; z-index: 1; }
.switch input:disabled { cursor: default; }
.switch span { position: absolute; inset: 0; border-radius: 13px; background: var(--line-2); transition: background .15s; }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%;
  background: var(--text); transition: transform .15s; }
.switch input:checked + span { background: var(--lime); }
.switch input:checked + span::after { transform: translateX(18px); background: var(--on-lime); }
.switch input:focus-visible + span { outline: 2px solid var(--lime); outline-offset: 2px; }
.switch input:disabled + span { opacity: .6; }
