/* ПланРесурс — стили. Фирменные цвета «Цифрового РЭС». */
:root {
  --red: #E20612;
  --red-dark: #B30510;
  --red-bg: #FDECEC;
  --graphite: #1F1F1F;
  --graphite-2: #333333;
  --ink: #222222;
  --muted: #595959;
  --muted-2: #6B6B6B;
  --line: #E4E4E4;
  --line-2: #DADADA;
  --bg: #F3F3F3;
  --card: #FFFFFF;
  --col: #EAEAEA;
  --slate: #3A4A5C;
  --ok-bg: #E6F2EA; --ok: #1F6B3E;
  --warn-bg: #FFF3D6; --warn: #7A5600;
  --radius: 10px;
  --font: Montserrat, "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, Arial, sans-serif;
  --sidebar: 256px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { -webkit-tap-highlight-color: transparent; font-family: var(--font); color: var(--ink); background: var(--bg); font-size: 14px; line-height: 1.4; -webkit-text-size-adjust: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
h1, h2, h3 { margin: 0; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.boot { padding: 40px; color: var(--muted); }
.muted { color: var(--muted); }
.red { color: var(--red-dark); }
.hidden { display: none !important; }

/* ---------- Кнопки и поля ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 38px; padding: 0 14px; border-radius: 8px; border: 1px solid var(--line-2); background: #fff; cursor: pointer; font-size: 14px; font-weight: 500; white-space: nowrap; }
.btn:hover { border-color: #BDBDBD; }
.btn:focus-visible, .icon-btn:focus-visible, .chip:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, .card:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.btn.primary { background: var(--red); border-color: var(--red); color: #fff; font-weight: 600; }
.btn.primary:hover { background: var(--red-dark); border-color: var(--red-dark); }
.btn.dark { background: var(--ink); border-color: var(--ink); color: #fff; font-weight: 600; }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.danger { color: var(--red-dark); }
.btn.sm { height: 32px; padding: 0 10px; font-size: 13px; }
.btn:disabled { opacity: .5; cursor: default; }
.icon-btn { width: 40px; height: 40px; border-radius: 8px; border: 1px solid var(--line); background: #fff; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; position: relative; flex: none; }
.icon-btn svg { width: 18px; height: 18px; }
.input, .select, .textarea { width: 100%; height: 40px; border: 1px solid var(--line-2); border-radius: 8px; padding: 0 12px; background: #fff; font-size: 14px; }
.textarea { height: auto; min-height: 84px; padding: 10px 12px; resize: vertical; line-height: 1.45; }
.select { padding-right: 28px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span, .label { font-size: 12px; font-weight: 600; color: var(--muted); }
.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: 8px; overflow: hidden; background: #fff; }
.seg button { height: 34px; min-width: 40px; padding: 0 12px; border: none; border-right: 1px solid var(--line-2); background: #fff; cursor: pointer; font-size: 13px; }
.seg button:last-child { border-right: none; }
.seg button[aria-pressed="true"] { background: var(--ink); color: #fff; font-weight: 600; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border-radius: 17px; border: 1px solid var(--line-2); background: #fff; cursor: pointer; font-size: 13px; }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.badge { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--red); color: #fff; font-size: 11px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.pill { font-size: 11px; font-weight: 600; padding: 2px 7px; border-radius: 4px; white-space: nowrap; }
.pill.ok { background: var(--ok-bg); color: var(--ok); }
.pill.warn { background: var(--warn-bg); color: var(--warn); }
.pill.crit { background: var(--red-bg); color: var(--red-dark); }
.pill.grey { background: #EDEDED; color: var(--muted); }
.pill.work { background: #E8EEF3; color: var(--slate); }
.wbs { flex: none; font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 4px; background: var(--ink); color: #fff; font-variant-numeric: tabular-nums; }
.avatar { width: 28px; height: 28px; border-radius: 50%; color: #fff; font-size: 10px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; flex: none; border: 2px solid #fff; }
.avatars { display: flex; }
.avatars .avatar { margin-right: -6px; }
.avatar.lg { width: 36px; height: 36px; font-size: 13px; border: none; }

/* ---------- Каркас ---------- */
.app { display: flex; min-height: 100vh; min-height: 100dvh; }
.sidebar { width: var(--sidebar); flex: none; background: var(--graphite); color: #fff; padding: 20px 14px; display: flex; flex-direction: column; gap: 22px; position: sticky; top: 0; height: 100vh; height: 100dvh; overflow-y: auto; }
.sidebar .logo { padding: 4px 8px 6px; display: block; }
.sidebar .logo img { height: 26px; width: auto; display: block; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a, .nav button { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; border-radius: 8px; font-size: 14px; color: #D9D9D9; background: none; border: none; cursor: pointer; text-align: left; width: 100%; }
.nav a:hover, .nav button:hover { background: #2A2A2A; color: #fff; }
.nav a.active { background: var(--graphite-2); color: #fff; font-weight: 600; box-shadow: inset 3px 0 0 var(--red); }
.nav-title { font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: #A6A6A6; padding: 0 12px 6px; }
.nav .proj { justify-content: flex-start; font-size: 13px; padding: 9px 12px; }
.nav .proj .dot { width: 8px; height: 8px; border-radius: 2px; flex: none; }
.nav .proj span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav .new-proj { margin-top: 6px; border: 1px dashed #4A4A4A; color: #C8C8C8; font-size: 13px; justify-content: flex-start; }
.sidebar .me-row { margin-top: auto; display: flex; align-items: center; gap: 6px; padding: 10px 0 0 8px; border-top: 1px solid #333; }
.sidebar .me { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; font-size: 13px; }
.sidebar .logout { width: 40px; height: 40px; flex: none; border: none; border-radius: 8px; background: transparent; color: #C8C8C8; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.sidebar .logout:hover { background: #2A2A2A; color: #fff; }
.sidebar .logout svg { width: 20px; height: 20px; }
.sidebar .me .who { flex: 1; min-width: 0; }
.sidebar .me .who b { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar .me .who span { color: #A6A6A6; font-size: 12px; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.conn { position: fixed; left: 50%; top: 10px; transform: translateX(-50%); z-index: 60; background: var(--warn-bg); color: var(--warn); border: 1px solid #E0C27A; padding: 6px 12px; border-radius: 8px; font-size: 13px; font-weight: 600; }
.mobile-top, .bottom-nav { display: none; }

.page-head { background: #fff; padding: 18px 24px 0; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 12px; }
.page-head.simple { padding-bottom: 18px; }
.head-row { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; }
.crumbs { font-size: 13px; color: var(--muted); }
.page-head h1 { font-size: 24px; font-weight: 700; letter-spacing: -0.01em; display: flex; align-items: center; gap: 10px; }
.page-head h1 .dot { width: 12px; height: 12px; border-radius: 3px; flex: none; }
.head-meta { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 13px; color: var(--muted); }
.head-meta b { color: var(--ink); font-weight: 600; }
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.tabs { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.tabs a, .tabs span { display: flex; align-items: center; gap: 6px; padding: 10px 14px 12px; font-size: 14px; white-space: nowrap; border-bottom: 3px solid transparent; color: var(--muted); font-weight: 500; }
.tabs a.active { border-color: var(--red); color: var(--ink); font-weight: 600; }
.tabs .soon { color: #9A9A9A; cursor: default; }
.tabs .tab-add { align-self: center; margin: 0 4px 3px; height: 30px; padding: 0 10px; border: 1px dashed var(--line-2); border-radius: 8px; background: #fff; color: var(--muted); font-size: 13px; cursor: pointer; white-space: nowrap; }
.tabs .tab-add:hover { color: var(--ink); border-color: #BDBDBD; }
.tabs .tab-sep { width: 1px; padding: 0; border: 0; background: var(--line); margin: 8px 8px 12px; flex: none; }
.tabs .soon small { font-size: 10px; background: #EDEDED; border-radius: 4px; padding: 1px 5px; color: var(--muted); }
.content { padding: 20px 24px 32px; }

/* ---------- Панель над доской ---------- */
.toolbar { padding: 14px 24px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.toolbar .spacer { flex: 1; }
.toolbar .lbl { font-size: 13px; color: var(--muted); }
.toolbar .search { width: 220px; height: 34px; }
.toolbar .select { width: auto; height: 34px; font-size: 13px; }

/* ---------- Доска ---------- */
.board-wrap { flex: 1; display: flex; gap: 16px; padding: 0 24px 24px; min-height: 0; align-items: flex-start; }
.board { flex: 1; min-width: 0; overflow-x: auto; padding-bottom: 8px; }
.cols { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(268px, 1fr); gap: 14px; min-width: min-content; }
.col { background: var(--col); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 10px; min-height: 120px; }
.col.drop-target { box-shadow: inset 0 0 0 2px var(--ink); }
.col-head { display: flex; align-items: center; justify-content: space-between; padding: 2px 4px; }
.col-head b { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; }
.col-head .sq { width: 10px; height: 10px; border-radius: 3px; }
.col-head .count { font-size: 12px; color: var(--muted); font-weight: 600; }
.col-add { background: transparent; border: none; text-align: left; font-size: 13px; color: var(--muted); padding: 8px 4px; cursor: pointer; border-radius: 8px; }
.col-add:hover { background: rgba(0,0,0,.04); color: var(--ink); }
.col-new { display: flex; flex-direction: column; gap: 8px; }
.col-new .col-new-title { min-height: 64px; height: auto; resize: none; overflow: hidden; display: block; box-sizing: border-box; }
.col-new .row { flex-wrap: wrap; }

.card { background: #fff; border: 1px solid transparent; border-radius: var(--radius); padding: 12px; display: flex; flex-direction: column; gap: 9px; box-shadow: 0 1px 2px rgba(0,0,0,.06); cursor: pointer; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; touch-action: manipulation; }
.card:hover { border-color: #D0D0D0; }
.card.parent { background: #FAFAFA; border-color: #D0D0D0; }
.card.open { outline: 2px solid var(--ink); }
.card.dragging { opacity: .35; }
.card .path { font-size: 11px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card .top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.card h3 { font-size: 14px; font-weight: 600; line-height: 1.35; word-break: break-word; }
.card.lvl1 h3 { font-size: 15px; font-weight: 700; }
.card .meta { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 12px; color: var(--muted); }
.card .meta .late { color: var(--red-dark); font-weight: 600; }
.card .bar { height: 4px; border-radius: 2px; background: #EDEDED; overflow: hidden; }
.card .bar i { display: block; height: 4px; background: var(--slate); }
.card .foot { display: flex; justify-content: space-between; align-items: center; min-height: 0; }
.card .foot:empty { display: none; }
.card .kids { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; min-height: 36px; padding: 0 10px; border: 1px solid var(--line-2); border-radius: 8px; background: #fff; font-size: 12px; font-weight: 600; cursor: pointer; }
.card .kids > span:first-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.card .kids .pill { flex: none; }
.drop-line { height: 3px; border-radius: 2px; background: var(--red); margin: -6px 0; }
.drag-ghost { position: fixed; z-index: 100; pointer-events: none; transform: rotate(2deg); box-shadow: 0 10px 24px rgba(0,0,0,.18); opacity: .95; }
.empty { color: var(--muted); padding: 28px; text-align: center; background: #fff; border-radius: 12px; border: 1px dashed var(--line-2); }

/* ---------- Карточка задачи (панель) ---------- */
.panel { flex: 0 0 420px; max-width: 420px; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 20px; display: flex; flex-direction: column; gap: 16px; position: sticky; top: 16px; max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); overflow-y: auto; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.panel-head .where { font-size: 12px; font-weight: 600; color: var(--muted); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.panel .title-input { font-size: 19px; font-weight: 700; line-height: 1.3; border: 1px solid transparent; border-radius: 8px; padding: 4px 6px; margin: -4px -6px; width: calc(100% + 12px); resize: none; background: transparent; min-height: 34px; }
.panel .title-input:hover { border-color: var(--line); }
.panel .title-input:focus { border-color: var(--line-2); background: #fff; outline: none; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.section { display: flex; flex-direction: column; gap: 8px; }
.section-title { display: flex; justify-content: space-between; align-items: center; font-size: 13px; font-weight: 600; }
.assignees { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.assignee { display: inline-flex; align-items: center; gap: 6px; padding: 3px 4px 3px 3px; border-radius: 16px; background: #F3F3F3; font-size: 13px; }
.assignee .avatar { width: 24px; height: 24px; border: none; font-size: 9px; }
.assignee button { border: none; background: none; cursor: pointer; width: 22px; height: 22px; border-radius: 50%; color: var(--muted); font-size: 15px; line-height: 1; }
.assignee button:hover { background: #E4E4E4; color: var(--ink); }
.pf { width: 100%; border-collapse: collapse; font-size: 12px; font-variant-numeric: tabular-nums; }
.pf th, .pf td { padding: 7px 4px; border-bottom: 1px solid #F0F0F0; text-align: left; }
.pf thead th { font-weight: 500; color: var(--muted); border-bottom-color: var(--line); }
.pf tbody th { font-weight: 500; color: var(--muted); white-space: nowrap; }
.pf td { font-weight: 600; }
.pf td.na { color: #9A9A9A; font-weight: 400; }
.check-row { display: flex; gap: 10px; align-items: center; font-size: 13px; }
.check-row input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--ink); flex: none; }
.check-row .t { flex: 1; word-break: break-word; }
.check-row.done .t { color: var(--muted); text-decoration: line-through; }
.check-row button { border: none; background: none; color: var(--muted); cursor: pointer; width: 28px; height: 28px; border-radius: 6px; }
.check-row button:hover { background: #F0F0F0; color: var(--ink); }
.sub-row { display: grid; grid-template-columns: auto 1fr auto; gap: 8px; align-items: center; font-size: 13px; padding: 8px 10px; background: #F7F7F7; border-radius: 8px; cursor: pointer; }
.sub-row:hover { background: #EFEFEF; }
.comment { font-size: 13px; line-height: 1.45; background: #F7F7F7; border-radius: 8px; padding: 10px 12px; white-space: pre-wrap; word-break: break-word; }
.comment .who { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 2px; }
.comment .who b { font-weight: 600; }
.comment .who span { color: var(--muted); font-size: 12px; }
.comment .del { border: none; background: none; color: var(--muted); cursor: pointer; font-size: 12px; padding: 0; }
.history { font-size: 12px; color: var(--muted); display: flex; flex-direction: column; gap: 6px; }
.history b { color: var(--ink); font-weight: 600; }
details > summary { cursor: pointer; font-size: 13px; font-weight: 600; list-style: none; }
details > summary::-webkit-details-marker { display: none; }
details > summary::before { content: '▸ '; }
details[open] > summary::before { content: '▾ '; }
.range { width: 100%; accent-color: var(--slate); }

/* ---------- Таблицы и списки ---------- */
.table-box { background: #fff; border: 1px solid var(--line); border-radius: 12px; overflow-x: auto; }
table.list { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 640px; }
table.list th { text-align: left; font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; padding: 12px 16px; border-bottom: 1px solid var(--line); }
table.list td { padding: 12px 16px; border-bottom: 1px solid #F0F0F0; vertical-align: middle; }
table.list tr:last-child td { border-bottom: none; }
.user-cell { display: flex; align-items: center; gap: 10px; }
.user-cell .avatar { border: none; }

.my-group { display: flex; flex-direction: column; gap: 10px; margin-bottom: 22px; max-width: 920px; }
.my-group h2 { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.my-group.late h2 { color: var(--red-dark); }
.my-item { background: #fff; border-radius: 12px; padding: 14px 16px; display: grid; grid-template-columns: 1fr auto; gap: 6px 16px; box-shadow: 0 1px 2px rgba(0,0,0,.06); cursor: pointer; border: 1px solid transparent; }
.my-item:hover { border-color: #D0D0D0; }
.my-item .proj { font-size: 11px; font-weight: 600; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.my-item .proj i { width: 8px; height: 8px; border-radius: 2px; }
.my-item h3 { font-size: 15px; font-weight: 600; grid-column: 1; }
.my-item .side { grid-row: 1 / span 3; grid-column: 2; text-align: right; font-size: 12px; color: var(--muted); display: flex; flex-direction: column; gap: 6px; align-items: flex-end; }
.my-item .bar { grid-column: 1; height: 4px; border-radius: 2px; background: #EDEDED; overflow: hidden; max-width: 420px; }
.my-item .bar i { display: block; height: 4px; background: var(--slate); }

/* ---------- Окна ---------- */
.modal-back { position: fixed; inset: 0; background: rgba(20,20,20,.45); z-index: 80; display: flex; align-items: flex-start; justify-content: center; padding: 6vh 16px 16px; overflow-y: auto; }
.modal { background: #fff; border-radius: 14px; width: 100%; max-width: 560px; padding: 22px; display: flex; flex-direction: column; gap: 16px; box-shadow: 0 20px 50px rgba(0,0,0,.2); }
.modal.wide { max-width: 720px; }
.modal-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.modal-head h2 { font-size: 19px; font-weight: 700; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.modal h3 { font-size: 14px; font-weight: 700; margin-top: 4px; }
.palette { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.palette button { width: 32px; height: 32px; border-radius: 8px; border: 2px solid transparent; cursor: pointer; }
.palette button[aria-pressed="true"] { border-color: var(--ink); box-shadow: inset 0 0 0 2px #fff; }
.palette input[type=color] { width: 40px; height: 34px; border: 1px solid var(--line-2); border-radius: 8px; padding: 2px; background: #fff; }
.rows { display: flex; flex-direction: column; gap: 8px; }
.row { display: flex; gap: 8px; align-items: center; }
.row .input, .row .select { height: 36px; }
.temp-pass { font-size: 22px; font-weight: 700; letter-spacing: .06em; background: #F3F3F3; border-radius: 8px; padding: 12px 14px; font-variant-numeric: tabular-nums; user-select: all; -webkit-user-select: all; }
.error-text { color: var(--red-dark); font-size: 13px; min-height: 18px; }

#toasts { position: fixed; right: 16px; bottom: calc(16px + var(--safe-b)); z-index: 120; display: flex; flex-direction: column; gap: 8px; }
.toast { background: var(--ink); color: #fff; padding: 10px 14px; border-radius: 8px; font-size: 13px; max-width: 360px; box-shadow: 0 6px 18px rgba(0,0,0,.2); }
.toast.err { background: var(--red-dark); }

/* ---------- Вход ---------- */
.auth { min-height: 100vh; min-height: 100dvh; display: flex; align-items: center; justify-content: center; background: #fff; padding: 24px 16px; }
.auth-card { width: 100%; max-width: 420px; background: var(--graphite); color: #fff; border-radius: 16px; padding: 36px 32px 32px; display: flex; flex-direction: column; gap: 6px; }
.auth-logo { height: 44px; width: auto; align-self: center; }
.auth-sub { margin: 10px 0 18px; text-align: center; font-size: 15px; font-weight: 500; color: #fff; }
.auth-card .field > span, .auth-card .muted { color: #fff; }
.auth-card .error-text { color: #FF8A90; }
.auth-card .input { border-color: #3A3A3A; color: var(--ink); background: #fff; }
.auth-card .input:focus-visible { outline-color: #fff; }
.auth-card form { display: flex; flex-direction: column; gap: 14px; }
.auth-card h1 { font-size: 20px; font-weight: 700; }
.auth-card .btn { height: 46px; }

/* ---------- Телефон и планшет ---------- */
@media (max-width: 900px), (pointer: coarse) and (max-height: 500px) {
  .sidebar { position: fixed; left: 0; top: 0; z-index: 90; transform: translateX(-100%); transition: transform .2s; box-shadow: 0 0 40px rgba(0,0,0,.3); }
  .app.nav-open .sidebar { transform: none; }
  .app.nav-open::after { content: ''; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 85; }
  .mobile-top { display: flex; align-items: center; gap: 8px; background: var(--graphite); color: #fff; padding: 8px 10px; position: sticky; top: 0; z-index: 50; padding-top: calc(8px + env(safe-area-inset-top, 0px)); }
  .mobile-top img { height: 22px; }
  .mobile-top .icon-btn { background: transparent; border-color: transparent; color: #fff; width: 44px; height: 44px; }
  .mobile-top .spacer { flex: 1; }
  .bottom-nav { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); position: sticky; bottom: 0; z-index: 50; background: #fff; border-top: 1px solid var(--line); padding: 6px 4px calc(6px + var(--safe-b)); }
  .bottom-nav a, .bottom-nav button { display: flex; flex-direction: column; align-items: center; gap: 3px; min-height: 44px; justify-content: center; font-size: 11px; color: var(--muted); font-weight: 500; background: none; border: none; cursor: pointer; }
  .bottom-nav .active { color: var(--red); font-weight: 700; }
  .bottom-nav svg { width: 22px; height: 22px; }
  .page-head { padding: 14px 16px 0; }
  .page-head.simple { padding-bottom: 14px; }
  .page-head h1 { font-size: 20px; }
  .toolbar { padding: 10px 16px; }
  .toolbar .search { width: 100%; order: -1; }
  .toolbar .lbl, .toolbar .spacer { display: none; }
  .toolbar .select { flex: 1; min-width: 0; }
  .hide-m { display: none; }
  .content { padding: 16px; }
  .board-wrap { padding: 0 0 16px; }
  .board { scroll-snap-type: x mandatory; padding: 0 16px 8px; scroll-padding: 16px; }
  .cols { grid-auto-columns: min(84vw, 320px); }
  .lanes { min-width: 0 !important; width: max-content; }
  .lane-cols { grid-template-columns: repeat(var(--ncols), min(84vw, 320px)) !important; }
  .col { scroll-snap-align: start; }
  .panel { position: fixed; inset: 0; max-width: none; max-height: none; border-radius: 0; z-index: 70; border: none; padding: 16px 16px calc(24px + var(--safe-b)); padding-top: calc(12px + env(safe-area-inset-top, 0px)); }
  .auth-card { padding: 28px 20px 24px; }
  .modal-back { padding: 0; align-items: stretch; }
  .modal { border-radius: 0; max-width: none; min-height: 100%; padding: 18px 16px calc(24px + var(--safe-b)); }
  .grid2 { grid-template-columns: 1fr; }
  .input, .select, .textarea { font-size: 16px; } /* iOS не увеличивает страницу при вводе */
  #toasts { left: 16px; right: 16px; bottom: calc(76px + var(--safe-b)); }
}
@media (min-width: 901px) and (max-width: 1250px) {
  .panel { flex-basis: 360px; }
}
.auth-card .error-text:empty { display: none; }

/* Отражение родителя в другой колонке */
.card.ref { flex-direction: row; align-items: center; gap: 8px; padding: 7px 10px; background: transparent; border: 1px dashed #BDBDBD; box-shadow: none; cursor: pointer; }
.card.ref:hover { background: rgba(255,255,255,.6); border-color: #9A9A9A; }
.card.ref .wbs { background: #6B6B6B; }
.card.ref .ref-title { flex: 1 1 auto; min-width: 70px; font-size: 13px; font-weight: 600; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card.ref .ref-where { flex: 0 1 auto; min-width: 0; font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ref-toggle, .card-toggle { flex: none; min-width: 26px; height: 26px; padding: 0 6px; border: 1px solid var(--line-2); border-radius: 6px; background: #fff; cursor: pointer; font-size: 11px; font-weight: 700; color: var(--ink); display: inline-flex; align-items: center; justify-content: center; gap: 3px; }
.ref-toggle:hover, .card-toggle:hover { border-color: var(--ink); }

/* Дорожки */
.lanes { display: flex; flex-direction: column; gap: 12px; }
.lane-cols { display: grid; gap: 14px; }
.lane-col-head { background: var(--col); border-radius: 10px; padding: 10px 14px; }
.lane { background: #E4E4E4; border-radius: 12px; padding: 10px; display: flex; flex-direction: column; gap: 10px; }
.lane-head { display: flex; align-items: center; gap: 8px; padding: 0 4px; min-height: 32px; position: sticky; left: 0; max-width: calc(100vw - 48px); }
.lane-toggle { width: 32px; height: 32px; border: none; background: transparent; border-radius: 6px; cursor: pointer; font-size: 12px; }
.lane-toggle:hover { background: rgba(0,0,0,.06); }
.lane-title { font-size: 14px; font-weight: 700; color: var(--ink); }
a.lane-title:hover { color: var(--red); }
.lane-meta { margin-left: auto; font-size: 12px; color: var(--muted); white-space: nowrap; }
.lane-cell { background: var(--col); border-radius: 10px; padding: 10px; display: flex; flex-direction: column; gap: 10px; min-height: 64px; }
.lane.closed .lane-head { min-height: 32px; }
@media (max-width: 900px) { .lane-meta { display: none; } }

/* Телефон, повёрнутый горизонтально: компактная шапка, чтобы доска помещалась на экране */
@media (pointer: coarse) and (max-height: 500px) {
  .mobile-top { position: static; }
  .head-meta { display: none; }
  .page-head { gap: 8px; padding-top: 10px; }
  .bottom-nav { position: static; }
}

/* Excel */
.xl-block { display: flex; flex-direction: column; gap: 10px; padding-bottom: 16px; border-bottom: 1px solid var(--line, #e6e6e6); }
.xl-block:last-child { border-bottom: 0; padding-bottom: 0; }
.xl-block p { margin: 0; line-height: 1.5; font-size: 13px; }
.xl-pick { align-self: flex-start; cursor: pointer; }
.xl-name { font-size: 13px; }
.xl-result { border-radius: 10px; padding: 12px 14px; background: #F4F5F7; margin-top: 6px; }
.xl-result.ok { background: #EAF5EE; }
.xl-result.bad { background: #FDECEC; }
.xl-sum, .xl-issues { margin: 6px 0 0; padding-left: 18px; font-size: 13px; line-height: 1.6; }
.xl-issues.err li { color: #A11; }
.xl-warn { margin-top: 10px; font-size: 13px; }
.xl-warn summary { cursor: pointer; color: #8A6D00; font-weight: 600; }
.xl-warn .xl-issues { max-height: 220px; overflow: auto; }
a.btn { text-decoration: none; }

/* ---------- Гант и список ---------- */
.g-wrap { align-items: flex-start; }
.g-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.g-toolbar { padding: 14px 0; }
.g-body { min-width: 0; }
.g-scroll { position: relative; overflow: auto; max-height: calc(100vh - 210px); max-height: calc(100dvh - 210px); min-height: 280px; background: #fff; border: 1px solid var(--line); border-radius: 12px; overscroll-behavior: contain; }
.g-scroll.list { max-height: none; }
.g-grid { display: grid; position: relative; min-width: min-content; }
.g-corner, .g-thead { position: sticky; top: 0; z-index: 4; background: #FAFAFA; border-bottom: 1px solid var(--line); height: 48px; }
.g-corner { left: 0; z-index: 6; border-right: 1px solid var(--line); }
.g-thead { position: sticky; overflow: hidden; }
.g-left { position: sticky; left: 0; z-index: 3; background: #fff; border-right: 1px solid var(--line); }
.g-scroll.list .g-left, .g-scroll.list .g-corner { border-right: none; }
.g-hrow { display: flex; height: 100%; align-items: flex-end; }
.g-hrow .g-c { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .02em; padding: 0 8px 9px; }
.g-row { position: absolute; left: 0; right: 0; height: 34px; display: flex; align-items: center; border-bottom: 1px solid #F1F1F1; cursor: pointer; background: #fff; }
.g-row:hover { background: #F7F7F7; }
.g-row.sel { background: #FFF3F3; box-shadow: inset 3px 0 0 var(--red); }
.g-row.par .g-title { font-weight: 700; }
.g-row.crit .g-c-wbs .wbs { background: var(--red); }
.g-c { flex: none; padding: 0 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 13px; font-variant-numeric: tabular-nums; display: flex; align-items: center; gap: 4px; height: 100%; }
.g-c-title { min-width: 0; }
.g-c-title .g-title { overflow: hidden; text-overflow: ellipsis; }
.g-c-pred, .g-c-start, .g-c-end, .g-c-dur { color: var(--muted); font-size: 12px; }
.g-ind { flex: none; }
.g-tg { flex: none; width: 20px; height: 20px; border: none; background: transparent; cursor: pointer; font-size: 12px; color: var(--muted); border-radius: 4px; padding: 0; display: inline-flex; align-items: center; justify-content: center; }
.g-tg:hover { background: #EDEDED; color: var(--ink); }
.g-tg-sp { flex: none; width: 20px; }
.g-ms-i svg { width: 12px; height: 12px; fill: var(--red); display: block; }
.g-group { background: #F4F5F7; font-size: 13px; }
.g-group:hover { background: #ECEDEF; }
.g-group .muted { font-size: 12px; }
.g-st { font-size: 12px; display: inline-flex; align-items: center; gap: 6px; }
.g-st::before { content: ''; width: 8px; height: 8px; border-radius: 2px; background: var(--c); }
.g-c-who .avatar { width: 22px; height: 22px; font-size: 9px; margin-right: -4px; border: 2px solid #fff; }
.green { color: #2E7D4F; }

.g-sc-top, .g-sc-bot { position: absolute; left: 0; right: 0; height: 24px; }
.g-sc-top { top: 0; }
.g-sc-bot { top: 24px; }
.g-sc { position: absolute; top: 0; height: 24px; font-size: 11px; color: var(--muted); display: flex; align-items: center; padding-left: 5px; border-left: 1px solid #E8E8E8; white-space: nowrap; overflow: hidden; }
.g-sc-top .g-sc { font-weight: 700; color: var(--ink); }
.g-sc-bot .g-sc { justify-content: center; padding: 0; }
.g-sc.we { color: #B0B0B0; background: #F3F3F3; }

.g-chart { position: relative; background-image: repeating-linear-gradient(to bottom, transparent 0 33px, #F1F1F1 33px 34px); user-select: none; -webkit-user-select: none; touch-action: pan-x pan-y; }
.g-we { position: absolute; top: 0; bottom: 0; background: #F7F7F8; }
.g-grp-bg { position: absolute; left: 0; right: 0; height: 34px; background: #F4F5F7; }
.g-sel-bg { position: absolute; left: 0; right: 0; height: 34px; background: rgba(226, 6, 18, .05); }
.g-today { position: absolute; top: 0; bottom: 0; width: 0; border-left: 2px solid var(--red); opacity: .55; z-index: 1; }
.g-bar { position: absolute; height: 18px; border-radius: 4px; background: #9FB1C3; z-index: 2; cursor: grab; overflow: visible; }
.g-bar > i { position: absolute; left: 0; top: 0; bottom: 0; background: #3A4A5C; border-radius: 4px 0 0 4px; pointer-events: none; }
.g-bar.done { background: #8FB79F; }
.g-bar.done > i { background: #2E7D4F; }
.g-bar.crit { background: #F3A3A7; }
.g-bar.crit > i { background: var(--red); }
.g-bar.new { background: #CBD5DF; border: 1px dashed #3A4A5C; pointer-events: none; }
.g-bar:active { cursor: grabbing; }
.g-rs { position: absolute; top: 0; bottom: 0; width: 7px; cursor: ew-resize; z-index: 3; }
.g-rs.l { left: -3px; }
.g-rs.r { right: -3px; }
.g-lh { position: absolute; right: -16px; top: 50%; width: 11px; height: 11px; margin-top: -5.5px; border-radius: 50%; background: #fff; border: 2px solid #3A4A5C; cursor: crosshair; opacity: 0; transition: opacity .12s; z-index: 4; }
.g-bar:hover .g-lh, .g-sum:hover .g-lh, .g-ms:hover .g-lh { opacity: 1; }
.g-sum { position: absolute; height: 8px; background: var(--ink); z-index: 2; cursor: grab; }
.g-sum::before, .g-sum::after { content: ''; position: absolute; top: 100%; border: 5px solid transparent; border-top-color: var(--ink); }
.g-sum::before { left: 0; border-left-color: var(--ink); }
.g-sum::after { right: 0; border-right-color: var(--ink); }
.g-sum.crit { background: var(--red); }
.g-sum.crit::before { border-top-color: var(--red); border-left-color: var(--red); }
.g-sum.crit::after { border-top-color: var(--red); border-right-color: var(--red); }
.g-sum .g-lh { right: -18px; }
.g-ms { position: absolute; width: 18px; height: 18px; z-index: 2; cursor: grab; }
.g-ms svg { width: 18px; height: 18px; fill: var(--red); display: block; }
.g-ms:not(.crit) svg { fill: #B30510; }
.g-ms .g-lh { right: -16px; }
.g-target { outline: 2px solid var(--ink); outline-offset: 2px; }
.g-base { position: absolute; height: 4px; border-radius: 2px; background: #BDBDBD; z-index: 1; pointer-events: none; }
.g-lbl { position: absolute; height: 34px; display: flex; align-items: center; font-size: 12px; color: var(--muted); white-space: nowrap; pointer-events: none; z-index: 1; }
.g-links { position: absolute; left: 0; top: 0; z-index: 2; overflow: visible; pointer-events: none; }
.g-ln { fill: none; stroke: #6B7785; stroke-width: 1.4; }
.g-ln.crit { stroke: var(--red); stroke-width: 1.8; }
.g-ln.bad { stroke: var(--red); stroke-dasharray: 4 3; stroke-width: 1.8; }
.g-ln.tmp { stroke: var(--ink); stroke-dasharray: 3 3; }
.g-lhit { fill: none; stroke: transparent; stroke-width: 10; pointer-events: stroke; cursor: pointer; }
.g-lhit:hover + .g-lhit, .g-lhit:hover { stroke: rgba(34, 34, 34, .12); }
.g-tip { position: fixed; z-index: 90; background: var(--ink); color: #fff; border-radius: 8px; padding: 10px 12px; font-size: 12px; line-height: 1.5; max-width: 300px; box-shadow: 0 8px 24px rgba(0,0,0,.25); pointer-events: none; }
.g-tip .g-tip-t { font-weight: 700; font-size: 13px; margin-bottom: 4px; display: flex; gap: 6px; align-items: center; }
.g-tip .g-tip-t .wbs { background: #fff; color: var(--ink); }
.g-tip div > span:first-child { color: #BDBDBD; margin-right: 6px; }
.g-tip .red { color: #FF8C92; }
.g-tip .green { color: #8FD3A8; }

/* компактный Гант — телефон вертикально */
.gc { background: #fff; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.gc-hint { font-size: 12px; color: var(--muted); padding: 10px 12px; background: #FAFAFA; border-bottom: 1px solid var(--line); }
.gc-range { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); padding: 6px 12px 2px; }
.gc-grp { padding: 10px 12px; font-weight: 700; background: #F4F5F7; font-size: 13px; }
.gc-row { padding: 8px 12px 10px; border-bottom: 1px solid #F1F1F1; cursor: pointer; }
.gc-row.par .t { font-weight: 700; }
.gc-top { display: flex; align-items: center; gap: 6px; font-size: 13px; min-width: 0; }
.gc-top .t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gc-top .d { flex: none; font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.gc-track { position: relative; height: 12px; margin-top: 6px; background: #F4F5F7; border-radius: 3px; }
.gc-bar { position: absolute; top: 2px; height: 8px; border-radius: 2px; background: #3A4A5C; }
.gc-bar.sum { background: var(--ink); height: 5px; top: 3px; }
.gc-bar.crit { background: var(--red); }
.gc-bar.ms { background: var(--red); width: 8px !important; height: 8px; transform: rotate(45deg); }
.gc-base { position: absolute; bottom: 0; height: 2px; background: #BDBDBD; }
.gc-today { position: absolute; top: -2px; bottom: -2px; width: 0; border-left: 2px solid var(--red); opacity: .5; }

/* Связи в карточке задачи */
.lk-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.lk-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.lk-row.bad .lk-name { color: var(--red-dark); }
.lk-name { flex: 1 1 160px; min-width: 0; display: flex; align-items: center; gap: 6px; cursor: pointer; font-size: 13px; }
.lk-name .lk-t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lk-name:hover .lk-t { text-decoration: underline; }
.lk-row .select.sm, .lk-row .input.sm { height: 32px; font-size: 13px; padding: 0 8px; }
.lk-row .select.sm { width: auto; }
.lk-add .select.sm[data-lk-new] { flex: 1 1 180px; min-width: 0; }
.lk-lag { width: 64px !important; }
.lk-type { font-size: 12px; color: var(--muted); font-weight: 600; }
.lk-warn { flex-basis: 100%; font-size: 11px; color: var(--red-dark); }
.lk-none { font-size: 13px; }
.icon-btn.sm { width: 32px; height: 32px; }
.check-field { grid-column: 1 / -1; display: flex; gap: 8px; align-items: center; font-size: 13px; color: var(--muted); cursor: pointer; }

/* Ссылки для просмотра */
.share-list { display: flex; flex-direction: column; gap: 10px; }
.share-row { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; border: 1px solid var(--line); border-radius: 10px; padding: 12px; }
.share-info { flex: 1 1 300px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.share-info .muted { font-size: 12px; }
.share-info .input { height: 34px; font-size: 12px; }
.share-btns { display: flex; gap: 6px; flex-wrap: wrap; }
.share-page { min-height: 100vh; background: var(--bg); display: flex; flex-direction: column; }
.share-top { background: var(--graphite, #222); display: flex; align-items: center; gap: 14px; padding: 12px 24px; }
.share-top img { height: 26px; }
.share-sys { color: #fff; font-weight: 600; font-size: 14px; opacity: .85; }
.share-main { padding: 0 24px 24px; }

@media (max-width: 900px), (pointer: coarse) and (max-height: 500px) {
  .g-toolbar { padding: 10px 0; }
  .g-scroll { max-height: calc(100dvh - 150px); border-radius: 10px; }
  .share-main { padding: 0 12px 12px; }
  .share-top { padding: 10px 16px; }
}
@media (pointer: coarse) and (max-height: 500px) {
  .g-scroll { max-height: calc(100dvh - 60px); }
}
.g-toolbar .select { width: auto; height: 34px; font-size: 13px; }
@media (max-width: 900px), (pointer: coarse) and (max-height: 500px) {
  .g-toolbar { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding-left: 16px; padding-right: 16px; }
  .g-toolbar::-webkit-scrollbar { display: none; }
  .g-toolbar > * { flex: none; }
  .g-toolbar .spacer { display: none; }
}
@media (pointer: coarse) and (max-height: 500px) {
  .g-page .head-actions { display: none; }
  .g-page .page-head h1 { font-size: 18px; }
}
.g-toolbar .select { min-width: 190px; }
/* Вид проекта (верхняя строка) и доски (вторая строка) */
.page-head .tabs.views { border-bottom: 0; }
.subtabs { display: flex; align-items: center; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: 0 -24px; padding: 8px 24px; background: #FAFAFA; border-top: 1px solid var(--line); }
.subtabs::-webkit-scrollbar { display: none; }
.subtabs a { flex: none; padding: 6px 12px; border-radius: 16px; font-size: 13px; color: var(--muted); font-weight: 500; white-space: nowrap; border: 1px solid transparent; }
.subtabs a:hover { background: #F0F0F0; color: var(--ink); }
.subtabs a.active { background: #fff; border-color: var(--line-2); color: var(--ink); font-weight: 600; box-shadow: 0 1px 2px rgba(0,0,0,.05); }
.subtabs .tab-add { flex: none; height: 30px; padding: 0 10px; border: 1px dashed var(--line-2); border-radius: 16px; background: #fff; color: var(--muted); font-size: 13px; cursor: pointer; white-space: nowrap; }
@media (max-width: 900px), (pointer: coarse) and (max-height: 500px) { .subtabs { margin: 0 -16px; padding: 8px 16px; } }
.assignee-one { display: flex; align-items: center; gap: 10px; }
.assignee-one .select { flex: 1; }
.avatar.empty { background: #E4E4E4; color: var(--muted); }
.g-toolbar { flex-direction: column; align-items: stretch; gap: 8px; }
.g-toolrow { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.g-boards-lbl { margin-left: 8px; }
.g-hrow .g-c { position: relative; overflow: visible; }
.g-cr { position: absolute; right: -4px; top: 6px; bottom: 6px; width: 8px; cursor: col-resize; z-index: 2; }
.g-cr::after { content: ''; position: absolute; left: 3px; top: 0; bottom: 0; width: 2px; border-radius: 1px; background: transparent; }
.g-hrow .g-c:hover .g-cr::after, .col-resizing .g-cr::after { background: #BDBDBD; }
body.col-resizing, body.col-resizing * { cursor: col-resize !important; user-select: none; }
.g-group .g-c-title { gap: 6px; }
.g-group .g-c-start, .g-group .g-c-end, .g-group .g-c-dur, .g-group .g-c-hours { font-weight: 600; color: var(--ink); }
.g-bsum { position: absolute; height: 10px; background: repeating-linear-gradient(135deg, #8A96A3 0 6px, #A9B3BE 6px 12px); border-radius: 2px; z-index: 1; opacity: .8; }
.g-who { overflow: hidden; text-overflow: ellipsis; }
.g-tip .muted-t { color: #BDBDBD; margin-top: 4px; }
.col-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px 16px; }
.col-pick .check-field { color: var(--ink); }
@media (max-width: 900px), (pointer: coarse) and (max-height: 500px) {
  .g-toolbar { flex-direction: column; overflow-x: visible; margin: 0; padding-left: 0; padding-right: 0; }
  .g-toolrow { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 0 16px; }
  .g-toolrow::-webkit-scrollbar { display: none; }
  .g-toolrow > * { flex: none; }
}
/* Раздел «Сервер» */
.srv { display: flex; flex-direction: column; gap: 16px; max-width: 980px; }
.srv-card { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 20px; display: flex; flex-direction: column; gap: 12px; }
.srv-card h2 { font-size: 17px; font-weight: 700; }
.srv-card p { margin: 0; line-height: 1.5; font-size: 14px; }
.srv-card .row.wrap { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.srv-state { border-radius: 10px; padding: 12px 14px; background: #F4F5F7; font-size: 14px; line-height: 1.5; }
.srv-state.ok { background: #EAF5EE; }
.srv-state.warn { background: #FFF6E0; }
.srv-state.bad { background: #FDECEC; color: var(--red-dark); }
.srv-state a, .srv-steps a, .srv-out a { color: var(--ink); text-decoration: underline; }
.srv-steps { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; font-size: 14px; line-height: 1.5; }
.srv-out pre { white-space: pre-wrap; font-size: 12px; background: #F7F7F7; border-radius: 8px; padding: 10px; max-height: 200px; overflow: auto; }
.srv-out summary, .srv-more summary { cursor: pointer; font-size: 13px; color: var(--muted); font-weight: 600; }
.srv-more[open] summary { margin-bottom: 10px; }
.srv-kv { display: grid; grid-template-columns: 180px 1fr; gap: 8px 16px; font-size: 14px; }
.srv-kv > span { color: var(--muted); }
.srv-kv > b { font-weight: 500; overflow-wrap: anywhere; }
.srv-bk { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 10px; max-height: 340px; overflow: auto; }
.srv-bk-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 12px; border-bottom: 1px solid #F1F1F1; flex-wrap: wrap; }
.srv-bk-row:last-child { border-bottom: 0; }
.srv-bk-when { font-size: 14px; }
.srv-bk-when .muted { font-size: 12px; margin-left: 6px; }
.srv-bk-btns { display: flex; gap: 6px; }
.temp-addr { font-size: 14px; padding: 8px 12px; background: #F4F5F7; border-radius: 8px; overflow-wrap: anywhere; }
@media (max-width: 900px) { .srv-kv { grid-template-columns: 1fr; gap: 2px; } .srv-kv > b { margin-bottom: 8px; } .srv-card { padding: 16px; } }
/* ---------- Этап 4: часы, табель, подтверждение, загрузка, календарь ---------- */
.bottom-nav a { position: relative; }
.bottom-nav .badge { position: absolute; top: 2px; left: calc(50% + 6px); min-width: 16px; height: 16px; font-size: 10px; padding: 0 4px; }
.nav a .badge { margin-left: 6px; }
.tm-row { display: grid; grid-template-columns: 48px 1fr auto auto auto; gap: 4px 8px; align-items: center; font-size: 13px; padding: 6px 0; border-bottom: 1px solid #F1F1F1; }
.tm-row .pill { font-size: 11px; }
.tm-date { color: var(--muted); font-variant-numeric: tabular-nums; }
.tm-who { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tm-who small { display: block; color: var(--muted); font-size: 11px; overflow: hidden; text-overflow: ellipsis; }
.tm-h { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tm-acts { display: flex; gap: 4px; }
.tm-acts .btn.sm { height: 28px; min-width: 32px; padding: 0 8px; }
.tm-c { grid-column: 2 / -1; font-size: 12px; color: var(--muted); }
.tm-c.red { color: var(--red-dark); }
.tm-add { display: grid; grid-template-columns: 140px 64px 1fr auto; gap: 6px; }
.tm-add .input { height: 34px; font-size: 13px; padding: 0 8px; }
.tm-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.pill.warn { background: #FFF3D6; color: #8A6D00; }
.pill.ok { background: #E3F2E8; color: #2E7D4F; }
.ts-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 14px; }
.ts-bar .spacer { flex: 1; }
.ts-returned { background: #FDECEC; border-radius: 10px; padding: 10px 14px; margin-bottom: 14px; font-size: 13px; line-height: 1.6; color: var(--red-dark); }
.ts-wrap { overflow-x: auto; background: #fff; border: 1px solid var(--line); border-radius: 12px; }
.ts { border-collapse: collapse; width: 100%; min-width: 760px; }
.ts th, .ts td { border-bottom: 1px solid #F1F1F1; padding: 6px; text-align: center; font-size: 13px; }
.ts th { font-size: 11px; color: var(--muted); font-weight: 700; text-transform: uppercase; }
.ts th span { font-weight: 500; text-transform: none; }
.ts .off { background: #F7F7F8; }
.ts-task { text-align: left !important; min-width: 220px; }
.ts-task a { font-weight: 600; display: block; }
.ts-task .muted { font-size: 12px; display: flex; align-items: center; gap: 5px; }
.ts-task .dot { width: 7px; height: 7px; border-radius: 2px; display: inline-block; }
.ts-in { width: 54px; height: 32px; border: 1px solid var(--line-2); border-radius: 6px; text-align: center; font-size: 14px; background: #fff; font-variant-numeric: tabular-nums; }
.ts-in.ok { background: #E3F2E8; border-color: #9CCBAE; }
.ts-in.pend { background: #FFF3D6; border-color: #E6CC80; }
.ts-in.ret { border-color: var(--red); background: #FFF5F5; }
.ts tfoot td { font-weight: 700; }
.ts tfoot td span { font-weight: 400; color: var(--muted); font-size: 11px; }
.ts tfoot td.over { color: var(--red-dark); }
.ts-sum { font-weight: 700; }
.ts-legend { font-size: 12px; margin-top: 10px; line-height: 2; }
.ts-legend .ts-in { display: inline-flex; align-items: center; justify-content: center; width: auto; height: 22px; padding: 0 8px; font-size: 11px; margin-right: 6px; }
.ap-task { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-bottom: 10px; }
.ap-head { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; margin-bottom: 6px; }
.ap-head .muted { font-size: 12px; display: flex; align-items: center; gap: 5px; }
.ap-head .dot { width: 7px; height: 7px; border-radius: 2px; display: inline-block; }
.ap-row { display: grid; grid-template-columns: 20px 48px 180px 60px 1fr; gap: 8px; align-items: center; font-size: 13px; padding: 5px 0; border-top: 1px solid #F4F4F4; cursor: pointer; }
.ap-who { display: flex; align-items: center; gap: 6px; overflow: hidden; white-space: nowrap; }
.ap-who .avatar { width: 22px; height: 22px; font-size: 9px; }
.ld-bar { padding: 0 0 14px; }
.ld-legend { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.ld-legend i { width: 14px; height: 14px; border-radius: 3px; display: inline-block; margin-left: 8px; }
.ld-legend i.ok, .ld-c.ok { background: #E3F2E8; }
.ld-legend i.full, .ld-c.full { background: #FFE9A8; }
.ld-legend i.over, .ld-c.over { background: #F8B9BC; }
.ld-legend i.abs, .ld-c.abs { background: repeating-linear-gradient(135deg, #E4E4E4 0 4px, #F2F2F2 4px 8px); }
.ld-wrap { overflow-x: auto; background: #fff; border: 1px solid var(--line); border-radius: 12px; }
.ld { border-collapse: separate; border-spacing: 2px; min-width: 100%; }
.ld th { font-size: 11px; color: var(--muted); font-weight: 600; padding: 6px 4px; line-height: 1.3; white-space: nowrap; }
.ld th.now { color: var(--red); }
.ld th.off { color: #B0B0B0; }
.ld-name { position: sticky; left: 0; background: #fff; text-align: left !important; min-width: 200px; padding: 4px 8px !important; z-index: 1; }
td.ld-name { display: flex; align-items: center; gap: 8px; font-size: 13px; }
td.ld-name span { display: flex; flex-direction: column; min-width: 0; }
td.ld-name .muted { font-size: 11px; }
.ld-c { min-width: 52px; height: 38px; text-align: center; font-size: 12px; font-weight: 600; border-radius: 6px; cursor: pointer; font-variant-numeric: tabular-nums; }
.ld-c:not(.ok):not(.full):not(.over):not(.abs) { background: #FAFAFA; }
.ld-c.off { background: #F3F3F3; cursor: default; }
.ld-c:hover { outline: 2px solid var(--ink); }
.ld-c.off:hover { outline: none; }
.ld-sum { display: flex; gap: 18px; flex-wrap: wrap; font-size: 15px; }
.ld-sum .over-t { color: var(--red-dark); font-weight: 700; }
.ld-sum .full-t { color: #8A6D00; font-weight: 700; }
.ld-sum .ok-t { color: #2E7D4F; font-weight: 700; }
.ld-items { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 10px; }
.ld-item { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-bottom: 1px solid #F1F1F1; font-size: 13px; }
.ld-item:last-child { border-bottom: 0; }
.ld-item .dot { width: 8px; height: 8px; border-radius: 2px; flex: none; }
.ld-it { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.ld-it .muted { font-size: 12px; }
.ld-it a { font-weight: 600; }
.cal-legend { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); margin-bottom: 14px; }
.cal-legend .cal-d { margin-left: 10px; }
.cal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.cal-m { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px; }
.cal-m h3 { font-size: 14px; margin: 0 0 8px; display: flex; justify-content: space-between; }
.cal-m h3 .muted { font-weight: 500; font-size: 12px; }
.cal-w, .cal-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.cal-w span { font-size: 10px; color: var(--muted); text-align: center; text-transform: uppercase; }
.cal-d { position: relative; height: 30px; border: 0; border-radius: 6px; font-size: 13px; cursor: pointer; font-variant-numeric: tabular-nums; display: inline-flex; align-items: center; justify-content: center; min-width: 28px; }
.cal-d.work { background: #fff; box-shadow: inset 0 0 0 1px #EDEDED; }
.cal-d.short { background: #FFF3D6; }
.cal-d.off { background: #FDECEC; color: var(--red-dark); font-weight: 600; }
.cal-d.ov::after { content: ''; position: absolute; top: 3px; right: 3px; width: 5px; height: 5px; border-radius: 50%; background: var(--ink); }
.cal-d:hover { outline: 2px solid var(--ink); }
.abs-row { display: grid; grid-template-columns: 110px 190px 1fr auto; gap: 8px; align-items: center; font-size: 13px; padding: 4px 0; }
.abs-add { display: grid; grid-template-columns: 140px 140px 140px 1fr auto; gap: 6px; margin-top: 6px; }
.abs-add .input, .abs-add .select { height: 34px; font-size: 13px; }
@media (max-width: 900px) {
  .tm-add { grid-template-columns: 1fr 70px; }
  .tm-add [data-tm-comment] { grid-column: 1 / -1; }
  .tm-add .btn { grid-column: 1 / -1; }
  .ap-row { grid-template-columns: 20px 44px 1fr 50px; }
  .ap-row .muted { grid-column: 2 / -1; }
  .abs-row { grid-template-columns: 1fr auto; }
  .abs-add { grid-template-columns: 1fr 1fr; }
  .abs-add .btn, .abs-add [name="absComment"] { grid-column: 1 / -1; }
  .ld-name { min-width: 130px; }
}
.tabs .badge { padding: 0 6px; color: #fff; border-bottom: 0; font-size: 11px; font-weight: 700; margin-left: 2px; }
