/* Shared workspace surfaces. History/calendar foundations are reused from MKподъём. */
:root{--bg:#e7edf6;--surface:#fff;--line:#c9d3e2;--panel:#fff;--text:#0f172a;--muted:#556579;--accent:#2563eb;--blue:#2563eb;--danger:#b42318}
.hub-panel{background:#fff;border:1px solid var(--line);border-radius:10px;min-width:0;padding:16px}
.hub-panel h2,.hub-dialog h2{font-size:18px;margin:0}.hub-panel p{color:var(--muted)}
.hub-panel-head,.hub-panel-foot,.hub-result,.hub-pagination,.hub-actions{display:flex;align-items:center;gap:12px;flex-wrap:wrap}
.hub-panel-head{justify-content:space-between;margin-bottom:12px}.hub-panel-foot{border-top:1px solid var(--line);padding-top:14px;margin-top:8px}
.hub-actions svg,.hub-search svg,.hub-folder-list svg,.hub-file-name svg,.hub-empty svg,.hub-dialog svg,.history-screen svg{width:18px;height:18px;flex-shrink:0}
.hub-actions .btn{display:inline-flex;align-items:center;gap:7px}
/* One surface for documents registry (no floating islands) */
.hub-documents.hub-shell,.hub-documents{display:flex;flex-direction:column;gap:0;min-width:0;background:var(--surface);border:1px solid var(--line);border-radius:var(--r,12px);overflow:hidden;box-shadow:none}
.hub-doc-toolbar{display:flex;align-items:center;gap:8px 12px;flex-wrap:wrap;padding:10px 12px;margin:0;border:0;border-bottom:1px solid var(--line);border-radius:0;background:var(--surface);box-shadow:none}
.hub-doc-filters{display:flex;align-items:center;gap:8px;flex:1 1 280px;min-width:0;flex-wrap:wrap;margin:0}
.hub-doc-toolbar .hub-search{flex:1 1 220px;max-width:420px;min-width:160px;margin:0}
.hub-doc-toolbar select{box-sizing:border-box;flex:0 1 160px;width:auto;max-width:200px;min-width:120px;height:var(--control-h,36px);min-height:var(--control-h,36px);border:1px solid var(--line);border-radius:var(--control-r,9px);padding:0 30px 0 10px;background-color:var(--surface);color:var(--text);font:inherit;font-size:13px;line-height:1;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.hub-doc-toolbar select[name="scope"]{flex-basis:240px;max-width:280px}
.hub-doc-toolbar select option{white-space:normal}
.hub-doc-toolbar .list-count{margin:0}
.hub-doc-toolbar .toolbar-actions,.hub-doc-toolbar .hub-actions{margin-left:auto;display:flex;flex-wrap:wrap;align-items:center;gap:8px}
.hub-doc-toolbar .btn,.hub-doc-toolbar .btn.primary{box-sizing:border-box;min-height:var(--control-h,36px);height:var(--control-h,36px);padding:0 12px;border-radius:var(--control-r,9px);font-size:13px;align-self:center}
.hub-doc-toolbar .icon-btn{width:var(--control-h,36px);min-width:var(--control-h,36px);height:var(--control-h,36px);border:1px solid var(--line);border-radius:var(--control-r,9px);background:var(--surface)}
.hub-dialog label,.hub-profile label{display:flex;flex-direction:column;gap:6px;font-size:12px;font-weight:600;color:var(--muted)}
.hub-dialog input,.hub-dialog select,.hub-profile input,.hub-result select{height:var(--control-h,36px);width:100%;min-width:0;border:1px solid var(--line);border-radius:var(--control-r,9px);padding:7px 10px;background:var(--surface);color:var(--text);font:inherit;font-size:13px}
.hub-dialog textarea{width:100%;min-width:0;min-height:100px;resize:vertical;border:1px solid var(--line);border-radius:var(--control-r);padding:9px 10px;background:var(--surface);color:var(--text);font:13px/1.5 var(--font)}
.hub-doc-layout{display:grid;grid-template-columns:200px minmax(0,1fr);gap:0;align-items:stretch;min-height:0}
.hub-folder-list{background:var(--surface-2,#f3f6fb);border:0;border-right:1px solid var(--line);border-radius:0;padding:8px;display:flex;flex-direction:column;gap:2px;min-height:0}
.hub-folder-list button{display:flex;align-items:center;gap:8px;border:0;background:transparent;text-align:left;padding:8px 10px;border-radius:var(--control-r,9px);color:var(--muted);min-height:36px;cursor:pointer;font:inherit;font-size:13px}
.hub-folder-list button:hover,.hub-folder-list button.active{background:var(--blue-soft,#eef3ff);color:var(--blue)}
.hub-folder-list span{flex:1;min-width:0;overflow-wrap:anywhere;font-weight:550}.hub-folder-list small{display:block;font-size:11px;font-weight:400;color:var(--muted);margin-top:2px}.hub-folder-list b{font-size:11px;font-weight:600;color:var(--muted)}
.hub-file-list{padding:0;overflow:hidden;background:var(--surface);border:0;border-radius:0;min-width:0}
.hub-tabs{display:flex;gap:2px;border-bottom:1px solid var(--line);padding:0 10px;overflow-x:auto}
.hub-tabs button{display:flex;gap:6px;align-items:center;white-space:nowrap;border:0;border-bottom:2px solid transparent;border-radius:0;background:none;padding:10px 10px;color:var(--muted);font:inherit;font-size:13px;font-weight:600;cursor:pointer}
.hub-tabs button.active{color:var(--blue);border-bottom-color:var(--blue)}.hub-tabs span{background:var(--surface-2,#f3f6fb);color:var(--muted);padding:1px 6px;border-radius:5px;font-size:11px;font-weight:600}
.hub-result{display:flex;align-items:center;gap:10px;flex-wrap:wrap;padding:8px 14px;color:var(--muted);font-size:12px;border-bottom:1px solid var(--line)}
.hub-result .hub-sort{display:inline-flex;gap:6px;align-items:center;margin-left:auto;font-weight:550}
.hub-result select{width:auto;height:30px;min-height:30px;padding:0 8px;font-size:12px}
.hub-result .hub-reset{color:var(--blue);text-decoration:none;font-weight:550}.hub-result .hub-reset:hover{text-decoration:underline}
.hub-table-scroll{max-width:100%;overflow-x:hidden}.hub-table{width:100%;border-collapse:collapse;table-layout:fixed;font-size:13px}
.hub-table th{background:var(--surface-2,#f3f6fb);color:var(--muted);text-align:left;font-size:11px;font-weight:600;padding:8px 14px;border-bottom:1px solid var(--line)}
.hub-table td{padding:10px 14px;vertical-align:middle;border-bottom:1px solid var(--line);overflow-wrap:anywhere}
.hub-table th:first-child{width:34%}.hub-table th:nth-child(2){width:30%}.hub-table th:last-child{width:48px}
.hub-table tbody tr.hub-row-open{cursor:pointer}.hub-table tbody tr.hub-row-open:hover td{background:var(--blue-soft,#eef3ff)}
.hub-table a{color:var(--blue);text-decoration:none}.hub-table a:hover{text-decoration:underline}
.hub-file-name{display:flex;align-items:center;gap:10px;min-width:0;font-weight:600;color:var(--text)}.hub-file-name>span{min-width:0}.hub-file-name svg{color:var(--muted)}.hub-file-link{display:-webkit-box;overflow:hidden;-webkit-box-orient:vertical;-webkit-line-clamp:2;font-weight:650;color:var(--text)!important}.hub-file-link:hover{color:var(--blue)!important}
.hub-scope-cell{min-width:0}
.hub-scope-link{display:-webkit-box;max-width:100%;overflow:hidden;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow-wrap:anywhere;font-weight:550;color:var(--blue)!important;text-decoration:none}.hub-scope-link:hover{text-decoration:underline}
.hub-scope-plain{color:var(--text);font-weight:500}
.hub-folder-chip{display:inline-flex;align-items:center;border:0;background:var(--surface-2,#f3f6fb);color:var(--muted);font:inherit;font-size:11px;font-weight:550;padding:3px 8px;border-radius:6px;cursor:pointer;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.hub-folder-chip:hover{background:var(--blue-soft,#eef3ff);color:var(--blue)}
.hub-folder-muted{font-size:11px;color:var(--muted)}
.hub-status{display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;font-size:11px;font-weight:600;padding:0 8px;height:24px;min-height:24px;border-radius:6px;white-space:nowrap;line-height:1;background:var(--green-soft,#e5f6ec);color:var(--green,#0f7a45);vertical-align:middle}
.hub-status.draft{color:var(--amber,#a16207);background:var(--amber-soft,#fff6db)}.hub-status.archived{color:var(--muted);background:var(--surface-2,#f3f6fb)}
.hub-status[data-state="pending"]{color:var(--muted);background:var(--surface-2,#f3f6fb)}
.document-name-line{display:flex;align-items:center;gap:8px;min-width:0;max-width:100%}
.document-name-line>strong{flex:0 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.document-status-badge{flex:0 0 auto;align-self:center;max-width:100%}
.document-status-badge[hidden]{display:none}
.stage-doc-line{display:flex;align-items:center;gap:8px;min-width:0;flex-wrap:wrap}
.stage-doc-line>.document-status-badge{margin-inline:0;align-self:center}
.hub-table td{vertical-align:middle}
.hub-table .hub-status{vertical-align:middle}
.hub-row-actions{text-align:right;width:1%;white-space:nowrap}
.hub-pagination{justify-content:flex-end;padding:10px 14px;border-top:1px solid var(--line)}.hub-pagination>span{margin-right:auto;color:var(--muted);font-size:12px}
.hub-pagination .btn{min-height:32px;height:32px;padding:0 10px;font-size:12px}
.hub-empty{text-align:center;padding:48px 20px;color:var(--muted)}.hub-empty svg{width:32px;height:32px;color:#a2aec0}.hub-empty h3{font-size:15px;color:#3c4d65;margin:12px 0 6px}.hub-empty p{font-size:13px;margin:0}
.hub-dialog{position:fixed;inset:0;margin:auto;width:min(540px,calc(100vw - 24px));max-height:calc(100dvh - 40px);border:1px solid var(--line);border-radius:12px;padding:0;color:var(--text);box-shadow:0 24px 70px #13264533;background:#fff}.hub-dialog::backdrop{background:#11213b66}.hub-dialog form{display:flex;flex-direction:column;max-height:calc(100dvh - 42px)}.hub-dialog header{display:flex;align-items:center;justify-content:space-between;padding:18px 20px;border-bottom:1px solid var(--line);gap:10px}.hub-dialog-body{padding:20px;display:flex;flex-direction:column;gap:16px;overflow-y:auto}.hub-dialog footer{display:flex;justify-content:flex-end;gap:10px;padding:14px 20px;border-top:1px solid var(--line)}.icon-btn{display:inline-flex;justify-content:center;align-items:center;background:transparent;color:#64758c;border:1px solid transparent;border-radius:7px;min-width:34px;min-height:34px;padding:6px;cursor:pointer}.icon-btn:hover{background:#eef3fa;color:var(--accent)}.icon-btn svg{width:19px;height:19px}.hub-drop{padding:22px;border:1px dashed #aebfd8;border-radius:8px;background:#f8faff;align-items:center;text-align:center}.hub-drop input{height:auto}.hub-drop.drag-over{background:#e8f0ff;border-color:#2764d7}.form-error{color:#bb3636!important;font-size:13px;white-space:pre-wrap}
.hub-profile{display:grid;grid-template-columns:320px minmax(0,1fr);gap:20px;align-items:start}.hub-profile-card{display:grid;grid-template-columns:54px 1fr;gap:12px;align-items:center}.hub-avatar{background:#eaf1ff;color:#2764d7;border-radius:50%;width:50px;height:50px;display:grid;place-items:center;font-size:18px;font-weight:700}.hub-profile-card p{margin:5px 0}.hub-profile-card form{grid-column:1/-1;display:flex;flex-direction:column;gap:14px;margin-top:14px}.hub-profile-main{min-width:0;display:flex;flex-direction:column;gap:18px}.hub-profile-main .desk-metrics{grid-template-columns:repeat(2,minmax(0,1fr));margin:0}.hub-task{display:flex;justify-content:space-between;align-items:center;gap:20px;padding:14px 0;border-bottom:1px solid #edf0f5;text-decoration:none;color:var(--text)}.hub-task small{display:block;margin-top:4px;color:var(--muted)}.hub-task time{white-space:nowrap;font-size:12px}.text-danger{color:#ba3b3b}
.personal-cabinet{display:flex;flex-direction:column;gap:14px;min-width:0}.personal-cabinet-tabs{display:flex;align-items:center;gap:2px;min-height:44px;padding:0 8px;border:1px solid var(--line);border-radius:10px;background:var(--panel);overflow-x:auto}.personal-cabinet-tabs button{flex:0 0 auto;min-height:43px;padding:10px 12px;border:0;border-bottom:2px solid transparent;background:transparent;color:var(--muted);font:inherit;font-weight:600;white-space:nowrap;cursor:pointer}.personal-cabinet-tabs button:hover{color:var(--text)}.personal-cabinet-tabs button.active{color:var(--accent);border-bottom-color:var(--accent)}.personal-cabinet-body{min-width:0}.personal-cabinet-body>.team-page,.personal-cabinet-body>.panel{margin-bottom:0}
.hub-notification-drawer{position:fixed;inset:12px 12px 12px auto;margin:0;width:440px;max-width:calc(100vw - 24px);height:calc(100dvh - 24px);max-height:none}.hub-notification-drawer form{height:100%;max-height:none}.hub-notification-drawer .hub-dialog-body{flex:1;padding:0;gap:0}.hub-notification-drawer .hub-search{margin:14px 18px}.hub-notification-list{padding:0 8px}.hub-notification{display:flex;gap:10px;padding:14px 10px;border-bottom:1px solid #edf0f5}.hub-notification.unread{background:#f6f9ff}.hub-notification>div:nth-child(2){flex:1;min-width:0}.hub-notification a{text-decoration:none;color:var(--text)}.hub-notification p{margin:5px 0 8px;color:var(--muted);font-size:13px;overflow-wrap:anywhere}.hub-notification time{color:#8491a3;font-size:11px}.hub-notification-icon{width:32px;height:32px;background:#eaf1ff;color:#4774bb;border-radius:50%;display:grid;place-items:center;flex-shrink:0}
.bravo-dialog-layer{position:fixed;inset:0;z-index:1800;background:#11213b66;display:flex;align-items:center;justify-content:center;padding:20px}.bravo-dialog{background:#fff;max-width:760px;width:100%;max-height:calc(100dvh - 40px);overflow:auto;border-radius:12px;border:1px solid var(--line)}.bravo-dialog>header,.bravo-dialog>footer{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:18px 20px;border-bottom:1px solid var(--line)}.bravo-dialog>footer{border-top:1px solid var(--line);border-bottom:0}.bravo-dialog h2{font-size:18px;margin:0}.bravo-dialog-body{padding:20px}.eyebrow{color:var(--muted);font-size:12px}.calendar-panel{min-width:0}.calendar-grid{overflow:hidden}.calendar-cell{min-width:0}.calendar-day-dialog{max-width:640px}.calendar-nav b{min-width:155px;text-align:center}
@media(max-width:1100px){.hub-doc-layout{grid-template-columns:168px minmax(0,1fr)}.hub-doc-toolbar select{max-width:none}.hub-table th:nth-child(4),.hub-table td:nth-child(4){display:none}.hub-profile{grid-template-columns:280px minmax(0,1fr)}}
.hub-table-scroll{max-height:none!important;overflow-y:visible!important}.hub-documents .hub-file-list{max-height:none}
.calendar-grid .calendar-cell{min-height:100px}.calendar-grid{grid-auto-rows:minmax(100px,1fr)}.calendar-cell .calendar-event{padding:5px 7px}.calendar-weekdays>span{text-align:left;padding-left:16px}
.dtm-calendar-filters{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin-bottom:14px}.dtm-calendar-filters input{flex:1;min-width:190px}.dtm-calendar-filters input,.dtm-calendar-filters select{height:36px;border:1px solid var(--line);border-radius:7px;padding:8px 12px;background:#fff}.dtm-calendar-filters button:last-child{margin-left:auto}.calendar-cell header>span:empty{display:none}
.dtm-thread-search{padding:9px 18px;border-bottom:1px solid var(--line);background:#fff}.dtm-thread-search input{height:34px;width:100%;border:1px solid var(--line);border-radius:7px;padding:7px 12px;background:#f9fbfe}.dtm-reply-preview{display:flex;gap:12px;align-items:center;padding:10px 18px;background:#f3f7ff;border-top:1px solid var(--line)}.dtm-reply-preview>span{flex:1;min-width:0;border-left:3px solid #739de3;padding-left:10px}.dtm-reply-preview small{display:block;white-space:nowrap;text-overflow:ellipsis;overflow:hidden;margin-top:4px;color:var(--muted)}.chat-main .composer textarea{min-height:38px;max-height:120px;resize:vertical;flex:1;border:1px solid #d9e1ed;border-radius:8px;padding:10px 12px;font:inherit}.chat-day{display:flex;justify-content:center;margin:14px 0}.chat-day span{background:#e7edf6;color:#758198;font-size:11px;padding:4px 10px;border-radius:12px}.chat-main .message-quick-reply svg{width:16px;height:16px}.chat-main .message-author{font-size:12px}.chat-main .message-status{font-size:10px}.chat-main .message-reply{border:0;border-left:3px solid #93b3e7;background:#ffffff88;display:flex;flex-direction:column;gap:4px;align-items:start;width:100%;padding:7px 9px;text-align:left;color:#425778;margin-bottom:6px}.chat-main .message-reply span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:260px}.chat-main .msg-actions{display:flex;align-items:center;gap:4px}.chat-main .message-quick-reply{border:0;background:none;color:#8a9bb2;padding:5px;border-radius:6px}.chat-main .message-quick-reply:hover{background:#eaf0fa;color:#3267b8}.chat-main .bubble{min-width:75px}.chat-main .msg .msg-body{white-space:pre-wrap;overflow-wrap:anywhere}
@media(max-width:700px){.hub-doc-layout,.hub-profile{grid-template-columns:1fr}.hub-folder-list{flex-direction:row;overflow-x:auto;padding:6px;border-right:0;border-bottom:1px solid var(--line)}.hub-folder-list button{min-width:140px;flex-shrink:0;max-width:200px}.hub-folder-list small{display:none}.hub-doc-toolbar{padding:10px}.hub-doc-filters{display:grid;grid-template-columns:1fr 1fr;width:100%;flex:1 1 100%}.hub-doc-toolbar .hub-search{grid-column:1/-1;max-width:none}.hub-doc-toolbar select{max-width:none;width:100%}.hub-doc-toolbar .list-count{order:5}.hub-doc-toolbar .toolbar-actions,.hub-actions{width:100%;margin-left:0}.hub-actions .btn{flex:1;font-size:12px;padding-inline:8px}.hub-table thead{display:none}.hub-table,.hub-table tbody,.hub-table tr{display:block}.hub-table tr{position:relative;padding:12px 46px 12px 12px;border-top:1px solid var(--line)}.hub-table td{display:block;width:100%;padding:3px 0;border:0}.hub-table td:last-child{position:absolute;right:8px;top:10px;width:auto}.hub-file-name{font-size:14px}.hub-result{gap:8px}.hub-result .hub-sort{margin-left:0}.hub-tabs{padding:0 6px}.hub-tabs button{padding:10px 8px;font-size:12px}.hub-dialog input,.hub-dialog select,.hub-profile input,.hub-doc-toolbar select{height:42px;min-height:42px}.hub-dialog header,.hub-dialog-body,.hub-dialog footer{padding:14px}.hub-profile-main .desk-metrics{gap:10px}.hub-profile-card{padding:16px}.hub-notification-drawer{inset:0;width:100%;max-width:none;height:100dvh;border-radius:0}.calendar-panel .desk-panel-head{flex-wrap:wrap;gap:12px}.calendar-nav{width:100%;justify-content:space-between}.history-filters{display:flex;flex-wrap:wrap}.history-filters label{flex:1;min-width:130px}.history-search{width:100%}.bravo-dialog-layer{padding:12px}.bravo-dialog{max-height:calc(100dvh - 24px)}}

.hub-doc-toolbar{padding:0;margin:0 0 12px;border:0;border-radius:0;background:transparent;box-shadow:none}

.hub-notes{grid-column:1/-1;margin-top:0}.hub-notes>.hub-panel-head{align-items:center}.hub-notes>.hub-panel-head>span{color:var(--muted);font-size:11px}
.hub-note-form{display:grid;grid-template-columns:170px minmax(0,1fr);gap:10px;padding:14px 16px;border-bottom:1px solid var(--line)}
.hub-note-form label{display:flex;flex-direction:column;gap:6px;color:var(--muted);font-size:13px;font-weight:500}
.hub-notes .hub-tabs a{display:inline-flex;align-items:center;min-height:40px;padding:8px 14px;font-size:13px;text-decoration:none;color:var(--muted);border-bottom:2px solid transparent}
.hub-notes .hub-tabs a.active{color:var(--blue);border-bottom-color:var(--blue);font-weight:600}
.hub-note-form select,.hub-note-form textarea{width:100%;min-width:0;border:1px solid var(--line);border-radius:8px;background:#fff;color:var(--text);font:inherit;font-size:13px;padding:8px 10px}
.hub-note-form select{height:36px}.hub-note-form textarea{min-height:74px;resize:vertical;line-height:1.45}.hub-note-text{grid-column:2;grid-row:1 / span 2}
.hub-note-submit{grid-column:1/-1;display:flex;align-items:center;justify-content:flex-end;gap:10px}.hub-note-submit [role=status]{margin-right:auto;color:var(--muted);font-size:12px}
.hub-note-list{padding:0 16px}.hub-note{padding:12px 0;border-bottom:1px solid var(--line)}.hub-note:last-child{border-bottom:0}
.hub-note-edit{margin-left:auto}
.hub-note-meta .hub-note-edit+.hub-note-delete{margin-left:0}
.hub-note-meta{display:flex;flex-wrap:wrap;align-items:center;gap:8px;color:var(--muted);font-size:12px}.hub-note-kind{padding:3px 8px;border-radius:var(--control-r);background:var(--surface-2);color:var(--muted);font-size:12px;font-weight:500}.hub-note-kind.work{background:var(--blue-soft);color:var(--blue)}
.hub-note-meta .hub-note-delete{margin-left:auto}.hub-note p{margin:10px 0 0;white-space:pre-wrap;overflow-wrap:anywhere;font:13px/1.5 var(--font);color:var(--text)}
.hub-note-dialog{width:min(600px,calc(100vw - 24px));border-radius:var(--r)}
.hub-note-dialog header{padding:12px 16px}.hub-note-dialog h2{font-size:16px;font-weight:650}
.hub-note-dialog .hub-dialog-body{padding:16px;gap:12px}.hub-note-dialog footer{padding:12px 16px;gap:8px}
.hub-note-dialog .hub-note-kind{align-self:flex-start}
.hub-note-dialog textarea{min-height:180px;max-height:45dvh;font:13px/1.5 var(--font);box-sizing:border-box}
.hub-note-privacy{margin:0;color:var(--muted);font-size:12px;line-height:1.5}
.hub-note-counter{align-self:flex-end;color:var(--muted);font-size:12px}
.hub-dialog-context{margin:0;color:var(--text);font-size:13px;line-height:1.5;overflow-wrap:anywhere}
.hub-notes>.hub-panel-head{padding:12px 16px;gap:12px}.hub-notes>.hub-panel-head h2{font-size:16px}
@media(max-width:700px){.hub-note-form{grid-template-columns:minmax(0,1fr)}.hub-note-text{grid-column:1;grid-row:auto}.hub-note-submit{grid-column:1}.hub-notes>.hub-panel-head{align-items:center;flex-direction:row}.hub-note-meta>span:nth-child(2){flex-basis:100%;order:3}.hub-note-dialog textarea{min-height:140px}.hub-note-dialog footer .btn{flex:1}}
