:root {
  --bg: #f6f7f9; --panel: #ffffff; --side: #1e1f24; --side-2: #2a2b31; --side-text: #c9cad1; --side-muted: #8b8d96;
  --text: #1e1f24; --muted: #6b6f7b; --line: #e6e7eb; --line-2: #f0f1f4;
  --accent: #6d5dfc; --accent-2: #5a4ae8; --accent-soft: #efedff;
  --ok: #16a34a; --ok-soft: #e7f7ed; --warn: #d97706; --warn-soft: #fef4e2; --bad: #e5484d; --bad-soft: #fdecec; --info: #2563eb; --info-soft: #e8f0fe;
  --radius: 10px; --shadow: 0 1px 2px rgba(16,17,20,.06), 0 4px 16px rgba(16,17,20,.06);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 14px; color: var(--text);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
h1 { font-size: 22px; margin: 0; font-weight: 650; letter-spacing: -.01em; }
h2 { font-size: 16px; margin: 0 0 12px; font-weight: 620; }
h3 { font-size: 13px; margin: 0 0 8px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }

/* layout */
.layout { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.sidebar { background: var(--side); color: var(--side-text); padding: 14px 10px; position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; }
.brand { display: flex; align-items: center; gap: 10px; padding: 6px 10px 16px; color: #fff; font-weight: 650; font-size: 15px; }
.brand .logo { width: 26px; height: 26px; }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 7px; color: var(--side-text); cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-item:hover { background: var(--side-2); color: #fff; }
.nav-item.active { background: #3a3b44; color: #fff; }
.nav-item .ico { width: 18px; text-align: center; opacity: .9; flex: none; }
.nav-sep { margin: 14px 10px 6px; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--side-muted); display: flex; justify-content: space-between; align-items: center; }
.nav-sep button { background: none; border: 0; color: var(--side-muted); cursor: pointer; font-size: 16px; line-height: 1; }
.nav-sep button:hover { color: #fff; }
.dot { width: 10px; height: 10px; border-radius: 3px; flex: none; display: inline-block; }
.side-footer { margin-top: auto; padding-top: 12px; border-top: 1px solid #33343b; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { height: 56px; display: flex; align-items: center; gap: 12px; padding: 0 24px; background: var(--panel); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.search { flex: 1; max-width: 420px; position: relative; }
.search input { width: 100%; padding: 8px 12px 8px 32px; border: 1px solid var(--line); border-radius: 18px; background: var(--bg); outline: none; }
.search input:focus { border-color: var(--accent); background: #fff; }
.search::before { content: "⌕"; position: absolute; left: 11px; top: 6px; color: var(--muted); font-size: 16px; }
.search-results { position: absolute; top: 40px; left: 0; right: 0; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); max-height: 400px; overflow: auto; }
.search-results .row { padding: 8px 12px; cursor: pointer; display: flex; gap: 8px; align-items: center; }
.search-results .row:hover { background: var(--bg); }
.spacer { flex: 1; }
.page { padding: 24px; max-width: 1400px; width: 100%; }
.page-head { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head .sub { color: var(--muted); }

/* timer widget */
.timer { display: flex; align-items: center; gap: 8px; padding: 5px 6px 5px 12px; border-radius: 18px; background: var(--ok-soft); color: #11632f; font-weight: 600; font-variant-numeric: tabular-nums; max-width: 380px; }
.timer .t-title { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 200px; cursor: pointer; }
.timer .pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); animation: pulse 1.4s infinite; }
@keyframes pulse { 50% { opacity: .3; } }

/* controls */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 8px; border: 1px solid var(--line); background: #fff; cursor: pointer; font-weight: 550; white-space: nowrap; }
.btn:hover { background: var(--bg); }
.btn.primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn.primary:hover { background: var(--accent-2); }
.btn.danger { color: var(--bad); }
.btn.small { padding: 4px 10px; font-size: 13px; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--line-2); }
.btn.round { border-radius: 18px; }
.btn:disabled { opacity: .5; cursor: default; }
.icon-btn { border: 0; background: none; cursor: pointer; padding: 4px 6px; border-radius: 6px; color: var(--muted); }
.icon-btn:hover { background: var(--line-2); color: var(--text); }
input.inp, select.inp, textarea.inp { padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; outline: none; width: 100%; }
.inp:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
textarea.inp { resize: vertical; min-height: 80px; }
label.f { display: flex; flex-direction: column; gap: 5px; font-size: 12px; color: var(--muted); font-weight: 550; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.seg { display: inline-flex; background: var(--line-2); border-radius: 8px; padding: 3px; }
.seg button { border: 0; background: none; padding: 5px 12px; border-radius: 6px; cursor: pointer; color: var(--muted); font-weight: 550; }
.seg button.on { background: #fff; color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.tabs a { padding: 8px 12px; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; font-weight: 550; }
.tabs a.on { color: var(--text); border-color: var(--accent); }

/* cards */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 18px; }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.kpi .v { font-size: 24px; font-weight: 680; margin-top: 4px; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.kpi .l { color: var(--muted); font-size: 12px; font-weight: 550; }
.kpi .s { color: var(--muted); font-size: 12px; margin-top: 2px; }
.two-col { display: grid; grid-template-columns: 1.3fr 1fr; gap: 16px; align-items: start; }
.two-col > div { min-width: 0; }
@media (max-width: 1100px) { .two-col { grid-template-columns: 1fr; } }

/* table */
table.tbl { width: 100%; border-collapse: collapse; background: #fff; }
.tbl th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 600; padding: 9px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 9px 12px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.tbl tr.click { cursor: pointer; }
.tbl tr.click:hover td { background: #fafafc; }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tbl-wrap { border: 1px solid var(--line); border-radius: var(--radius); overflow: auto; background: #fff; }

/* badges */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 10px; font-size: 12px; font-weight: 600; white-space: nowrap; background: var(--line-2); color: var(--muted); }
.b-ok { background: var(--ok-soft); color: #11632f; } .b-warn { background: var(--warn-soft); color: #9a5503; } .b-bad { background: var(--bad-soft); color: #b42318; } .b-info { background: var(--info-soft); color: #1d4ed8; } .b-acc { background: var(--accent-soft); color: var(--accent-2); }
.pri-low { color: #64748b; } .pri-medium { color: var(--info); } .pri-high { color: var(--warn); } .pri-urgent { color: var(--bad); }
.st-todo { background: #f1f2f5; color: #555a66; } .st-in_progress { background: var(--info-soft); color: #1d4ed8; } .st-review { background: #f3e8ff; color: #7e22ce; } .st-client_approval { background: var(--warn-soft); color: #9a5503; } .st-done { background: var(--ok-soft); color: #11632f; }
.pos { color: var(--warn); font-weight: 600; } .neg { color: var(--bad); font-weight: 600; } .zero { color: var(--ok); font-weight: 600; }
.muted { color: var(--muted); } .small { font-size: 12px; } .nowrap { white-space: nowrap; }
.avatar { width: 24px; height: 24px; border-radius: 50%; color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; flex: none; }
.avatar.lg { width: 34px; height: 34px; font-size: 13px; }
.user-chip { display: inline-flex; align-items: center; gap: 6px; }
.bar { height: 8px; background: var(--line-2); border-radius: 4px; overflow: hidden; position: relative; min-width: 80px; }
.bar > i { display: block; height: 100%; border-radius: 4px; background: var(--accent); }
.bar .mark { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--text); opacity: .5; }
.empty { padding: 40px; text-align: center; color: var(--muted); }

/* board */
.board { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 12px; align-items: flex-start; }
.col { flex: 0 0 290px; background: #eef0f3; border-radius: 12px; padding: 10px; max-height: calc(100vh - 210px); display: flex; flex-direction: column; }
.col-head { display: flex; align-items: center; gap: 8px; padding: 2px 4px 10px; font-weight: 620; }
.col-head .cnt { color: var(--muted); font-weight: 500; }
.col-body { overflow-y: auto; display: flex; flex-direction: column; gap: 8px; min-height: 40px; padding: 2px; }
.col.drag-over { background: #e3e0ff; }
.tcard { background: #fff; border: 1px solid var(--line); border-radius: 9px; padding: 10px 11px; cursor: pointer; box-shadow: 0 1px 1px rgba(0,0,0,.03); }
.tcard:hover { border-color: #c9c6f5; }
.tcard.dragging { opacity: .4; }
.tcard .tt { font-weight: 550; margin-bottom: 8px; line-height: 1.35; }
.tcard .meta { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.tcard.done .tt { text-decoration: line-through; color: var(--muted); }
.due.over { color: var(--bad); font-weight: 600; } .due.today { color: var(--warn); font-weight: 600; }
.add-inline { border: 1px dashed #cfd2da; background: transparent; border-radius: 8px; padding: 7px; color: var(--muted); cursor: pointer; text-align: left; margin-top: 8px; }
.add-inline:hover { background: #fff; color: var(--text); }

/* list view */
.tlist .grp { margin-bottom: 18px; }
.tlist .grp-h { font-weight: 650; padding: 6px 2px; display: flex; gap: 8px; align-items: center; }
.trow { display: grid; grid-template-columns: 26px 1fr 150px 120px 110px 90px; gap: 10px; align-items: center; padding: 8px 10px; background: #fff; border: 1px solid var(--line); border-top: 0; cursor: pointer; }
.trow:first-of-type { border-top: 1px solid var(--line); border-radius: 8px 8px 0 0; }
.trow:last-child { border-radius: 0 0 8px 8px; }
.trow:only-of-type { border-radius: 8px; }
.trow:hover { background: #fafafc; }
.trow .ttl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.check { width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid #b8bcc6; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; font-size: 11px; color: transparent; background: #fff; }
.check:hover { border-color: var(--ok); color: var(--ok); }
.check.on { background: var(--ok); border-color: var(--ok); color: #fff; }
@media (max-width: 900px) { .trow { grid-template-columns: 26px 1fr 100px; } .trow .hide-sm { display: none; } }

/* drawer */
.overlay { position: fixed; inset: 0; background: rgba(16,17,20,.25); z-index: 50; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(640px, 100vw); background: #fff; z-index: 51; box-shadow: -8px 0 30px rgba(0,0,0,.12); display: flex; flex-direction: column; animation: slide .18s ease-out; }
@keyframes slide { from { transform: translateX(30px); opacity: .6; } }
.drawer-head { display: flex; align-items: center; gap: 8px; padding: 12px 18px; border-bottom: 1px solid var(--line); }
.drawer-body { padding: 18px 22px; overflow-y: auto; flex: 1; }
.title-inp { font-size: 20px; font-weight: 650; border: 1px solid transparent; border-radius: 8px; padding: 6px 8px; width: 100%; outline: none; margin-left: -8px; }
.title-inp:hover { border-color: var(--line); } .title-inp:focus { border-color: var(--accent); }
.props { display: grid; grid-template-columns: 130px 1fr; gap: 8px 12px; align-items: center; margin: 14px 0 20px; }
.props > .k { color: var(--muted); font-size: 13px; }
.props select.inp, .props input.inp { max-width: 280px; }
.comment { display: flex; gap: 10px; margin-bottom: 12px; }
.comment .body { background: var(--bg); padding: 8px 12px; border-radius: 10px; flex: 1; white-space: pre-wrap; }
.section { margin-top: 22px; }
.entry-row { display: flex; gap: 10px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--line-2); font-size: 13px; }

/* modal */
.modal { position: fixed; z-index: 61; top: 8vh; left: 50%; transform: translateX(-50%); width: min(560px, 94vw); background: #fff; border-radius: 14px; box-shadow: 0 20px 60px rgba(0,0,0,.2); max-height: 84vh; display: flex; flex-direction: column; }
.modal-head { padding: 16px 20px; border-bottom: 1px solid var(--line); display: flex; align-items: center; }
.modal-body { padding: 18px 20px; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; }
.modal-foot { padding: 12px 20px; border-top: 1px solid var(--line); display: flex; gap: 8px; justify-content: flex-end; }
.overlay.m { z-index: 60; }

/* toast */
#toast-root { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 99; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast { background: #1e1f24; color: #fff; padding: 10px 16px; border-radius: 10px; box-shadow: var(--shadow); animation: up .2s; }
.toast.err { background: var(--bad); }
@keyframes up { from { transform: translateY(10px); opacity: 0; } }

/* insights */
.insight { display: flex; gap: 12px; padding: 12px 14px; border-radius: 10px; margin-bottom: 8px; border: 1px solid transparent; }
.insight .ic { font-size: 16px; line-height: 1.3; }
.insight .tt { font-weight: 620; margin-bottom: 2px; }
.insight .tx { color: #444852; font-size: 13px; line-height: 1.45; }
.insight.danger { background: var(--bad-soft); border-color: #f8d4d4; } .insight.warning { background: var(--warn-soft); border-color: #fbe3b8; } .insight.info { background: var(--info-soft); border-color: #d2e1fd; } .insight.success { background: var(--ok-soft); }

/* hours heat strip */
.days { display: flex; gap: 3px; flex-wrap: wrap; }
.days.week { flex-wrap: nowrap; }
.days.month { max-width: 500px; }
.day { width: 30px; height: 30px; border-radius: 6px; display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 10px; line-height: 1.05; background: var(--line-2); color: var(--muted); font-variant-numeric: tabular-nums; }
.day b { font-size: 11px; color: var(--text); font-weight: 650; }
.day.ok { background: var(--ok-soft); } .day.undertime { background: var(--bad-soft); } .day.overtime { background: var(--warn-soft); } .day.off { background: #f4f4f6; opacity: .65; } .day.future { background: #fafafa; border: 1px dashed var(--line); }
.day.absence { background: var(--info-soft); }

/* timesheet */
.ts td, .ts th { text-align: center; }
.ts td:first-child, .ts th:first-child { text-align: left; }
.ts .cell { min-width: 56px; }
.ts tfoot td { font-weight: 650; background: #fafafc; }

/* login */
.auth { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: radial-gradient(1200px 600px at 20% 0%, #ecebff, transparent), radial-gradient(900px 500px at 100% 100%, #e4f6f3, transparent), var(--bg); }
.auth-card { width: 380px; background: #fff; border-radius: 16px; padding: 30px; box-shadow: 0 10px 40px rgba(30,31,36,.08); display: flex; flex-direction: column; gap: 14px; }
.auth-card .logo { width: 40px; height: 40px; }
.err-text { color: var(--bad); font-size: 13px; }

/* claude page */
.code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; background: #16171b; color: #e6e6ea; padding: 12px 14px; border-radius: 9px; overflow-x: auto; white-space: pre; position: relative; }
.copy-row { display: flex; gap: 8px; align-items: center; }
.copy-row input { font-family: ui-monospace, Menlo, monospace; font-size: 12.5px; }
.steps { counter-reset: s; display: flex; flex-direction: column; gap: 14px; }
.step { display: flex; gap: 12px; }
.step::before { counter-increment: s; content: counter(s); flex: none; width: 24px; height: 24px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-2); font-weight: 700; display: flex; align-items: center; justify-content: center; font-size: 12px; }
.note { background: var(--warn-soft); border-radius: 8px; padding: 10px 12px; font-size: 13px; color: #6b4304; }

@media (max-width: 800px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; }
  .grid2, .grid3 { grid-template-columns: 1fr; }
}

/* ===================== v2: Asana-like интерфейс ===================== */
:root { --accent: #f06a6a; --accent-2: #e55353; --accent-soft: #fdeeee; --side: #1e1f21; --side-2: #2c2d30; }
.sidebar { width: 240px; }
.brand { min-height: 44px; padding: 4px 10px 14px; }
.brand-logo { max-height: 34px; max-width: 190px; object-fit: contain; filter: brightness(0) invert(1); }
.brand-mark { width: 26px; height: 26px; }
.nav-item .lbl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; min-width: 0; }
.nav-count { background: var(--accent); color: #fff; border-radius: 9px; font-size: 11px; font-weight: 700; padding: 1px 7px; }
.role-lbl { font-size: 11px; color: var(--side-muted); }
.btn.primary { background: var(--accent); border-color: var(--accent); }
.btn.primary:hover { background: var(--accent-2); }
.btn.big { justify-content: center; padding: 10px; }
.bell { position: relative; font-size: 18px; padding: 4px 8px; border-radius: 8px; }
.bell:hover { background: var(--line-2); }
.bell-count { position: absolute; top: -2px; right: -2px; background: var(--accent); color: #fff; font-size: 10px; font-weight: 700; border-radius: 8px; padding: 1px 5px; }
.mob-only { display: none; }
.ellip { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.empty-av { background: transparent !important; border: 1.5px dashed #b8bcc6; color: #9aa0ab !important; }

/* статусы — цветные «пилюли» как в monday/Asana */
.pill { display: inline-block; color: #fff; font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 12px; white-space: nowrap; }
.pill-sel { appearance: none; -webkit-appearance: none; border: 0; color: #fff; font-weight: 600; font-size: 12px; padding: 4px 10px; border-radius: 12px; cursor: pointer; width: 100%; max-width: 175px; text-overflow: ellipsis; }
.pill-sel option { background: #fff; color: var(--text); }
.pill-sel.big { font-size: 13px; padding: 6px 12px; max-width: 280px; }
.pri { font-size: 12px; font-weight: 600; white-space: nowrap; }

/* фильтры */
.filters { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.inp.sm { width: auto; padding: 5px 8px; font-size: 13px; border-radius: 7px; }
.seg.sm button { padding: 3px 10px; font-size: 13px; }
.divider { width: 1px; height: 22px; background: var(--line); margin: 0 4px; }

/* таблица задач */
.ttable { background: #fff; border: 1px solid var(--line); border-radius: 10px; overflow-x: auto; }
.th-row, .t-row, .t-add { display: grid; grid-template-columns: 34px minmax(260px, 1fr) 170px 160px 180px 190px 96px 92px; align-items: center; min-width: 1150px; }
.ttable.my .t-row, .ttable.my .t-add { min-width: 1150px; }
.th-row { font-size: 12px; color: var(--muted); font-weight: 600; border-bottom: 1px solid var(--line); background: #fafafb; position: sticky; top: 0; z-index: 2; }
.th-row > span { padding: 8px 8px; }
.th-row .r, .t-row .r { text-align: right; padding-right: 14px; }
.tgroup { border-bottom: 1px solid var(--line); }
.tgroup:last-child { border-bottom: 0; }
.tg-head { display: flex; align-items: center; gap: 8px; padding: 10px 12px; cursor: pointer; user-select: none; position: sticky; left: 0; }
.tg-head:hover { background: #fafafb; }
.tg-head .cnt { color: var(--muted); font-size: 12px; }
.caret { display: inline-block; transition: transform .15s; color: var(--muted); font-size: 11px; width: 12px; }
.caret.open { transform: rotate(90deg); }
.t-row { border-top: 1px solid var(--line-2); min-height: 40px; }
.t-row:hover { background: #f9f9fb; }
.t-row > span { padding: 4px 8px; min-width: 0; }
.t-row > span:first-child { display: flex; justify-content: center; }
.t-row .t-title { cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.t-row .t-title:hover { color: var(--accent-2); }
.t-row.done .t-title { text-decoration: line-through; color: var(--muted); }
.wk-tag { margin-left: 6px; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; background: var(--accent-soft); color: var(--accent-2); padding: 1px 6px; border-radius: 6px; vertical-align: 1px; }
.cell-as { display: flex; align-items: center; gap: 6px; }
.ghost-sel, .ghost-date { border: 1px solid transparent; background: transparent; border-radius: 6px; padding: 3px 4px; font-size: 13px; max-width: 100%; min-width: 0; cursor: pointer; }
.ghost-sel { flex: 1; text-overflow: ellipsis; }
.ghost-sel:hover, .ghost-date:hover { border-color: var(--line); background: #fff; }
.ghost-date { width: 112px; color: var(--text); }
.cell-due.over .ghost-date { color: var(--bad); font-weight: 600; }
.t-add { border-top: 1px solid var(--line-2); }
.t-add.top { border-top: 0; border-bottom: 1px solid var(--line); }
.add-inp { border: 0; outline: none; padding: 9px 8px; font-size: 13.5px; background: transparent; width: 100%; color: var(--text); grid-column: 2 / -1; }
.add-inp::placeholder { color: #9aa0ab; }
.add-inp:focus { background: #fffdf7; }

/* «Мои задачи» — приветствие */
.hello { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.hello-stats { display: flex; gap: 10px; flex-wrap: wrap; }
.hello-stats > div { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 8px 14px; display: flex; flex-direction: column; }
.hello-stats b { font-size: 17px; }
.hello-stats span { font-size: 12px; color: var(--muted); }

/* доска */
.col { flex: 0 0 272px; }
.tc-proj { font-size: 11.5px; color: var(--muted); display: flex; align-items: center; gap: 5px; margin-bottom: 4px; }
.wt { background: var(--line-2); border-radius: 6px; padding: 1px 6px; font-size: 11px; }

/* календарь */
.cal-head { display: flex; gap: 10px; align-items: center; margin-bottom: 10px; flex-wrap: wrap; }
.cal { display: grid; grid-template-columns: repeat(7, minmax(110px, 1fr)); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--line); gap: 1px; }
.cal-wd { background: #fafafb; padding: 6px 8px; font-size: 12px; color: var(--muted); font-weight: 600; }
.cal-day { background: #fff; min-height: 112px; padding: 4px 5px; cursor: pointer; display: flex; flex-direction: column; gap: 3px; }
.cal-day:hover { background: #fcfcfd; }
.cal-day.other { background: #fafafb; } .cal-day.other .cal-n { color: #c0c4cc; }
.cal-day.wkend { background: #fbfbfc; }
.cal-day.today .cal-n { background: var(--accent); color: #fff; border-radius: 50%; width: 22px; height: 22px; display: flex; align-items: center; justify-content: center; }
.cal-n { font-size: 12px; font-weight: 600; color: var(--muted); }
.cal-chip { font-size: 12px; background: #f4f5f7; border-left: 3px solid; border-radius: 4px; padding: 2px 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-chip:hover { background: #eceef2; }
.cal-chip.done { text-decoration: line-through; color: var(--muted); }

/* план недели */
.week-sum { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.week-sum .bar { flex: 0 0 240px; }
.week-board { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 12px; align-items: flex-start; }
.wcol { flex: 0 0 290px; background: #fff; border: 1px solid var(--line); border-radius: 12px; display: flex; flex-direction: column; max-height: calc(100vh - 250px); }
.wcol.me { border-color: #f6b9b9; box-shadow: 0 0 0 3px #fdeeee; }
.wcol-head { display: flex; gap: 10px; align-items: center; padding: 12px; border-bottom: 1px solid var(--line-2); }
.wcol-body { padding: 6px 8px; overflow-y: auto; flex: 1; }
.witem { display: flex; gap: 8px; align-items: flex-start; padding: 7px 6px; border-radius: 8px; }
.witem:hover { background: #f7f7f9; }
.witem .check { margin-top: 1px; flex: none; }
.witem [data-open] { cursor: pointer; }
.wtitle { font-weight: 500; line-height: 1.35; }
.witem.done .wtitle { text-decoration: line-through; color: var(--muted); }
.wmeta { font-size: 12px; color: var(--muted); margin-top: 2px; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.wcol .add-inp { border-top: 1px solid var(--line-2); padding: 10px 14px; border-radius: 0 0 12px 12px; }

/* входящие */
.inbox { background: #fff; border: 1px solid var(--line); border-radius: 10px; }
.inbox-item { display: flex; gap: 10px; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--line-2); cursor: pointer; }
.inbox-item:last-child { border-bottom: 0; }
.inbox-item:hover { background: #fafafb; }
.inbox-item.unread { background: #fff8f8; }
.ib-ic { font-size: 16px; width: 22px; text-align: center; }
.unread-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); flex: none; }

/* HR */
.access-help { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 14px; }
.access-help > div { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.access-help span { color: var(--muted); line-height: 1.45; }
.role-opt { display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin-top: 6px; cursor: pointer; color: var(--text); font-weight: 400; font-size: 14px; }
.role-opt:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.hours-tbl td, .hours-tbl th { padding: 8px 10px; }
.total-row td { font-weight: 700; background: #fafafb; }
.days.month { max-width: 420px; }
.day { width: 26px; height: 28px; }

/* настройки */
.modal.wide { width: min(680px, 94vw); }
.logo-row { display: flex; gap: 14px; align-items: center; }
.logo-prev { width: 160px; height: 56px; border-radius: 10px; background: var(--side); display: flex; align-items: center; justify-content: center; padding: 8px; }
.logo-prev img { max-width: 100%; max-height: 100%; filter: brightness(0) invert(1); }
.note.ok { background: var(--ok-soft); color: #11632f; }
.proj-icon { width: 30px; height: 30px; border-radius: 8px; flex: none; }
.proj-icon.sm { width: 16px; height: 16px; border-radius: 5px; }
.pcard { display: flex; flex-direction: column; gap: 10px; transition: border-color .15s; }
.pcard:hover { border-color: #c9ccd3; }
.done-btn { background: var(--ok-soft); color: #11632f; border-color: #bfe8cd; }
textarea.title-inp { resize: none; overflow: hidden; font-family: inherit; line-height: 1.3; }
.auth-logo { height: 44px; max-width: 220px; object-fit: contain; align-self: flex-start; }

@media (max-width: 800px) {
  .mob-only { display: inline-block; }
  .layout { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; z-index: 70; transform: translateX(-100%); transition: transform .2s; height: 100vh; }
  .sidebar.open { transform: none; box-shadow: 10px 0 30px rgba(0,0,0,.3); }
  .page { padding: 14px; }
  .search { max-width: none; }
  #newtask { padding: 7px 10px; }
  .access-help { grid-template-columns: 1fr; }
  .timer .t-title { display: none; }
}

.ghost-date:invalid:not(:focus):not(:hover) { color: transparent; }
.filters select.inp.sm { max-width: 200px; }
.t-row .t-title { display: flex; align-items: center; gap: 6px; }
.t-row .t-title .tt-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.t-row .t-title .wk-tag { margin-left: 0; flex: none; }
.day.today { background: #fff; border: 1.5px solid var(--accent); }

.auth-logo { height: auto; width: 150px; max-height: 110px; margin-bottom: 6px; }
.brand-logo { max-height: 22px; }
.auth { background: #f4f4f5; }

.due-pair { display: flex; gap: 6px; }
.due-pair input[type=time] { max-width: 120px; }
.time-tag { font-size: 12px; font-weight: 600; background: #eef2ff; color: #3b5bdb; border-radius: 6px; padding: 1px 6px; margin-left: 4px; white-space: nowrap; }
.cell-due { display: flex; align-items: center; }
.parts { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.part-chip { display: inline-flex; align-items: center; gap: 5px; background: var(--line-2); border-radius: 14px; padding: 2px 4px 2px 3px; font-size: 13px; }
.part-chip button { border: 0; background: none; cursor: pointer; color: var(--muted); font-size: 15px; padding: 0 4px; }
.part-chip .avatar { width: 20px; height: 20px; font-size: 9px; }
.part-pick { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.part-opt { display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--line); border-radius: 16px; padding: 3px 10px 3px 6px; cursor: pointer; color: var(--text); font-weight: 400; font-size: 13px; }
.part-opt:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.part-opt input { margin: 0; }
.part-opt .avatar { width: 20px; height: 20px; font-size: 9px; }

/* ===================== v3: план недели компактно ===================== */
.week-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.week-head h1 { font-size: 20px; }
.week-nav { display: flex; align-items: center; gap: 6px; margin-left: 6px; }
.week-progress { display: flex; align-items: center; gap: 8px; }
.week-progress .bar { width: 120px; }
.insight.slim { padding: 8px 12px; margin-bottom: 10px; align-items: center; }
.insight.slim .tx { font-size: 12.5px; }
.week-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(255px, 1fr)); gap: 10px; align-items: start; }
.wcard { background: #fff; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.wcard.me { border-color: #f6b9b9; box-shadow: 0 0 0 2px #fdeeee; }
.wcard-head { display: flex; align-items: center; gap: 8px; padding: 8px 10px; background: #fafafb; border-bottom: 1px solid var(--line-2); font-size: 13.5px; }
.wcard-head .avatar { width: 22px; height: 22px; font-size: 10px; }
.wcard .witem { padding: 5px 10px; border-radius: 0; gap: 8px; }
.wcard .wtitle { font-size: 13.5px; }
.wcard .wmeta { font-size: 11.5px; margin-top: 1px; }
.wcard .wempty { padding: 6px 10px; }
.wcard .add-inp { border-top: 1px solid var(--line-2); padding: 7px 10px; font-size: 13px; }
.wcard .check { width: 16px; height: 16px; font-size: 10px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; }
.profile-head { display: flex; gap: 12px; align-items: center; }
.bottom-nav, .fab { display: none; }

/* ===================== v3: мобильная версия ===================== */
@media (max-width: 800px) {
  html { -webkit-text-size-adjust: 100%; }
  body { font-size: 15px; }
  .inp, input, select, textarea { font-size: 16px !important; } /* без автозума на iPhone */
  .topbar { height: 52px; padding: 0 10px; gap: 8px; }
  #newtask { display: none; }
  .bell { padding: 4px; }
  .page { padding: 12px 12px 90px; }
  h1 { font-size: 19px; }
  .page-head { gap: 8px; margin-bottom: 12px; }
  .page-head .sub { font-size: 12.5px; }
  .kpis { grid-template-columns: 1fr 1fr; gap: 8px; }
  .kpi { padding: 10px 12px; }
  .kpi .v { font-size: 19px; }
  .hide-sm { display: none !important; }

  /* нижняя панель как в приложении */
  .bottom-nav { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; background: #fff; border-top: 1px solid var(--line); padding: 4px 4px calc(4px + env(safe-area-inset-bottom)); }
  .bottom-nav a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 1px; font-size: 11px; color: var(--muted); padding: 4px 0; position: relative; }
  .bottom-nav a .bi { font-size: 19px; line-height: 1.1; }
  .bottom-nav a.on { color: var(--accent-2); font-weight: 600; }
  .bdot { position: absolute; top: 3px; right: calc(50% - 16px); width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
  .fab { display: flex; position: fixed; right: 16px; bottom: calc(70px + env(safe-area-inset-bottom)); z-index: 41; width: 54px; height: 54px; border-radius: 50%; border: 0; background: var(--accent); color: #fff; font-size: 30px; line-height: 1; align-items: center; justify-content: center; box-shadow: 0 6px 18px rgba(240,106,106,.45); }
  .sidebar { width: 82vw; max-width: 300px; padding-bottom: 80px; }

  /* фильтры — в одну прокручиваемую строку */
  .filters { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; -webkit-overflow-scrolling: touch; }
  .filters > * { flex: none; }
  .filters #fq { width: 150px !important; }
  .seg button { padding: 5px 9px; }

  /* таблица задач превращается в карточки */
  .ttable { overflow: visible; border-radius: 10px; }
  .th-row { display: none; }
  .t-row, .t-add, .ttable.my .t-row, .ttable.my .t-add { min-width: 0; }
  .t-row { grid-template-columns: 34px 1fr auto; grid-template-areas: "ck ti ti" "ck as du" "ck st st"; row-gap: 2px; padding: 8px 6px 8px 0; }
  .t-row > span { padding: 1px 4px; }
  .c-ck { grid-area: ck; align-self: start; padding-top: 4px !important; }
  .c-ti { grid-area: ti; white-space: normal !important; }
  .t-row .t-title .tt-text { white-space: normal; }
  .c-as { grid-area: as; font-size: 13px; }
  .c-du { grid-area: du; justify-self: end; }
  .c-st { grid-area: st; }
  .c-st .pill-sel { max-width: 100%; width: auto; }
  .c-pr, .c-pi, .c-tm { display: none !important; }
  .t-add { grid-template-columns: 34px 1fr; }
  .tg-head { padding: 9px 10px; }
  .ghost-date { width: 118px; }
  .hello { margin-bottom: 12px; }
  .hello-stats > div { padding: 6px 10px; }
  .hello-stats b { font-size: 15px; }

  /* карточка задачи и окна — на весь экран */
  .drawer { width: 100vw; }
  .drawer-head { flex-wrap: wrap; padding: 10px 12px; }
  .drawer-body { padding: 14px; }
  .props { grid-template-columns: 1fr; gap: 4px; }
  .props > .k { margin-top: 8px; font-size: 12px; }
  .props select.inp, .props input.inp { max-width: none; }
  .modal, .modal.wide { top: auto; bottom: 0; left: 0; transform: none; width: 100vw; max-height: 92vh; border-radius: 16px 16px 0 0; }
  .modal-body { padding: 14px; }
  .grid2, .grid3 { grid-template-columns: 1fr; }

  /* доска, календарь, неделя */
  .col { flex: 0 0 82vw; max-height: none; }
  .cal { grid-template-columns: repeat(7, minmax(0, 1fr)); }
  .cal-day { min-height: 64px; padding: 2px; }
  .cal-chip { font-size: 10px; padding: 1px 3px; }
  .cal-head span.muted { display: none; }
  .week-grid { grid-template-columns: 1fr; }
  .week-head h1 { font-size: 18px; }
  .week-progress .bar { width: 70px; }
  .week-nav { margin-left: 0; }

  /* таблицы отчётов — горизонтальная прокрутка */
  .tbl-wrap { -webkit-overflow-scrolling: touch; }
  .tbl th, .tbl td { padding: 8px; }
  .hours-tbl td:last-child .days { min-width: 200px; }
  .two-col { gap: 10px; }
  .access-help { grid-template-columns: 1fr; }
  .auth-card { width: calc(100vw - 32px); padding: 22px; }
  #toast-root { bottom: 84px; }
  .timer { padding: 4px 4px 4px 10px; }
}
