:root{--fg:#cbd5e1;--bg:#0b1220;--muted:#94a3b8;--brand:#60a5fa;--border-color:#1f2937;--panel:#0f172a;--nav:#0c1322}
*{box-sizing:border-box}
body{margin:0;font-family:system-ui,-apple-system,Segoe UI,Roboto,Ubuntu,Cantarell,Noto Sans,sans-serif;color:var(--fg);background:var(--bg);font-size:15px;line-height:1.4}
.container{width:100%;max-width:1080px;margin:0 auto;padding:14px 14px 96px}
.nb-header{background:#0f172a;border-bottom:1px solid var(--border-color);position:sticky;top:0;z-index:40}
.nb-header .container{display:flex;justify-content:space-between;align-items:center;gap:10px;flex-wrap:wrap}
.brand{font-weight:600;text-decoration:none;color:var(--brand);display:inline-flex;align-items:center;gap:8px;padding:10px 0}
.header-actions{display:flex;gap:8px;align-items:center}
.inline-form{display:flex;gap:8px;align-items:center;flex-wrap:wrap}
input,button,select{padding:9px 11px;border:1px solid #1f2937;border-radius:10px;background:#0b1220;color:var(--fg)}
button{background:#111827;color:#fff;cursor:pointer;transition:transform .15s ease,box-shadow .15s ease}
button:active{transform:translateY(1px)}
.muted{color:var(--muted)}
.card{border:1px solid #1f2937;border-radius:12px;padding:12px;margin:8px 0;background:var(--panel)}
.tree{margin-top:12px}
.tree ul{list-style:none;margin:0;padding-left:18px}
.tree .node{display:flex;gap:6px;align-items:center;margin:4px 0}
.tree .toggle{width:22px;height:22px;border:1px solid #334155;border-radius:4px;background:#0b1220;color:#cbd5e1;cursor:pointer;line-height:18px}
.tree .toggle.placeholder{visibility:hidden}
.children.collapsed{display:none}

.reports-panel{border:1px solid #1f2937;border-radius:14px;padding:12px;margin-top:12px;background:var(--panel);display:flex;flex-direction:column;gap:10px}
.reports-header{display:flex;flex-direction:column;gap:10px}
.reports-employee{font-weight:700;font-size:17px;color:#e2e8f0}
.reports-types{font-size:13px}
.reports-body{display:grid;grid-template-columns:1fr;gap:12px;min-height:220px}
.reports-list{display:flex;flex-direction:column;gap:8px;overflow-y:auto;max-height:360px}
.reports-list.compact .report-item{padding:8px}
.report-item{border:1px solid #1f2937;border-radius:10px;padding:12px;background:#0b1220;cursor:pointer;transition:border-color 0.2s, background 0.2s}
.report-item.active{border-color:#60a5fa;background:#0f172a}
.report-meta{display:flex;justify-content:space-between;align-items:center;margin-bottom:4px;font-size:12px}
.badge{display:inline-block;padding:4px 8px;border-radius:12px;background:#1d4ed8;color:#e2e8f0;font-size:12px}
.badge-missing{background:#4b5563}
.report-title{font-weight:600;font-size:15px;color:#e2e8f0}
.report-viewer{border:1px solid #1f2937;border-radius:10px;padding:12px;background:#0b1220;overflow-y:auto;max-height:380px}
.report-markdown{color:#e2e8f0;line-height:1.45}
.report-markdown h1,.report-markdown h2,.report-markdown h3{color:#f8fafc;margin-top:12px}
.report-markdown pre{background:#0f172a;padding:10px;border-radius:6px;overflow:auto}
.report-markdown code{background:#0f172a;padding:2px 4px;border-radius:4px}
.report-markdown a{color:#60a5fa}
.report-markdown ul{padding-left:18px}

/* Error styles */
.error-block{border:1px solid #fecaca;background:#fef2f2;border-radius:8px;padding:12px;margin-top:12px}
.error-detail,.error-trace{white-space:pre-wrap;word-break:break-word;background:#fff1f2;border:1px solid #fecaca;border-radius:6px;padding:10px;color:#991b1b}

/* Graph container */
.cy-root{height:60vh;border:1px solid #1f2937;border-radius:14px;background:linear-gradient(180deg,#0b1220,#0f172a);position:relative;box-shadow:0 10px 30px rgba(0,0,0,.25)}
.node-status-layer{position:absolute;inset:0;pointer-events:none}
.node-status{position:absolute;display:flex;gap:8px;align-items:center;transform:translate(-50%,-80%)}
.node-dot{width:16px;height:16px;border-radius:50%;border:1px solid #0b1220;display:inline-flex;align-items:center;justify-content:center;box-shadow:0 0 0 1px #0b1220}
.node-dot .cross{font-size:14px;line-height:1;color:#d1d5db}
.node-dot.done .cross{display:none}
.node-dot.missing .cross{display:block}
.node-dot.morning{background:#60a5fa}
.node-dot.evening{background:#ef4444}
.org-title{margin:6px 0 12px;font-size:22px;color:#e2e8f0}
.info-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(280px,1fr));gap:12px;margin-top:12px}
.info-card{border:1px solid #1f2937;border-radius:12px;padding:12px;background:#0f172a;display:flex;flex-direction:column;gap:8px;min-height:160px}
.info-card__header{display:flex;justify-content:space-between;align-items:flex-start;gap:12px}
.info-card__title{font-weight:600;font-size:16px;color:#e2e8f0}
.info-list{margin:0;padding-left:18px;color:#cbd5e1;line-height:1.5}
.info-list li{margin-bottom:6px}
.ghost-btn{background:transparent;border:1px solid #334155;color:#e2e8f0;padding:6px 10px;border-radius:8px;cursor:pointer}
.ghost-btn:hover{border-color:#60a5fa;color:#60a5fa}
.subtle-btn{opacity:0.8}
.subtle-btn:hover{opacity:1}
.org-mini{border:1px dashed #1f2937;border-radius:10px;padding:10px;color:#cbd5e1;background:#0b1220}
.org-mini__root{font-weight:700;margin-bottom:6px}
.org-mini__branch div{margin-bottom:4px}
#faqContent{margin-top:16px;padding:0;background:transparent;border:none;box-shadow:none;color:#e2e8f0}
#faqContent a{color:#60a5fa}
#faqContent .wrap{max-width:100%;margin:0;padding:0}
#faqContent .hero,#faqContent nav.toc,#faqContent section.card{background:#0f172a;border:1px solid #1f2937;border-radius:12px;box-shadow:none;margin:12px 0;padding:12px}
#faqContent .hero h2,#faqContent section.card h2{color:#e2e8f0}
#faqContent .muted{color:#94a3b8}
#faqContent nav.toc h3{color:#94a3b8}
#faqContent .toc-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:8px}
#faqContent .toc-item{color:#e2e8f0;background:#0b1220;border:1px solid #1f2937;border-radius:10px;padding:10px 12px}
#faqContent .toc-item .i{background:#111827;border-radius:8px}
#faqContent details{border:1px solid #1f2937;border-radius:10px;background:#0f172a;overflow:hidden}
#faqContent summary{color:#e2e8f0;padding:12px 14px;cursor:pointer}
#faqContent details .content{color:#cbd5e1;padding:0 14px 14px 14px}
#faqContent code.cmd{background:#111827;border:1px solid #1f2937;color:#e2e8f0}
#faqContent table{border:1px solid #1f2937}
#faqContent thead th{background:#111827}
#faqContent th,#faqContent td{border-bottom:1px solid #1f2937}
#faqContent th:nth-child(2),#faqContent th:nth-child(3),#faqContent td:nth-child(2),#faqContent td:nth-child(3){text-align:center}
#faqContent .topbtn{display:none}
#faqContent ul{color:#cbd5e1}
.messages-panel{border:1px solid #1f2937;border-radius:12px;padding:12px;background:#0f172a;margin-top:12px}
.message-item{border:1px solid #1f2937;border-radius:8px;padding:10px;background:#0b1220;margin-bottom:8px}
.message-meta{display:flex;justify-content:space-between;align-items:center;margin-bottom:6px;font-size:12px;color:#94a3b8}
.message-text{color:#e2e8f0;white-space:pre-wrap;word-break:break-word}
.messages-people{display:flex;flex-direction:column;gap:10px;margin-top:12px}
.message-card{border:1px solid #1f2937;border-radius:12px;background:#0f172a;overflow:hidden}
.message-card__header{width:100%;text-align:left;border:0;background:transparent;color:#e2e8f0;padding:12px 14px;display:flex;justify-content:space-between;align-items:center;cursor:pointer}
.message-card__header:hover{background:#111827}
.message-card__body{padding:0 12px 12px 12px;display:none}
.message-card__body.open{display:block}
.message-card__status{margin:8px 0}
.messages-list{display:flex;flex-direction:column}
.message-controls{display:flex;gap:8px;align-items:center;margin-top:8px}
.message-controls select,.message-controls button{padding:8px 10px;border:1px solid #1f2937;border-radius:8px;background:#0f172a;color:#e2e8f0}
.message-controls button{cursor:pointer;border-color:#334155}
.pane[data-pane="info"]{background:#0b1220;color:#e2e8f0}
.pane[data-pane="info"] .card{background:#0f172a;border-color:#1f2937;color:#e2e8f0}
.pane[data-pane="info"] p,.pane[data-pane="info"] h1,.pane[data-pane="info"] h2,.pane[data-pane="info"] h3,.pane[data-pane="info"] h4,.pane[data-pane="info"] h5,.pane[data-pane="info"] h6{color:#e2e8f0}
.pane[data-pane="info"] .muted{color:#94a3b8}
.pane[data-pane="info"] code{background:#111827;border:1px solid #1f2937;color:#e2e8f0}

.pane{display:none}
.pane.active{display:block}
.bottom-nav{position:fixed;bottom:0;left:0;right:0;background:rgba(12,19,34,.98);border-top:1px solid #1f2937;display:flex;gap:6px;padding:10px 12px calc(12px + env(safe-area-inset-bottom,0));z-index:30;backdrop-filter:blur(12px);box-shadow:0 -10px 35px rgba(0,0,0,.35)}
.nav-btn{background:none;border:none;color:#cbd5e1;display:flex;flex-direction:column;align-items:center;gap:6px;font-size:13px;cursor:pointer;flex:1;padding:8px 4px;border-radius:12px;transition:background .2s ease,color .2s ease}
.nav-btn .nav-icon{width:34px;height:34px;border-radius:12px;display:grid;place-items:center;background:rgba(255,255,255,0.03);color:#cbd5e1}
.nav-btn .nav-icon svg{width:22px;height:22px}
.nav-btn .nav-label{font-size:12px;font-weight:600;letter-spacing:0.01em}
.nav-btn.active{color:#60a5fa;background:rgba(96,165,250,0.08);box-shadow:0 10px 30px rgba(0,0,0,.25)}
.nav-btn.active .nav-icon{background:rgba(96,165,250,0.12);color:#60a5fa}
.container{padding-bottom:96px}

/* Reports history */
.reports-grid{display:grid;grid-template-columns:1fr;gap:10px;margin-top:10px}
.reports-grid__controls{display:flex;gap:8px;flex-wrap:wrap}
.reports-grid__controls select{flex:1 1 220px;min-width:0}
.reports-grid__controls button{flex:0 0 auto}
.reports-history{border:1px solid #1f2937;border-radius:14px;background:#0f172a;padding:12px;display:grid;gap:10px}
.reports-history__body{display:grid;grid-template-columns:1fr;gap:10px}
.reports-history__list{display:flex;flex-direction:column;gap:10px}
.reports-history__viewer{border:1px solid #1f2937;border-radius:12px;padding:12px;background:#0b1220;min-height:140px}
.reports-history__hint{color:#94a3b8;font-size:13px}

/* Chat page */
.chat-page h1{margin:6px 0 8px}
.chat-shell{border:1px solid #1f2937;border-radius:14px;background:#0f172a;box-shadow:0 10px 30px rgba(0,0,0,.25);padding:12px;display:flex;flex-direction:column;gap:10px;min-height:420px}
.chat-header{display:flex;justify-content:space-between;align-items:center;gap:10px;flex-wrap:wrap}
.chat-status{display:flex;align-items:center;gap:8px}
.status-dot{width:12px;height:12px;border-radius:50%;background:#475569;display:inline-block;box-shadow:0 0 0 1px #1f2937}
.status-dot.ok{background:#10b981}
.status-dot.err{background:#ef4444}
.status-dot.pending{background:#f59e0b}
.chat-meta{display:flex;align-items:center;gap:10px}
.chat-log{flex:1;min-height:260px;max-height:520px;overflow-y:auto;border:1px solid #1f2937;border-radius:12px;padding:10px;background:#0b1220;display:flex;flex-direction:column;gap:10px}
.chat-bubble{padding:10px;border-radius:12px;border:1px solid #1f2937;max-width:92%}
.chat-bubble__meta{font-size:12px;margin-bottom:4px;color:#94a3b8}
.chat-bubble__body{white-space:pre-wrap;word-break:break-word}
.chat-bubble.user{background:#0f172a;border-color:#2563eb}
.chat-bubble.agent{background:#111827;border-color:#334155}
.chat-bubble.system{background:#0b1220;border-style:dashed}
.chat-composer{display:grid;grid-template-columns:1fr 140px;gap:8px;align-items:flex-end}
.chat-composer textarea{width:100%;border-radius:10px;border:1px solid #1f2937;background:#0b1220;color:#e2e8f0;min-height:56px;padding:10px;resize:vertical}
.chat-composer button{height:100%;border-radius:12px;background:#2563eb;border:1px solid #1d4ed8;color:#f8fafc;font-weight:600}
.chat-link-card{margin-top:14px;padding:12px;border:1px dashed #1f2937;border-radius:12px;background:#0f172a}
.chat-tips ul{margin:8px 0 0 18px;padding:0}
.hidden{display:none !important}
.small{font-size:12px;line-height:1.4}
.confirmation-panel{border:1px solid #1f2937;border-radius:12px;background:linear-gradient(180deg,#0b1220,#0f172a);padding:10px;display:flex;flex-direction:column;gap:10px}
.confirmation-header{display:flex;justify-content:space-between;align-items:flex-start;gap:10px;flex-wrap:wrap}
.confirmation-kind{font-weight:700;color:#e2e8f0}
.confirmation-header__meta{display:flex;align-items:center;gap:10px;flex-wrap:wrap;justify-content:flex-end}
.confirmation-content{display:grid;grid-template-columns:1.4fr 1fr;gap:10px;align-items:stretch}
.confirmation-text textarea{width:100%;border-radius:10px;border:1px solid #1f2937;background:#0b1220;color:#e2e8f0;min-height:96px;padding:10px;resize:vertical}
.confirmation-meta{border:1px dashed #1f2937;border-radius:10px;padding:10px;background:#0b1220;display:flex;flex-direction:column;gap:6px}
.confirmation-row{display:flex;justify-content:space-between;gap:8px;font-size:13px}
.confirmation-row span:last-child{text-align:right;color:#e2e8f0}
.confirmation-actions{display:flex;justify-content:flex-end;gap:10px;align-items:center}
.confirmation-error{color:#fca5a5;font-size:13px}
.confirmation-status{color:#cbd5e1;font-size:13px}
.primary-btn{background:#2563eb;border:1px solid #1d4ed8;color:#f8fafc;font-weight:600}
.danger-btn{border:1px solid #b91c1c;color:#fca5a5;background:#111827}
.danger-btn:hover{border-color:#ef4444;color:#fecaca}
.confirmation-panel textarea:focus{outline:1px solid #2563eb}

@media (min-width: 720px){
  .reports-header{flex-direction:row;align-items:flex-start;justify-content:space-between}
  .reports-body{grid-template-columns:260px 1fr}
  .reports-panel{padding:14px}
  .reports-history__body{grid-template-columns:280px 1fr}
  .tasks-columns{grid-template-columns:1fr 1fr}
}

@media (min-width: 960px){
  body{font-size:16px}
  .cy-root{height:68vh}
  .container{padding:18px 18px 110px}
  .nav-btn .nav-icon{width:38px;height:38px}
  .nav-btn .nav-icon svg{width:24px;height:24px}
}

@media (max-width: 720px){
  .confirmation-content{grid-template-columns:1fr}
.confirmation-row{flex-direction:column;align-items:flex-start}
}

/* Telegram-inspired list */
.tg-shell{border:0;border-radius:0;background:radial-gradient(circle at 12% 20%,rgba(96,165,250,.12),transparent 32%),radial-gradient(circle at 82% 24%,rgba(34,197,235,.1),transparent 26%),linear-gradient(180deg,#0b1220 0%,#0f172a 100%);padding:16px;margin:-8px -12px 8px -12px;box-shadow:none}
.tg-shell__header{display:flex;justify-content:space-between;gap:12px;flex-wrap:wrap;align-items:flex-start;padding-bottom:6px}
.tg-shell__actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.eyebrow{text-transform:uppercase;font-size:12px;letter-spacing:0.08em;color:#94a3b8;margin-bottom:4px}
.tg-legend{display:flex;gap:8px;align-items:center;flex-wrap:wrap}
.pill{display:inline-flex;align-items:center;gap:6px;padding:6px 10px;border-radius:999px;font-size:13px;border:1px solid #334155;background:#0b1220;color:#e2e8f0}
.pill.done{border-color:#2563eb;color:#cfe4ff;background:rgba(37,99,235,0.12)}
.pill.done.evening{border-color:#14b8a6;background:rgba(20,184,166,0.12)}
.pill.missing{border-color:#475569;color:#cbd5e1;background:rgba(71,85,105,0.14)}
.tg-list{display:flex;flex-direction:column;gap:0;margin-top:8px}
.tg-card{width:100%;text-align:left;border:0;border-bottom:1px solid #1f2937;border-radius:0;background:transparent;color:#e2e8f0;padding:10px 0;cursor:pointer;transition:border-color .15s ease,background .15s ease}
.tg-card:last-child{border-bottom:0}
.tg-card:hover{background:rgba(96,165,250,0.04)}
.tg-card.open{border-color:#334155;background:rgba(96,165,250,0.06)}
.tg-card__main{display:flex;gap:12px;align-items:center}
.tg-avatar{width:46px;height:46px;border-radius:50%;background:linear-gradient(135deg,#1d4ed8,#0ea5e9);display:grid;place-items:center;font-weight:700;color:#f8fafc;box-shadow:0 8px 18px rgba(0,0,0,.3);flex-shrink:0}
.tg-card__body{flex:1;display:flex;flex-direction:column;gap:6px;min-width:0}
.tg-card__row{display:flex;justify-content:space-between;gap:8px;align-items:center}
.tg-card__title{font-weight:700;font-size:16px;color:#e2e8f0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.tg-card__id{font-size:12px}
.tg-card__badges{display:flex;gap:8px;flex-wrap:wrap}
.tg-card__loader{font-size:12px;min-height:16px}
.tg-card__details{display:none;padding:10px 0 4px 58px}
.tg-card.open .tg-card__details{display:block}
.tg-report{border:1px solid #1f2937;border-radius:12px;background:#0b1220;margin-bottom:8px;padding:10px}
.tg-report__header{display:flex;justify-content:space-between;gap:10px;align-items:center;font-weight:600;color:#e2e8f0}
.tg-report__body{margin-top:6px;color:#cbd5e1;line-height:1.5;word-break:break-word}
.faq-panel{border:1px solid #1f2937;border-radius:18px;background:#0f172a;padding:14px;margin-top:16px}
.faq-header{display:flex;justify-content:space-between;align-items:center;gap:10px;flex-wrap:wrap}

/* Tasks page */
.tasks-page{display:flex;flex-direction:column;gap:10px}
.tasks-hero{display:flex;justify-content:space-between;gap:10px;align-items:center;flex-wrap:wrap;padding:6px 0;border:0;background:none;box-shadow:none}
.tasks-hero__actions{display:flex;gap:8px;align-items:center}
.tasks-controls{display:grid;grid-template-columns:1fr auto;gap:8px;align-items:end;border:0;border-radius:10px;padding:0;background:transparent}
.tasks-controls.compact{grid-template-columns:1fr auto}
.tasks-controls .control{display:flex;flex-direction:column;gap:6px}
.tasks-controls label{font-size:13px;color:#cbd5e1}
.tasks-controls input,.tasks-controls select{width:100%}
.tasks-status{min-height:0;margin:0}
.tasks-status:empty{display:none}
.pill-group button{background:#0b1220;border:1px solid #1f2937;color:#cbd5e1;padding:8px 12px;border-radius:10px;cursor:pointer}
.pill-group button.active{border-color:#60a5fa;color:#e5edff;background:rgba(96,165,250,0.12)}
.tasks-tabs{display:flex;gap:6px}
.tasks-tab{flex:1;border:1px solid #1f2937;background:transparent;color:#cbd5e1;padding:10px;border-radius:10px;cursor:pointer;display:flex;justify-content:center;gap:6px;font-weight:700}
.tasks-tab.active{border-color:#60a5fa;color:#e5edff;background:rgba(96,165,250,0.08);box-shadow:none}
.tasks-tab__count{font-weight:600}
.tasks-divider{border:0;border-bottom:1px solid #1f2937;margin:2px 0 4px}
.tasks-single-column{border:0;border-radius:0;background:transparent;padding:0;display:flex;flex-direction:column;gap:4px}
.tasks-column__header{display:flex;justify-content:space-between;align-items:center;font-weight:700;color:#e2e8f0;padding:0 0 4px}
.tasks-heading{font-size:20px;line-height:1.3}
.task-cards{display:flex;flex-direction:column;gap:0}
.task-card{border:0;border-bottom:1px solid #1f2937;border-radius:0;padding:10px 0;background:transparent;box-shadow:none}
.task-card__top{display:flex;justify-content:space-between;gap:8px;align-items:center}
.task-card__title{font-weight:700;color:#e2e8f0;overflow:hidden;text-overflow:ellipsis}
.task-card__badges{display:flex;gap:6px;flex-wrap:wrap}
.task-badge{padding:4px 8px;border-radius:10px;font-size:12px;border:1px solid #334155;color:#e2e8f0}
.task-badge.planned{border-color:#2563eb;color:#dbeafe}
.task-badge.done{border-color:#16a34a;color:#bbf7d0}
.task-badge.closed{border-color:#a855f7;color:#f3e8ff}
.task-badge.pending{border-color:#f59e0b;color:#fde68a}
.task-badge.cancelled{border-color:#ef4444;color:#fecaca}
.task-card__meta{display:flex;justify-content:space-between;gap:8px;flex-wrap:wrap;font-size:13px}
.task-card__desc{margin:6px 0;color:#cbd5e1}
.task-card__people{display:flex;gap:10px;flex-wrap:wrap;margin:6px 0 2px}
.task-persona{display:flex;align-items:center;gap:8px;padding:6px 8px;border:1px solid #1f2937;border-radius:10px;background:#0b1220}
.task-persona__avatar{width:32px;height:32px;border-radius:50%;display:grid;place-items:center;font-weight:700;color:#0b1220;background:#60a5fa}
.task-persona__text{display:flex;flex-direction:column;line-height:1.2}
.task-persona__label{font-size:11px;color:#94a3b8;text-transform:uppercase;letter-spacing:0.04em}
.task-persona__name{font-size:13px;color:#e2e8f0;font-weight:600}
.task-deadline.overdue{color:#fca5a5;font-weight:700}
