:root { --primary: #2563eb; --primary-hover: #1d4ed8; --bg-main: #f5f5f5; --bg-sidebar: #111827; --bg-sidebar-hover: #1f2937; --bg-chat: #f9fafb; --text-main: #111; --text-muted: #6b7280; --border: #e5e7eb; }
*{box-sizing:border-box}
body{margin:0;font-family:system-ui,-apple-system,sans-serif;background:var(--bg-main);color:var(--text-main);overflow:hidden;height:100vh;display:flex;flex-direction:column}
input,textarea,select{width:100%;padding:10px;margin:6px 0;border:1px solid #ccc;border-radius:8px;font-size:14px;font-family:inherit;background:#fff;transition:border-color 0.2s}
input:focus,textarea:focus,select:focus{outline:none;border-color:var(--primary)}
button{padding:9px 14px;border:0;background:var(--primary);color:#fff;border-radius:8px;cursor:pointer;font-size:14px;transition:background 0.15s, transform 0.1s}
button:hover{background:var(--primary-hover)} button:active{transform:scale(0.97)}
button.secondary{background:#6b7280} button.secondary:hover{background:#4b5563}
button.danger{background:#ef4444} button.danger:hover{background:#dc2626}
#auth{max-width:360px;margin:80px auto;padding:32px;background:#fff;border-radius:16px;box-shadow:0 10px 25px rgba(0,0,0,.1);animation:fadeIn 0.4s ease-out}
@keyframes fadeIn { from{opacity:0; transform:translateY(10px)} to{opacity:1; transform:translateY(0)} }
#auth-logo { text-align:center; margin-bottom:20px; min-height:40px; }
#auth-logo img { max-height: 80px; max-width: 100%; object-fit: contain; border-radius: 12px; }
#auth h1{margin:0 0 24px;font-size:24px;text-align:center;font-weight:800}
#app{display:none;height:100vh} #app.visible{display:flex;animation:fadeIn 0.3s}
#global-sidebar{width:80px;background:var(--bg-sidebar);color:#fff;display:flex;flex-direction:column;align-items:center;padding:16px 0;flex-shrink:0;z-index:10;transition:width 0.2s cubic-bezier(0.4, 0, 0.2, 1)}
#global-sidebar.expanded{width:220px;align-items:stretch}
.global-logo{height:48px;margin-bottom:20px;display:flex;align-items:center;justify-content:center;cursor:pointer;transition:transform 0.2s}
.global-logo:hover{transform:scale(1.05)} .global-logo img{max-width:100%;max-height:100%;border-radius:12px;object-fit:contain}
.global-logo .brand-text{display:none;font-size:18px;font-weight:700;margin-left:12px}
#global-sidebar.expanded .global-logo .brand-text{display:block} #global-sidebar.expanded .global-logo{justify-content:flex-start;padding-left:12px}
.global-nav{display:flex;flex-direction:column;gap:8px;width:100%;padding:0 8px}
.global-nav button{background:transparent;color:#9ca3af;width:100%;height:50px;border-radius:10px;display:flex;align-items:center;justify-content:center;gap:12px;font-size:14px;padding:0 12px;transition:all 0.2s}
.global-nav button .icon{font-size:20px;min-width:24px;text-align:center} .global-nav button .nav-text{display:none;white-space:nowrap}
#global-sidebar.expanded .global-nav button{justify-content:flex-start} #global-sidebar.expanded .global-nav button .nav-text{display:block}
.global-nav button:hover{background:var(--bg-sidebar-hover);color:#fff} .global-nav button.active{background:var(--primary);color:#fff;box-shadow:0 4px 12px rgba(37,99,235,0.3)}
#global-bottom{margin-top:auto;width:100%;padding:0 8px;display:flex;flex-direction:column;gap:8px}
.global-bottom-btn{background:transparent;color:#9ca3af;height:50px;border-radius:10px;display:flex;align-items:center;justify-content:center;gap:12px;font-size:14px;padding:0 12px;cursor:pointer;transition:all 0.2s}
.global-bottom-btn .icon{font-size:20px;min-width:24px;text-align:center} .global-bottom-btn .nav-text{display:none;white-space:nowrap}
#global-sidebar.expanded .global-bottom-btn{justify-content:flex-start} #global-sidebar.expanded .global-bottom-btn .nav-text{display:block}
.global-bottom-btn:hover{background:var(--bg-sidebar-hover);color:#fff} .global-bottom-btn.logout:hover{background:#dc2626;color:#fff}
#global-me{display:flex;align-items:center;gap:12px;padding:10px;cursor:pointer;border-radius:10px;margin-bottom:8px;transition:background 0.2s}
#global-me:hover{background:var(--bg-sidebar-hover)}
#global-me .me-text{display:none;flex:1;min-width:0} #global-sidebar.expanded #global-me .me-text{display:block}
#global-me .me-name{font-weight:600;font-size:13px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#global-me .me-sub{font-size:11px;opacity:.7;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.avatar-circle{width:36px;height:36px;border-radius:50%;display:flex;align-items:center;justify-content:center;color:#fff;font-weight:600;font-size:14px;flex-shrink:0;user-select:none;background-size:cover;background-position:center;box-shadow:0 2px 4px rgba(0,0,0,0.1)}
.avatar-circle.big{width:80px;height:80px;font-size:28px}
#chat-list-sidebar{width:320px;background:#fff;border-right:1px solid var(--border);display:none;flex-direction:column;flex-shrink:0}
#chat-list-sidebar.visible{display:flex}
.chat-list-header{padding:16px 16px 0 16px;border-bottom:1px solid var(--border);}
.chat-header-top{display:flex;justify-content:space-between;align-items:center;margin-bottom:12px;} .chat-header-top h2{margin:0;font-size:18px;}
.chat-list-actions{display:flex;gap:8px} .chat-list-actions button{padding:6px 10px;font-size:13px;background:#f3f4f6;color:#374151;border-radius:20px;font-weight:600}
.chat-list-actions button:hover{background:#e5e7eb}
.folder-tabs { display: flex; overflow-x: auto; gap: 4px; padding-bottom: 8px; scrollbar-width: none; }
.folder-tabs::-webkit-scrollbar { display: none; }
.folder-tab { padding: 6px 12px; background: transparent; border-radius: 20px; font-size: 13px; cursor: pointer; white-space: nowrap; color: #6b7280; border: 1px solid transparent; }
.folder-tab:hover { background: #f3f4f6; } .folder-tab.active { background: #eff6ff; color: var(--primary); font-weight: 600; border-color: #bfdbfe; } .folder-tab.add-btn { color: var(--primary); font-weight: bold; padding: 6px 10px; }
.chat-list-scroll{flex:1;overflow-y:auto;padding:12px}
.chat-group-title{font-size:11px;font-weight:700;color:var(--text-muted);text-transform:uppercase;margin:16px 0 8px 8px;letter-spacing:0.5px}
.chat-item{display:flex;align-items:center;padding:12px;border-radius:12px;cursor:pointer;gap:12px;margin-bottom:4px;transition:background 0.15s;position:relative}
.chat-item:hover{background:#f3f4f6} .chat-item.active{background:#eff6ff;border-left:3px solid var(--primary)}
.chat-item .avatar{width:44px;height:44px;flex-shrink:0;position:relative} .chat-item .info{flex:1;min-width:0}
.chat-item .name-row{display:flex;justify-content:space-between;align-items:baseline}
.chat-item .name{font-weight:600;font-size:14px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:var(--text-main)}
.chat-item .last-msg{font-size:13px;color:var(--text-muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin-top:2px}
.unread-badge{background:var(--primary);color:#fff;font-size:11px;font-weight:700;padding:2px 6px;border-radius:10px;display:inline-block}
.status-indicator { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 600; padding: 2px 6px; border-radius: 4px; margin-left: 6px; }
.status-open { background: #d1fae5; color: #065f46; } .status-closed { background: #fee2e2; color: #991b1b; }
.status-vacation { background: #fef3c7; color: #92400e; } .status-dnd { background: #fee2e2; color: #991b1b; } .status-shift { background: #dbeafe; color: #1e40af; }
#main-view{flex:1;display:flex;flex-direction:column;min-width:0;background:#fff;position:relative}
.view{display:none;flex:1;flex-direction:column;min-height:0;animation:fadeIn 0.2s} .view.active{display:flex}
#header{padding:12px 24px;background:#fff;border-bottom:1px solid var(--border);display:flex;align-items:center;gap:16px;min-height:68px;box-shadow:0 1px 4px rgba(0,0,0,0.03);z-index:5}
#header .hdr-avatar{width:40px;height:40px;border-radius:50%;flex-shrink:0;position:relative} #header .hdr-body{flex:1;min-width:0}
#header .hdr-title{font-weight:700;font-size:16px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;display:flex;align-items:center;gap:8px;}
#header .hdr-sub{font-size:12px;color:var(--text-muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin-top:2px}
#header .hdr-actions{margin-left:auto;display:flex;gap:8px}
#messages{flex:1;overflow-y:auto;padding:24px;background:var(--bg-chat);display:flex;flex-direction:column;gap:16px}
.msg{display:flex;gap:12px;max-width:80%;align-self:flex-start;animation:slideUp 0.2s ease-out}
@keyframes slideUp { from{opacity:0; transform:translateY(10px)} to{opacity:1; transform:translateY(0)} }
.msg.own{align-self:flex-end;flex-direction:row-reverse} .msg .msg-avatar{width:36px;height:36px;border-radius:50%;flex-shrink:0;cursor:pointer}
.msg .msg-content{display:flex;flex-direction:column;min-width:0} .msg.own .msg-content{align-items:flex-end}
.msg .msg-head{display:flex;align-items:baseline;gap:8px;margin-bottom:4px;font-size:13px}
.msg .author{font-weight:600;color:var(--primary);cursor:pointer} .msg .time{font-size:11px;color:#9ca3af;display:flex;align-items:center;gap:4px}
.msg .text{padding:10px 14px;border-radius:16px;font-size:14px;line-height:1.4;word-wrap:break-word;background:#fff;box-shadow:0 1px 2px rgba(0,0,0,0.05)}
.msg.other .text{border-top-left-radius:4px} .msg.own .text{background:var(--primary);color:#fff;border-top-right-radius:4px}
.msg .text.deleted{font-style:italic;color:#9ca3af;background:#f3f4f6;border:1px solid #e5e7eb}
.msg .att{margin-top:6px;display:inline-flex;align-items:center;gap:6px;background:#fff;border-radius:8px;padding:8px 12px;font-size:13px;color:#1f2937;text-decoration:none;border:1px solid var(--border);box-shadow:0 1px 2px rgba(0,0,0,0.05)}
.msg .att:hover{background:#f9fafb}
.msg .img-wrap{margin-top:6px;max-width:400px;position:relative;display:inline-block}
.msg .img-wrap img{max-width:100%;border-radius:12px;display:block}
.msg .download-btn{position:absolute;bottom:8px;right:8px;background:rgba(0,0,0,0.6);color:white;padding:4px 8px;border-radius:6px;text-decoration:none;font-size:12px;opacity:0;transition:opacity 0.2s}
.msg .img-wrap:hover .download-btn{opacity:1}
.msg .actions{display:flex;gap:4px;opacity:0;transition:opacity 0.15s;align-self:center}
.msg:hover .actions{opacity:1} .msg .action-btn{background:transparent;color:#9ca3af;font-size:14px;padding:4px;border-radius:4px;cursor:pointer}
.msg .action-btn:hover{background:#e5e7eb;color:#111} .msg .mention{background:#fef08a;color:#b45309;font-weight:600;padding:0 2px;border-radius:3px}
.msg.own .mention{background:#3b82f6;color:#eff6ff}
.msg-reactions{display:flex;gap:4px;margin-top:6px;flex-wrap:wrap}
.reaction-chip{background:#f3f4f6;border:1px solid #e5e7eb;border-radius:12px;padding:2px 8px;font-size:12px;cursor:pointer;color:#374151;transition:all 0.15s}
.reaction-chip:hover{background:#e5e7eb} .reaction-chip.mine{background:#dbeafe;border-color:#93c5fd;color:#1e40af;font-weight:600}
#composer{padding:16px 24px;background:#fff;border-top:1px solid var(--border);display:flex;gap:12px;align-items:center;position:relative}
#composer input[type=text]{flex:1;margin:0;border-radius:24px;padding:14px 20px;background:#f3f4f6;border:1px solid transparent;font-size:14px}
#composer input[type=text]:focus{border-color:var(--primary);background:#fff;box-shadow:0 0 0 3px rgba(37,99,235,0.1)}
#composer .attach-btn{background:transparent;color:var(--text-muted);font-size:24px;padding:8px;border-radius:50%} #composer .attach-btn:hover{background:#f3f4f6;color:#111}
#composer .send-btn{background:var(--primary);border-radius:50%;width:44px;height:44px;display:flex;align-items:center;justify-content:center;padding:0;font-size:20px;box-shadow:0 2px 6px rgba(37,99,235,0.3)}
.emoji-panel{position:absolute;bottom:70px;left:60px;background:#fff;border:1px solid var(--border);border-radius:12px;box-shadow:0 8px 24px rgba(0,0,0,.15);padding:10px;display:none;grid-template-columns:repeat(6,1fr);gap:4px;width:min(300px,90vw);max-height:280px;overflow-y:auto;overflow-x:hidden;z-index:60}
.emoji-panel.visible{display:grid}
.emoji-btn{background:transparent;border:0;font-size:20px;cursor:pointer;padding:4px;border-radius:8px;transition:background .1s;min-width:0;text-align:center}
.emoji-btn:hover{background:#f3f4f6}
#msg-ctx {position:fixed;z-index:10000;display:none;width:min(330px,calc(100vw - 16px));max-height:calc(100vh - 16px);overflow:auto;border-radius:14px;background:#fff;border:1px solid #d5e6e5;box-shadow:0 12px 32px #143f4433;padding:6px}
#msg-ctx.open {display:block}
.message-reaction-bar,.message-reaction-grid {display:grid;grid-template-columns:repeat(8,minmax(0,1fr));gap:2px;background:#edf7f5;border-radius:9px;padding:4px}
.message-reaction-grid {margin-top:5px}
.message-reaction-bar button,.message-reaction-grid button {background:transparent;color:#24534e;padding:4px 0;font-size:clamp(16px,4vw,25px);line-height:1.15;min-width:0}
.message-reaction-bar button:hover,.message-reaction-grid button:hover,.message-reaction-bar button[aria-pressed=true],.message-reaction-grid button[aria-pressed=true] {background:#d4ede8}
.message-reaction-bar .message-reaction-expand {background:#dcefeb;font-size:20px}
.message-menu-actions {display:grid;margin-top:5px;gap:1px}
#msg-ctx .mi {padding:7px 10px;font-size:13px;width:100%;text-align:left;background:transparent;color:#26434a;display:flex;gap:8px;align-items:center}
#msg-ctx .mi span:first-child {width:20px;flex:none;text-align:center}
#msg-ctx .mi:hover,#msg-ctx .mi:focus-visible {background:#edf7f5}
#msg-ctx .mi.danger {color:#b23535;border-top:1px solid #e8eeee;border-radius:0 0 7px 7px}

#tasks-view, #calendar-view, #users-view, #struct-view { padding:24px; background:var(--bg-chat); display:flex; flex-direction:column; height:100%; overflow-y:auto; }
.tasks-header, .users-header { display:flex; justify-content:space-between; align-items:center; margin-bottom:24px; }
.tasks-header h2, .users-header h2 { margin:0; font-size:24px; font-weight:800; }
#tasks-view {background:#eef3f6;gap:12px}
#tasks-view .tasks-header {margin:0;padding:16px 18px;background:#142b36;color:#fff;border-radius:12px;gap:12px;flex-wrap:wrap}
#tasks-view .tasks-header h2 {font-size:23px}
#tasks-view .task-tab {color:#eef9f8;background:#27434f}
#tasks-view .task-tab.active {color:#122c35;background:#bdebe2}
.tasks-create {background:#107969;color:white;font-weight:650}
.tasks-create:hover {background:#0b665a}
.task-controls {display:flex;align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap;margin-bottom:12px}
.task-controls .task-filters {flex:1}
.task-controls input[type=search] {min-width:175px}
.task-table-shell {overflow:auto;background:white;border:1px solid #d5e0e5;border-radius:12px}
.task-table {border-collapse:separate;border-spacing:0;width:100%;min-width:760px;text-align:left;font-size:13px;color:#243b44}
.task-table th {position:sticky;top:0;background:#f1f7f8;color:#284753;text-align:left;font-weight:650;z-index:1}
.task-table th,.task-table td {padding:9px 13px;border-bottom:1px solid #e8eef0}
.task-table td {height:47px}
.task-table tr:last-child td {border-bottom:0}
.task-table tbody tr:hover {background:#f3faf9}
.task-table .done-row {color:#697a81}
.task-table .done-row .task-row-title {color:inherit;text-decoration:line-through}
.task-row-open,.task-sort,.task-person {padding:0;text-align:left;color:inherit;background:transparent;font:inherit}
.task-row-open:hover,.task-sort:hover,.task-person:hover {background:transparent;color:#0c7366;text-decoration:underline}
.task-row-open {font-weight:600;overflow-wrap:anywhere}
.task-person {display:flex;align-items:center;gap:7px;white-space:nowrap;max-width:180px}
.task-person span:last-child {overflow:hidden;text-overflow:ellipsis}
.task-due {display:inline-flex;white-space:nowrap;background:#e4f1f5;color:#245465;border-radius:999px;padding:4px 8px}
.task-due.late {background:#ffebe8;color:#9e3327}
.task-due.soon {background:#fff0d4;color:#795000}
.task-due.muted {background:#f0f3f4;color:#566870}
.task-table input[type=checkbox] {width:auto;margin:0}
.task-table .task-check-col {width:39px}
.task-table .task-table-count {color:var(--text-muted)}
.task-table .task-table-empty {padding:28px;text-align:center;color:#50666e}
.task-row-indicators {display:inline-flex;gap:6px;margin-left:6px;font-size:12px;color:#566870}
@media(max-width:850px){#tasks-view{padding:12px}.task-table{min-width:685px}}
#modal { position: fixed; inset: 0; background: rgba(0,0,0,0.5); display: none; align-items: center; justify-content: center; z-index: 1100; backdrop-filter: blur(2px); }
#modal.task-create {justify-content:flex-end}
#modal.task-create .modal-box {width:min(720px, 96vw);max-height:100vh;height:100%;border-radius:16px 0 0 16px}
.task-create-form {display:grid;gap:14px}
.task-create-form .form-row {margin:0}
.task-create-grid {display:grid;grid-template-columns:repeat(auto-fit,minmax(210px,1fr));gap:12px}
.task-create-form details {border:1px solid var(--border);border-radius:10px;padding:12px}
.task-create-form summary {cursor:pointer;font-weight:600}
.task-create-form summary + div {margin-top:12px}
.task-create-form footer {display:flex;justify-content:flex-end;gap:8px;position:sticky;bottom:0;background:white;padding:10px 0}
#chat-search-bar, #reply-draft {padding:8px 14px;background:white;border-bottom:1px solid var(--border)}
#chat-search-bar form, #reply-draft:not([hidden]) {display:flex;align-items:center;gap:8px}
#chat-search-bar input {margin:0}
#chat-search-results {max-height:30vh;overflow:auto}
.scheduled-post {display:grid;grid-template-columns:1fr auto;gap:6px;padding:8px 0;border-bottom:1px solid var(--border)}
.scheduled-post p {grid-column:1/-1;margin:0;white-space:pre-wrap;overflow-wrap:anywhere}
#reply-draft span {flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.msg-quote {display:block;text-align:left;background:rgba(37,99,235,.08);color:inherit;border:0;border-left:3px solid var(--primary);padding:4px 8px;margin:4px 0;font-size:12px;max-width:100%;overflow-wrap:anywhere}
.chat-day {align-self:center;max-width:100%;margin:12px auto;padding:4px 10px;border-radius:20px;background:#dfe9ee;color:#36515d;font-size:12px}
#chat-new-messages {align-self:flex-end;margin:6px 12px}
#chat-new-messages[hidden] {display:none}
.msg-flash {outline:2px solid var(--primary);outline-offset:-2px}
.org-layout {display:grid;grid-template-columns:minmax(230px,1fr) minmax(270px,1.3fr);gap:14px}
.org-layout[hidden] {display:none}
.org-panel {min-width:0;background:white;border:1px solid var(--border);border-radius:12px;padding:14px}
.org-tree ul {list-style:none;padding-inline-start:18px;margin:4px 0}
.org-tree > ul {padding:0}
.org-tree button {background:transparent;color:inherit;text-align:left;width:100%;padding:7px}
.org-tree button[aria-current="true"] {background:#e8efff;color:#184fba;font-weight:700}
.org-person-highlight {background:#e8efff}
@media(max-width:740px){.org-layout{grid-template-columns:1fr}}
#modal.visible { display: flex; animation: fadeIn 0.2s; }
#modal .modal-box { background: #fff; border-radius: 16px; padding: 24px; width: min(520px, 92vw); max-height: 85vh; overflow-y: auto; box-shadow: 0 20px 25px -5px rgba(0,0,0,0.1); animation: scaleIn 0.2s; }
#event-modal { position: fixed; inset: 0; background: rgba(0,0,0,0.5); display: none; align-items: center; justify-content: center; z-index: 1200; backdrop-filter: blur(2px); }
#event-modal.visible { display: flex; animation: fadeIn 0.2s; }
#event-modal .modal-box { background: #fff; border-radius: 16px; padding: 24px; width: min(520px, 92vw); max-height: 85vh; overflow-y: auto; box-shadow: 0 20px 25px -5px rgba(0,0,0,0.1); animation: scaleIn 0.2s; }
 .task-filters {display:flex; flex-wrap:wrap; gap:8px; align-items:center}
.task-filters input, .task-filters select {width:auto; margin:0}
.task-priority {font-size:12px; font-weight:600; color:#a03e0e; background:#fff1df; padding:2px 6px; border-radius:5px}
.task-checklist {margin-top:20px; border:1px solid #e5e7eb; border-radius:10px; padding:12px}
.task-checklist h3 {margin:0 0 8px; font-size:15px}
.task-checklist-item {display:flex; align-items:center; gap:8px; padding:5px 0}
.task-checklist-item label {flex:1; display:flex; gap:8px; align-items:center; overflow-wrap:anywhere}
.task-checklist-item input[type=checkbox], .task-priority-input input {width:auto; margin:0; flex:none}
.task-checklist-form {display:flex; gap:8px; margin-top:8px}
.task-checklist-form input {margin:0; min-width:0}
#task-modal { position: fixed; inset: 0; background: rgba(0,0,0,0.5); display: none; align-items: center; justify-content: center; z-index: 1000; backdrop-filter: blur(2px); }
#task-modal.visible { display: flex; animation: fadeIn 0.2s; }
.task-modal-content { background: #fff; border-radius: 16px; width: min(1400px, 98vw); height: 96vh; max-width: 98vw; display: flex; overflow: hidden; box-shadow: 0 20px 25px -5px rgba(0,0,0,0.1); animation: scaleIn 0.2s; }
.task-left { flex: 1; min-width: 0; padding: 32px 32px 200px 32px; display: flex; flex-direction: column; background: #fff; overflow-y: auto; overflow-x: hidden; }
.task-right { width: 480px; min-width: 320px; border-left: 1px solid var(--border); display: flex; flex-direction: column; background: #f9fafb; }
.task-header-title { font-size: 26px; font-weight: 700; border: none; padding: 6px; margin: 0 0 20px 0; background: transparent; width: 100%; border-bottom: 2px solid transparent; transition: border 0.2s; border-radius: 4px;}
.task-header-title:hover { background: #f9fafb; } .task-header-title:focus { outline: none; border-bottom-color: var(--primary); background: #fff; }
.task-meta-row { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 16px; font-size: 14px; padding: 8px; border-radius: 8px; transition: background 0.2s; }
.task-meta-row:hover { background: #f9fafb; } .task-meta-label { color: #6b7280; width: 120px; flex-shrink: 0; margin-top: 4px; font-size: 13px; }
.task-meta-value { font-weight: 500; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; flex: 1; min-width: 0; }
.task-pills { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; }
.task-pill { background: #fff; border: 1px solid var(--border); padding: 6px 12px; border-radius: 20px; font-size: 13px; cursor: pointer; display: flex; align-items: center; gap: 6px; transition: all 0.2s; color: #374151; }
.task-pill:hover { border-color: var(--primary); color: var(--primary); background: #eff6ff; }
.task-desc-input { width: 100%; min-height: 120px; border: 1px solid var(--border); border-radius: 8px; padding: 12px; resize: vertical; font-family: inherit; font-size: 14px; background: #fff; transition: border 0.2s; }
.task-desc-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,0.1); }
.task-users-scroll { max-height: 200px; overflow-y: auto; display: flex; flex-wrap: wrap; gap: 8px; border: 1px solid var(--border); border-radius: 8px; padding: 8px; }
.cal-header{display:flex;justify-content:space-between;align-items:center;margin-bottom:24px}
.cal-header h2{margin:0;font-size:24px;font-weight:800}
.cal-grid{display:grid;grid-template-columns:repeat(7,1fr);border:1px solid var(--border);border-radius:12px;background:#fff;flex:1;min-height:600px;overflow:hidden;box-shadow:0 1px 3px rgba(0,0,0,.1)}
.cal-dow{background:#f9fafb;padding:12px;text-align:center;font-weight:700;font-size:12px;color:var(--text-muted);border-bottom:1px solid var(--border);border-right:1px solid var(--border);text-transform:uppercase}
.cal-dow:last-child{border-right:0} .cal-cell{border-right:1px solid var(--border);border-bottom:1px solid var(--border);padding:8px;min-height:100px;cursor:pointer;display:flex;flex-direction:column;gap:4px;background:#fff;transition:background 0.15s}
.cal-cell:hover{background:#f9fafb} .cal-cell:nth-child(7n){border-right:0} .cal-cell.other-month{background:#fafafa;color:#9ca3af}
.cal-date{font-size:12px;font-weight:700;margin-bottom:4px}
.cal-event{font-size:11px;padding:3px 6px;border-radius:4px;background:#dbeafe;color:#1e40af;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;border-left:3px solid #3b82f6;cursor:pointer}
.cal-event:hover{background:#bfdbfe}
.cal-event.task{background:#fef3c7;color:#92400e;border-left-color:#f59e0b}
@keyframes scaleIn { from{opacity:0; transform:scale(0.95)} to{opacity:1; transform:scale(1)} }
.profile-row{display:flex;gap:16px;align-items:center;margin-bottom:20px}
.avatar-upload{position:relative;cursor:pointer;border-radius:50%;overflow:hidden}
.avatar-upload .overlay{position:absolute;inset:0;background:rgba(0,0,0,.5);display:flex;align-items:center;justify-content:center;color:#fff;font-size:12px;opacity:0;transition:opacity .2s}
.avatar-upload:hover .overlay{opacity:1} .form-row{display:flex;flex-direction:column;gap:4px;margin-bottom:16px}
.form-row label{font-size:12px;color:var(--text-muted);font-weight:600;padding-left:2px}
.modal-actions{display:flex;justify-content:flex-end;gap:12px;margin-top:24px}
#toast{position:fixed;bottom:24px;left:50%;transform:translateX(-50%);background:#111827;color:#fff;padding:12px 20px;border-radius:12px;font-size:14px;box-shadow:0 10px 15px -3px rgba(0,0,0,.3);opacity:0;pointer-events:none;transition:opacity .3s, transform .3s;z-index:1000;transform:translateX(-50%) translateY(10px)}
#toast.visible{opacity:1;transform:translateX(-50%) translateY(0)} #toast.error{background:#dc2626}
.ticks { display: inline-flex; margin-left: 6px; font-size: 12px; color: #9ca3af; letter-spacing: -2px;} .ticks.read { color: #3b82f6; }
#crop-modal { position: fixed; inset: 0; background: rgba(0,0,0,0.8); display: none; align-items: center; justify-content: center; z-index: 2000; flex-direction: column; }
#crop-modal.visible { display: flex; } #crop-container { width: 300px; height: 300px; border-radius: 50%; overflow: hidden; position: relative; background: #333; cursor: move; }
#crop-img { position: absolute; transform-origin: 0 0; user-select: none; pointer-events: none; max-width: none; }
.crop-controls { margin-top: 20px; display: flex; flex-direction: column; align-items: center; gap: 12px; color: #fff; width: 300px; }
.context-menu { position: fixed; background: #fff; border-radius: 8px; box-shadow: 0 4px 12px rgba(0,0,0,0.15); z-index: 9999; padding: 6px 0; min-width: 150px; display: none; }
.context-item { padding: 8px 16px; font-size: 14px; cursor: pointer; display: flex; align-items: center; gap: 8px; } .context-item:hover { background: #f3f4f6; } .context-item.danger { color: #ef4444; }
.struct-board { display: flex; gap: 24px; overflow-x: auto; padding-bottom: 24px; min-height: 60vh; }
.struct-node { position: absolute; background: #fff; border: 2px solid var(--border); border-radius: 12px; min-width: 260px; padding: 10px 12px; box-shadow: 0 2px 6px rgba(0,0,0,.08); z-index: 2; cursor: grab; transition: box-shadow .15s; user-select: none; }
.struct-node:hover { box-shadow: 0 4px 12px rgba(0,0,0,.12); }
.struct-node.root { background: linear-gradient(135deg,#2563eb,#1d4ed8); color:#fff; border-color:#1d4ed8; }
.struct-node .sn-title { font-weight: 700; font-size: 14px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.struct-node .sn-sub { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.struct-node.root .sn-sub { color: #dbeafe; }
.struct-node .sn-avatars { display: flex; margin-top: 6px; gap: 2px; }
.struct-node .sn-avatars .avatar-circle { width: 24px; height: 24px; font-size: 10px; border: 2px solid #fff; margin-left: -6px; }
.struct-node .sn-avatars .avatar-circle:first-child { margin-left: 0; }
.struct-node .sn-actions { position: absolute; top: 4px; right: 4px; display: flex; gap: 2px; }
.struct-node .sn-actions button { background:#fff;border:1px solid #e5e7eb;color:#6b7280;padding:1px 6px;font-size:11px;border-radius:6px;cursor:pointer; }
.badge-boss { background: #fef3c7; color: #92400e; font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 8px; margin-left: 4px; }
.users-table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 12px; overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,0.05); }
.users-table th { background: #f9fafb; text-align: left; padding: 12px 16px; font-size: 12px; color: var(--text-muted); font-weight: 700; text-transform: uppercase; border-bottom: 1px solid var(--border); }
.users-table td { padding: 12px 16px; border-bottom: 1px solid var(--border); font-size: 14px; }
.user-row { display: flex; align-items: center; gap: 12px; padding: 10px 8px; cursor: pointer; border-radius: 8px; }
.user-row:hover { background: #f3f4f6; } .user-row .ur-text { flex: 1; min-width: 0; }
.user-row .ur-name { font-weight: 600; font-size: 14px; } .user-row .ur-sub { font-size: 12px; color: var(--text-muted); }
.search-bar { display: flex; align-items: center; background: #fff; border: 1px solid var(--border); border-radius: 8px; padding: 0 12px; margin-bottom: 16px; }
.search-bar input { border: none; margin: 0; padding: 10px 0; outline: none; flex: 1; } .search-bar .icon { font-size: 16px; color: #9ca3af; margin-right: 8px; }
::-webkit-scrollbar { width: 6px; height: 6px; } ::-webkit-scrollbar-track { background: transparent; } ::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 3px; } ::-webkit-scrollbar-thumb:hover { background: #9ca3af; }
.task-tabs { display: flex; gap: 4px; background: #f3f4f6; padding: 3px; border-radius: 8px; }
.task-tab { background: transparent; color: #374151; padding: 6px 12px; font-size: 13px; border-radius: 6px; cursor: pointer; border: 0; }
.task-tab:hover { background: #e5e7eb; }
.task-tab.active { background: #fff; color: var(--primary); font-weight: 600; box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.daily-toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; gap: 12px; flex-wrap: wrap; }
.daily-table-wrap { background: #fff; border-radius: 12px; overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,0.05); }
.daily-table { width: 100%; border-collapse: collapse; }
.daily-table th { background: #1e40af; color: #fff; padding: 10px 12px; text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: 0.03em; }
.daily-table td { padding: 8px 12px; border-bottom: 1px solid var(--border); font-size: 14px; vertical-align: top; }
.daily-table td input[type=text], .daily-table td textarea { margin: 0; padding: 4px 8px; border: 1px solid transparent; border-radius: 4px; background: transparent; width: 100%; font-size: 13px; }
.daily-table td input[type=text]:focus, .daily-table td textarea:focus { border-color: var(--primary); background: #fff; outline: none; }
.daily-table tr.done-row { background: #f0fdf4; }
.daily-table tr.done-row td input, .daily-table tr.done-row td textarea { color: #6b7280; }
.daily-table td select { margin: 0; padding: 4px 8px; border-radius: 4px; border: 1px solid var(--border); width: auto; font-size: 13px; }
.daily-table .row-delete { background: transparent; border: 0; color: #ef4444; cursor: pointer; font-size: 16px; padding: 4px; }
.daily-employee-card { background: #fff; border-radius: 12px; padding: 16px; margin-bottom: 12px; box-shadow: 0 1px 3px rgba(0,0,0,0.05); }
.daily-employee-card .emp-header { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.daily-employee-card .emp-header .name { font-weight: 700; font-size: 15px; }
.daily-employee-card .emp-header .stats { margin-left: auto; font-size: 12px; color: #6b7280; }
.daily-employee-card .emp-tasks { display: flex; flex-direction: column; gap: 4px; }
.daily-employee-card .emp-task-row { display: flex; align-items: center; gap: 8px; padding: 4px 0; font-size: 13px; border-bottom: 1px dashed #e5e7eb; }
.daily-employee-card .emp-task-row:last-child { border-bottom: 0; }
.daily-employee-card .emp-task-row.done { color: #6b7280; text-decoration: line-through; }
.daily-employee-card .emp-task-report { color: #2563eb; font-size: 12px; margin-left: auto; }
.kanban-board { display: flex; gap: 16px; overflow-x: auto; padding-bottom: 12px; min-height: 60vh; }
.kanban-col { background: #f3f4f6; border-radius: 12px; padding: 12px; min-width: 280px; flex: 0 0 300px; display: flex; flex-direction: column; }
.kanban-col-title { font-weight: 700; font-size: 14px; color: #374151; margin-bottom: 10px; display: flex; justify-content: space-between; align-items: center; }
.kanban-col-title .badge { background: #fff; padding: 2px 8px; border-radius: 10px; font-size: 12px; color: #6b7280; }
.kanban-col.pending { border-top: 3px solid #9ca3af; }
.kanban-col.in_progress { border-top: 3px solid #3b82f6; background: #eff6ff; }
.kanban-col.done { border-top: 3px solid #10b981; background: #f0fdf4; }
.kanban-card { background: #fff; border-radius: 8px; padding: 10px 12px; margin-bottom: 8px; box-shadow: 0 1px 3px rgba(0,0,0,.06); cursor: grab; border-left: 3px solid transparent; }
.kanban-card:hover { box-shadow: 0 3px 8px rgba(0,0,0,.1); }
.kanban-card.pending { border-left-color: #9ca3af; }
.kanban-card.in_progress { border-left-color: #3b82f6; }
.kanban-card.done { border-left-color: #10b981; opacity: .75; }
.kanban-card.done .kc-title { text-decoration: line-through; color: #6b7280; }
.kanban-card.dragging { opacity: .4; }
.kanban-card .kc-title { font-weight: 600; font-size: 13px; margin-bottom: 6px; line-height: 1.35; }
.kanban-card .kc-meta { display: flex; gap: 6px; align-items: center; font-size: 11px; color: #6b7280; flex-wrap: wrap; }
.kanban-col.drop-target { background: #dbeafe; }
.view-toggle { display: flex; gap: 4px; background: #f3f4f6; padding: 3px; border-radius: 8px; margin-right: 12px; }
.view-toggle button { background: transparent; color: #374151; padding: 6px 12px; font-size: 13px; border-radius: 6px; }
.view-toggle button.active { background: #fff; color: var(--primary); font-weight: 600; box-shadow: 0 1px 2px rgba(0,0,0,.08); }

/* Working layouts for the messenger, task cards and calendar. */
[hidden] {display:none!important}
#chat-list-sidebar {width:clamp(245px,28vw,370px);background:#fff}
.chat-list-header {padding:14px 12px 8px}
#chat-list-search {margin:2px 0 8px;border-color:#dbe5e8;background:#f4f8f9;border-radius:20px}
.chat-list-filters {display:flex;gap:6px;flex-wrap:wrap}
.chat-list-filters button {padding:4px 10px;background:#fff;color:#405962;border:1px solid #dfe8eb;border-radius:16px;font-size:12px}
.chat-list-filters button[aria-pressed=true] {background:#dcf2ed;border-color:#b8e4d9;color:#135b52}
.chat-item.active {background:#d9f1eb;color:#153e37;box-shadow:none}
.chat-item .last-msg {gap:5px}
.chat-person-result {width:100%;text-align:left;background:#fff;color:#27414b}
.chat-list-empty {padding:20px;text-align:center;color:#50666e}
.chat-back {display:none}
#messages, .task-chat-messages {background:radial-gradient(circle at 75% 15%,#d1e8e8 0%,transparent 40%),linear-gradient(145deg,#e9f2f5,#c6dcdf)}
#messages .empty {display:grid;place-items:center;align-content:center;gap:14px;height:100%;color:#33535d}
.chat-empty-icon {display:grid;place-items:center;width:76px;height:76px;border-radius:22px;background:#0b7567;color:#fff;font-size:35px}
.msg .msg-content {background:transparent}
.msg .msg-head {margin:0 5px 3px}
.msg .time {color:#49656e}
.msg .text {max-width:100%;overflow-wrap:anywhere;white-space:pre-wrap}
#messages .msg,.task-chat-messages .msg {max-width: min(85%,760px)}
#header {min-width:0;gap:8px;flex-wrap:wrap}
#composer {min-width:0}
.task-modal-content {position:relative;width:min(1580px,98vw);height:min(96vh,1100px);background:#f1f6f7}
.task-left {flex:0 1 clamp(320px,40%,610px);min-width:270px;overflow:hidden;padding:0;background:#f1f6f7}
.task-right {flex:1;min-width:250px;width:auto;min-height:0}
.task-work-head,.task-work-foot {display:flex;align-items:center;gap:9px;padding:12px 14px;background:white;border-bottom:1px solid #dce8e9;min-height:55px}
.task-work-head .task-header-title {min-width:0;margin:0;font-size:clamp(17px,2vw,24px)}
.task-work-foot {border-bottom:0;border-top:1px solid #dce8e9;flex-wrap:wrap}
.task-work-scroll {flex:1;min-height:0;overflow:auto;padding:12px;display:grid;align-content:start;gap:10px}
.task-pane-card {background:#fff;border:1px solid #dce8e9;border-radius:10px;padding:12px;margin:0}
.task-pane-card header,.task-work-links {display:flex;align-items:center;gap:8px;justify-content:space-between;flex-wrap:wrap}
.task-pane-card h3,.task-chat-info h3 {margin:0 0 4px;font-size:14px}
.task-pane-card textarea {resize:vertical;min-height:62px;margin-bottom:0}
.task-details-grid {display:grid;grid-template-columns: minmax(85px,0.8fr) minmax(0,1.4fr);gap:10px;align-items:center;font-size:13px}
.task-details-grid input {margin:0;min-width:0}
.task-details-grid strong {justify-self:start}
.task-role-people,.task-att-list {display:flex;gap:8px;align-items:center;flex-wrap:wrap}
.task-soft {background:#e8f2f3;color:#265760;padding:6px 10px}
.task-soft:hover {background:#d4eaeb}
.task-chat-label {display:grid;gap:2px;flex:1}
.task-chat-label small {color:#587179}
.task-chat-messages {flex:1;min-height:0;overflow:auto;padding:14px;display:flex;flex-direction:column;gap:10px}
.task-work-compose {display:flex;gap:8px;align-items:center;padding:10px;background:white}
.task-work-compose input {min-width:0;margin:0}
.task-chat-info {flex:0 0 min(210px,18%);padding:14px;background:#fff;border-left:1px solid #dce8e9;overflow:auto}
.task-chat-info .task-person {margin-top:8px}
.task-member-picker {display:grid;gap:8px}
.task-member-list {max-height:46vh;overflow:auto;display:grid;gap:3px}
.task-member-row {display:flex;gap:8px;align-items:center;padding:7px;border-radius:8px;background:#f2f8f8;cursor:pointer}
.task-member-row span {flex:1}
.task-member-row input {width:auto;margin:0;accent-color:#0b7567}
.cal-toolbar,.cal-navigation {display:flex;flex-wrap:wrap;align-items:center;gap:6px}
.cal-toolbar {justify-content:space-between}
.cal-navigation select {width:auto;margin:0;max-width:180px}
.cal-board-month,.cal-board-time {display:grid;min-height:0;overflow:auto;border:1px solid #dbe5e8;border-radius:10px;background:white}
.cal-board-month {grid-template-columns:repeat(7,minmax(68px,1fr));grid-auto-rows:minmax(80px,auto)}
.cal-board-month {grid-template-rows:auto}
.cal-dow,.cal-time-head {padding:8px;text-align:center;background:#f0f7f7;color:#34535c;position:sticky;top:0;z-index:2}
.cal-month-cell,.cal-slot {border:1px solid #edf2f3;padding:3px;min-width:0;cursor:pointer}
.cal-month-cell:hover,.cal-slot:hover {background:#f5fbfa}
.cal-month-cell.out {background:#f5f7f8}
.cal-day-number {display:block;padding:4px 7px;background:transparent;color:#294c54}
.cal-day-number:hover,.cal-day-number.today,.cal-time-head.today {background:#d4eee6}
.cal-entry {display:block;width:100%;margin:2px 0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;text-align:left;background:#dceff2;color:#234d55;padding:4px 5px;font-size:12px}
.cal-entry:hover {background:#c9e7ea}
.cal-entry.task {background:#eee7fa;color:#503b71;border-left:3px solid #8463af}
.cal-entry.task:hover {background:#e2d6f1}
.cal-board-time {grid-template-columns:50px repeat(var(--cal-days),minmax(105px,1fr));grid-auto-rows:minmax(36px,auto)}
.cal-hour {font-size:11px;padding:5px;color:#527079;text-align:center}
.cal-slot-add {display:block;padding:1px 5px;background:transparent;color:#376a69;opacity:0}
.cal-slot:hover .cal-slot-add,.cal-slot-add:focus {opacity:1}
@media(max-width:1100px){
  .task-chat-info {position:absolute;right:0;top:55px;bottom:0;width:min(245px,60%);z-index:2;box-shadow:-5px 0 14px #002c2922}
  #global-sidebar.expanded {width:148px}
}
@media(max-width:750px){
  #global-sidebar,#global-sidebar.expanded {width:52px;padding:8px 0}
  #global-sidebar.expanded .nav-text,#global-sidebar.expanded .brand-text,#global-sidebar.expanded .me-text {display:none}
  #chat-list-sidebar {flex:1;width:auto;border-right:0}
  #app:has(#nav-msg.active):not(.chat-open) #main-view {display:none}
  #app.chat-open:has(#nav-msg.active) #chat-list-sidebar {display:none}
  .chat-back {display:inline-flex}
  #messages {padding:12px}
  .task-modal-content {flex-direction:column;overflow:auto}
  .task-left,.task-right {min-width:0;flex:none;width:100%}
  .task-left {overflow:visible}
  .task-work-scroll {overflow:visible}
  .task-right {min-height:350px;height:60vh}
  .task-chat-info {position:static;width:auto}
  #calendar-view {padding:8px}
}
.chat-row-time {margin-left:auto;white-space:nowrap;font-size:11px;color:#57717b}

/* Compact chat actions and shared conversation tools. */
.chat-header-top {margin-bottom:5px}
.chat-menu {position:relative;flex:none}
.chat-menu summary,.chat-icon-btn,.chat-back {list-style:none;display:grid;place-items:center;width:34px;height:34px;padding:0;border:1px solid #dfe9ea;border-radius:10px;background:#f3f8f8;color:#255b58;cursor:pointer;font-size:19px;line-height:1}
.chat-menu summary::-webkit-details-marker {display:none}
.chat-icon-btn:hover,.chat-menu summary:hover,.chat-menu[open] summary,.chat-back:hover {background:#dcefeb}
.chat-menu-items {position:absolute;z-index:25;top:calc(100% + 6px);right:0;min-width:190px;padding:5px;border:1px solid #dfe8eb;border-radius:10px;background:white;box-shadow:0 10px 24px #153a4130}
.chat-menu-items button {display:block;width:100%;padding:8px 10px;background:transparent;color:#203e47;text-align:left;white-space:nowrap;font-size:13px;border-radius:6px}
.chat-menu-items button:hover {background:#e8f4f1}
#header .hdr-actions {gap:6px}
#folder-tabs {padding:4px 0 0}
#folder-tabs select {width:auto;max-width:100%;margin:0;padding:4px 8px;font-size:12px;border-color:#dfe8eb}
.chat-item.active {position:relative;background:#e3f3ef;border:0;border-radius:10px;box-shadow:none}
.chat-item.active::before {content:'';position:absolute;left:2px;top:11px;bottom:11px;width:3px;background:#188777;border-radius:3px}
.chat-item.active .name {color:#18554c}
.chat-pin {display:flex;align-items:center;gap:8px;padding:5px 12px;border-bottom:1px solid #dce8e7;background:#f1faf8}
#chat-pin-open {min-width:0;flex:1;background:transparent;border-left:3px solid #198b79;border-radius:0;text-align:left;color:#215b53;padding:3px 8px}
#chat-pin-open strong,#chat-pin-text {display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:12px}
#chat-pin-open:hover {background:#e3f3ef}
.chat-search-tabs {margin-top:7px}
.chat-back {display:none}
@media(max-width:750px){.chat-back {display:grid}}

/* Calendar: date navigator and a scrollable, minute-based schedule. */
#calendar-view {display:grid;grid-template-columns:198px minmax(0,1fr);gap:12px;padding:12px;overflow:hidden;background:#eaf1f2}
.calendar-sidebar,.calendar-main {min-width:0;min-height:0;border:1px solid #dce8e9;background:#fff;border-radius:12px}
.calendar-sidebar {padding:10px;overflow:auto;display:flex;flex-direction:column;gap:12px}
.calendar-sidebar > button,.calendar-small-create {background:#0b7567}
.calendar-mini-nav {display:grid;grid-template-columns:auto 1fr auto;align-items:center;text-align:center;gap:2px;font-size:12px}
.calendar-mini-nav strong {text-transform:capitalize}
.calendar-mini-days {display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:2px;text-align:center;font-size:11px;color:#527079}
.calendar-mini-days button {background:transparent;color:#36535d;font-size:11px;padding:4px 0}
.calendar-mini-days button:hover,.calendar-mini-days button[aria-pressed=true] {background:#dcefeb}
.calendar-mini-days button.today {font-weight:700;color:#0b7567}
.calendar-mini-days button.outside {color:#73858a}
.calendar-layers {display:grid;gap:8px;font-size:13px;color:#30515a}
.calendar-layers input {width:auto;margin:0 4px 0 0;accent-color:#0b7567}
.calendar-main {display:flex;flex-direction:column;overflow:hidden}
.calendar-main .cal-toolbar {padding:10px;margin:0;border-bottom:1px solid #e7eff0}
.calendar-main .cal-toolbar h2 {font-size:clamp(15px,2vw,21px);text-transform:capitalize;margin:0 0 0 4px}
.calendar-small-create {display:none}
.calendar-main .cal-board-month,.cal-timeline {flex:1;border:0;border-radius:0}
.cal-timeline {--hour:48px;min-height:0;overflow:auto}
.cal-timeline-headers,.cal-timeline-body {display:grid;grid-template-columns:var(--cal-columns);min-width:var(--cal-min-width)}
.cal-timeline-headers {position:sticky;top:0;z-index:3}
.cal-timeline-hours,.cal-timeline-day {height:calc(24*var(--hour))}
.cal-timeline-hours div {height:var(--hour);padding:4px;text-align:center;color:#56717a;font-size:11px}
.cal-timeline-day {position:relative;border-left:1px solid #e6eef0;cursor:crosshair;background:repeating-linear-gradient(to bottom,transparent 0 calc(var(--hour) - 1px),#e6eef0 calc(var(--hour) - 1px) var(--hour))}
.cal-timeline-day.today {background-color:#f4faf9}
.cal-timeline-day .cal-entry {position:absolute;top:calc(var(--start)*var(--hour)/60);height:calc(var(--duration)*var(--hour)/60);max-height:calc(100% - var(--start)*var(--hour)/60);margin:0;
  left:calc(var(--lane)*100%/var(--lanes) + 2px);width:calc(100%/var(--lanes) - 4px);border-radius:6px;padding:3px 5px;
  display:flex;flex-direction:column;justify-content:flex-start;align-items:stretch;line-height:1.1;white-space:normal}
.cal-timeline-day .cal-entry small {font-size:10px;white-space:nowrap;line-height:1.15}
.cal-timeline-day .cal-entry-title {display:block;overflow-wrap:anywhere;line-height:1.12;font-size:12px;font-weight:600}
.cal-timeline-day .cal-entry.event {background:#dcebef;color:#173c48;border-left:2px solid #61a3af}
.cal-timeline-day .cal-entry.event:hover {background:#cee4e9}
.cal-entry.post {background:#f8ecd5;color:#664b18}
.cal-now {position:absolute;top:calc(var(--start)*var(--hour)/60);left:0;right:0;border-top:2px solid #d45450;pointer-events:none;z-index:2}
.cal-now span {position:absolute;left:2px;bottom:2px;font-size:10px;color:#9e3327;background:#f4faf9}
.calendar-quick-form {display:grid;gap:7px}
.calendar-quick-form input,.calendar-quick-form select,.calendar-quick-form textarea {margin:0}
.calendar-quick-tabs,.calendar-quick-form footer {display:flex;gap:8px;flex-wrap:wrap}
.calendar-quick-tabs button[aria-pressed=true] {background:#0b7567;color:#fff}
.calendar-quick-form footer {justify-content:flex-end;margin-top:8px}
@media(max-width:900px){
  #calendar-view {grid-template-columns:minmax(0,1fr);gap:0;padding:7px}
  .calendar-sidebar {display:none}
  .calendar-small-create {display:inline-flex}
}

#modal.employee-profile-modal {justify-content:flex-end}
#modal.employee-profile-modal .modal-box {width:min(870px,96vw);height:100%;max-height:100vh;border-radius:16px 0 0 16px;background:#eaf2f3}
.employee-profile-layout {display:grid;grid-template-columns:minmax(190px,0.75fr) minmax(0,1.7fr);gap:12px;align-items:start}
.employee-profile-card {padding:16px;border:1px solid #dce8e9;border-radius:12px;background:#fff;color:#294650;min-width:0}
.employee-profile-identity {display:grid;justify-items:center;gap:12px;text-align:center}
.employee-profile-card h3 {margin:0;font-size:16px}
.employee-profile-card p {margin:7px 0 0;overflow-wrap:anywhere}
.employee-profile-card header {display:flex;align-items:center;justify-content:space-between;gap:8px}
.employee-profile-details,.employee-profile-form {display:grid;gap:10px}
.employee-profile-card dl {display:grid;grid-template-columns:minmax(85px,1fr) minmax(0,1.8fr);gap:8px;margin:12px 0 0}
.employee-profile-card dt {font-size:13px;color:#57717b}
.employee-profile-card dd {margin:0;overflow-wrap:anywhere}
.employee-profile-about {white-space:pre-wrap}
.employee-profile-form label {display:grid;gap:3px;font-size:13px}
.employee-profile-form input,.employee-profile-form textarea {margin:0}
#global-me {background:transparent}
#global-me:hover {background:var(--bg-sidebar-hover)}
@media(max-width:650px){.employee-profile-layout {grid-template-columns:1fr}}

#global-sidebar {
  --bg-sidebar-hover:#e3efff1f;
  background:radial-gradient(ellipse at 0% 6%,#4a6ab8 0%,transparent 55%),linear-gradient(170deg,#30488c 4%,#284686 49%,#192e60 100%);
  border-right:1px solid #6c8cce4d;
}
#global-sidebar .global-nav {gap:4px;padding-inline:7px}
#global-sidebar .global-nav button,#global-sidebar .global-bottom-btn {position:relative;color:#dce9ff;min-height:40px;height:44px;background:transparent;box-shadow:none}
.nav-line-icon {flex:0 0 20px;width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.55;stroke-linecap:round;stroke-linejoin:round}
#global-sidebar .global-nav button:hover,#global-sidebar .global-bottom-btn:hover,#global-sidebar #global-me:hover {background:#dce9ff1a;color:white}
#global-sidebar .global-nav button.active {background:#c9dcff38;color:#fff}
#global-sidebar .global-nav button.active::before {content:'';position:absolute;left:2px;inset-block:9px;width:2px;border-radius:4px;background:#b9d8ff}
#global-sidebar .global-nav button:focus-visible,#global-sidebar .global-bottom-btn:focus-visible {outline:2px solid #cce2ff;outline-offset:-2px}
#global-sidebar #global-me {justify-content:center;padding-inline:0;color:#e1ebff}
#global-sidebar.expanded #global-me {justify-content:flex-start;padding-inline:10px}

/* Shared background with an original, low-contrast line pattern. */
:root {
  --workspace-background:
    radial-gradient(circle at 22px 26px,transparent 0 7px,#ffffff17 7px 8px,transparent 8px),
    radial-gradient(circle at 61px 55px,#ffffff24 0 1px,transparent 2px),
    linear-gradient(128deg,transparent 46%,#ffffff12 48% 52%,transparent 54%),
    linear-gradient(145deg,#719bc5 4%,#74accb 52%,#86c7ca 100%);
  --workspace-size:92px 81px,92px 81px,18px 28px,100% 100%;
}
#messages,.task-chat-messages,#tasks-view,#calendar-view,#struct-view,#users-view,
#modal.employee-profile-modal .modal-box {
  background:var(--workspace-background);
  background-size:var(--workspace-size);
}
#messages .empty {color:#153b59}
.msg .time,.msg .author {color:#173b55}
#messages .msg.own .text:not(.deleted),.task-chat-messages .msg.own .text:not(.deleted) {background:#dff6ee;color:#153a37}
#messages .msg.own .mention {color:#18598a;background:#cbe9ef}
#tasks-view .tasks-header {background:#24446c}
#tasks-view .task-controls,#tasks-view .daily-toolbar,#struct-view .users-header,#struct-view > .task-filters,
#users-view .employee-directory-bar {
  background:#f6fafddf;border:1px solid #e1edf6;border-radius:12px;padding:10px 12px;color:#243f58;
}
#struct-view .users-header,#users-view .employee-directory-bar {margin-bottom:10px;gap:8px;flex-wrap:wrap}
#struct-view .users-header > div {flex-wrap:wrap}
#org-layout-status {background:#f6fafdce;color:#26435b;padding:5px 9px;margin-bottom:8px;border-radius:6px;align-self:flex-start;font-size:12px}
.org-workspace {display:grid;grid-template-columns:minmax(0,1fr) minmax(205px,27%);flex:1;min-height:320px;gap:10px}
.org-workspace #org-directory {display:block;min-width:0;overflow:auto}
.org-workspace #org-details {min-height:0;overflow:auto;margin:0}
.org-workspace .struct-board {position:relative;min-width:0;min-height:0;overflow:auto;border-radius:12px;margin:0;padding:0;
  background:radial-gradient(circle,#9eb8d175 1px,transparent 1.5px) 0 0/19px 19px,#edf4fa;border:1px solid #d5e5f1}
.org-workspace .struct-node {width:207px;min-width:0;min-height:96px;padding:11px 12px 0;border:1px solid #d1e0ef;
  background:#fff;color:#233f55;box-shadow:0 2px 6px #274f7515}
.org-workspace .struct-node.root {background:#e6f0fc;color:#1c3e69;border-color:#94b4db}
.org-workspace .struct-node[aria-current=true] {border-color:#477ec5;box-shadow:0 0 0 3px #8bb9e86b}
.org-node-name {display:block;max-width:calc(100% - 34px);color:inherit;background:transparent;padding:0;font:inherit;font-weight:700;overflow-wrap:anywhere;text-align:left}
.org-node-name:hover {background:transparent;text-decoration:underline;color:#235a94}
.org-node-person {display:flex;align-items:center;gap:7px;margin:7px 0;font-size:12px}
.org-node-person span {min-width:0;overflow-wrap:anywhere}
.org-node-person small {display:block;font-size:10px;color:#506986}
.org-workspace .struct-node footer {margin:8px -12px 0;padding:6px 12px;font-size:11px;color:#3a5774;border-top:1px solid #ddeaf3}
.org-details-head,.org-detail-actions,.org-detail-person {display:flex;align-items:center;gap:6px}
.org-details-head {justify-content:space-between}
.org-details-head h3 {margin:0;overflow-wrap:anywhere;font-size:17px}
.org-detail-actions {flex-wrap:wrap;margin:8px 0}
.org-detail-total {color:#355777;margin:8px 0;font-size:12px}
.org-parent {color:#536e84;font-size:12px}
.org-detail-person .user-row {flex:1;min-width:0;background:#f1f6fc;color:#294858;text-align:left}
.org-detail-person .user-row:hover {background:#dceaf8}
.org-message {flex:none}
.employee-directory-bar input {width:min(360px,100%);margin:0}
.employee-table-shell {overflow:auto;border:1px solid #dce8f0;border-radius:12px;min-width:0;background:#fff}
.employee-table-shell .users-table {min-width:670px;overflow:visible}
.employee-table-shell .users-table th {position:sticky;top:0;background:#ecf4fb;color:#35546d;text-transform:none;white-space:nowrap;z-index:1}
.employee-table-shell td,.employee-table-shell th {padding:8px 11px}
.employee-table-shell tr:hover td {background:#f3f8fc}
.employee-directory-person {display:flex;align-items:center;text-align:left;gap:8px;padding:0;background:transparent;color:#225184}
.employee-directory-person:hover {background:transparent;text-decoration:underline}
.employee-directory-person small {display:block;font-size:11px;color:#4f6476}
.employee-table-shell a {color:#245e9a}
.employee-missing {color:#667c91}
.employee-online {display:inline-flex;gap:5px;align-items:center;white-space:nowrap;font-size:12px;color:#53697c}
.employee-online::before {content:'';width:7px;height:7px;border-radius:50%;background:#a3b5c5}
.employee-online.on::before {background:#26815d}
@media(max-width:750px){
  .org-workspace {grid-template-columns:1fr;grid-template-rows:minmax(340px,55vh) auto}
  .org-workspace #org-details {overflow:visible}
}

#modal.task-create .modal-box > .modal-actions {display:none}
.task-create-form .task-person-control {padding:8px 10px;background:#fff;min-width:0}
.task-create-form .task-person-control summary {display:flex;justify-content:space-between;align-items:center;gap:6px;min-height:22px;list-style:none}
.task-create-form .task-person-control summary::-webkit-details-marker {display:none}
.task-person-control summary::after {content:'⌄';flex:none;color:#315d73}
.task-person-control[open] summary::after {content:'⌃'}
.task-person-control summary > span {color:#315d73;font-size:12px}
.task-person-control summary > b {flex:1;min-width:0;overflow-wrap:anywhere;font-size:13px;font-weight:600}
.task-person-control .task-member-list {max-height:210px}
.task-person-control .task-member-picker input {margin:0}
.task-member-row:has(input:checked) {background:#dcedf5}
.task-people-empty {margin:0;color:#546d7c;font-size:12px}
.cal-timeline-hours,.cal-timeline-day {height:calc(var(--cal-timeline-minutes,1440)*var(--hour)/60)}
.cal-timeline-day .cal-entry {height:auto;min-height:calc(var(--duration)*var(--hour)/60);max-height:none;overflow:visible}
.cal-timeline-day .cal-entry-title {white-space:pre-wrap;overflow-wrap:anywhere}
.org-canvas {position:relative;flex:none;transform-origin:top left}
.org-zoom-controls {display:flex;gap:5px;align-items:center;flex-wrap:wrap}
.org-zoom-controls output {min-width:46px;color:#294a69;text-align:center;font-size:13px;font-variant-numeric:tabular-nums}
.org-zoom-controls button:disabled {opacity:.5;cursor:default}

#modal.employee-create-modal {justify-content:flex-end}
#modal.employee-create-modal .modal-box {width:min(800px,97vw);height:100%;max-height:100vh;border-radius:16px 0 0 16px;background:#edf4fa}
#modal.employee-create-modal .modal-box > .modal-actions {display:none}
.employee-create-form {display:grid;gap:12px}
.employee-create-form section {display:grid;gap:9px;padding:14px;background:white;border:1px solid #dce8f1;border-radius:12px}
.employee-create-form section h3 {margin:0 0 4px;color:#234965;font-size:15px}
.employee-create-form label {display:grid;gap:4px;min-width:0;font-size:13px;color:#31576c}
.employee-create-form input,.employee-create-form select {margin:0}
.employee-create-form footer {display:flex;justify-content:flex-end;gap:7px;flex-wrap:wrap}
.voice-draft {display:flex;align-items:center;gap:9px;flex-wrap:wrap;padding:6px 12px;background:#eaf4f8;color:#284f66}
.voice-draft audio,.message-audio audio {width:min(260px,100%);height:34px}
.message-audio {display:flex;align-items:center;gap:5px;max-width:100%;padding:5px 8px;background:#f6fafc;border-radius:13px}
.message-audio a {font-weight:700;color:#255375;padding:3px}
#composer .composer-tool {padding-inline:7px;flex:none;font-size:15px}
#composer #msginput {min-width:0}
@media(max-width:620px){#composer {gap:4px;padding-inline:5px} #composer .attach-btn {padding-inline:4px}}

#chat-gallery {width:min(540px,94vw);max-height:90vh;padding:14px;border:1px solid #d5e5ee;border-radius:14px;color:#294a63;background:#fff;box-shadow:0 12px 40px #17375145}
#chat-gallery::backdrop {background:#12365866}
#chat-gallery form {display:grid;gap:8px}
#chat-gallery header,#chat-gallery footer,.gallery-options {display:flex;align-items:center;justify-content:space-between;gap:8px;flex-wrap:wrap}
#chat-gallery header h2 {margin:0;font-size:17px}
#chat-gallery footer {justify-content:flex-end}
#chat-gallery textarea {margin:0;resize:vertical}
.gallery-previews {display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:7px;max-height:42vh;overflow:auto}
.gallery-previews.single {grid-template-columns:1fr}
.gallery-previews figure {position:relative;margin:0;min-width:0;background:#edf5fa;border-radius:8px;overflow:hidden}
.gallery-previews img {width:100%;height:104px;display:block;object-fit:cover}
.gallery-previews.single img {height:min(240px,36vh);object-fit:contain}
.gallery-previews figure button {position:absolute;top:3px;right:3px;padding:1px 5px}
.message-gallery {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:5px;width:min(380px,100%);min-width:0;margin-top:4px}
.message-gallery .img-wrap {margin:0;min-width:0}
.message-gallery .img-wrap img {display:block;width:100%;height:120px;object-fit:cover;border-radius:9px}
.message-gallery .download-btn {font-size:11px;padding:3px}

.chat-line-icon {width:24px;height:24px;flex:none;display:block;fill:none;stroke:currentColor;stroke-width:1.9;stroke-linecap:round;stroke-linejoin:round}
#composer .attach-btn,#composer .send-btn,#composer .composer-tool {
  display:grid;place-items:center;flex:none;width:42px;height:42px;padding:0;border:0;border-radius:10px;
  background:transparent;color:#244961;box-shadow:none;
}
#composer .send-btn {color:#185291}
#composer #voice-record .chat-line-icon,#composer .send-btn .chat-line-icon {width:27px;height:27px}
#composer .attach-btn:hover,#composer .send-btn:hover {background:#e8f1f8;color:#173b62}
#composer :is(.attach-btn,.send-btn):focus-visible,.hdr-actions .chat-icon-btn:focus-visible {outline:2px solid #2f679f;outline-offset:1px}
#voice-record .mic-stop,#voice-record.is-recording .mic-outline {display:none}
#voice-record.is-recording .mic-stop {display:block}
#composer #voice-record.is-recording {color:#b32e34}
.hdr-actions .chat-icon-btn {background:transparent;color:#284f69}
.hdr-actions .chat-icon-btn .chat-line-icon {width:20px;height:20px}
.ticks,.ticks.read {margin-left:2px;color:#234661;letter-spacing:normal}
.ticks.read {color:#173f70}
.ticks .chat-line-icon {width:19px;height:15px;stroke-width:2}
@media(max-width:620px){#composer .attach-btn,#composer .send-btn,#composer .composer-tool {width:36px;height:40px}}

.workspace-chrome {display:flex;align-items:center;gap:7px;flex:none;height:43px;min-width:0;padding:4px 5px 4px 8px;
  background:linear-gradient(110deg,#e1edf9,#d4e4f6);border-bottom:1px solid #aebfe0;color:#233f61;position:relative;z-index:12500;user-select:none}
.workspace-navigation,.workspace-window,.workspace-tabs {display:flex;align-items:center;gap:3px;min-width:0}
.workspace-chrome button,.workspace-chrome .workspace-add-tab summary {background:transparent;color:inherit;padding:0 6px;border:0;border-radius:6px;min-width:28px;height:29px;font-size:16px}
.workspace-chrome button:hover,.workspace-chrome .workspace-add-tab summary:hover {background:#b4cbe773}
.workspace-chrome button:disabled {opacity:.33;cursor:default}
.workspace-chrome button:focus-visible {outline:2px solid #4272a9;outline-offset:-2px}
.workspace-tabs {overflow-x:auto;scrollbar-width:none;flex:0 1 auto;padding:1px 0}
.workspace-tab {display:flex;align-items:center;gap:1px;padding:0 3px;border-radius:8px;flex:none;min-width:85px;max-width:180px;background:#d6e5f4;border:1px solid transparent}
.workspace-tab.active {background:#fff;border-color:#aec6df;box-shadow:0 1px 3px #344c7821}
.workspace-tab button:first-child {font-size:12px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0;text-align:left;padding-inline:7px;flex:1}
.workspace-tab .workspace-tab-close {height:24px;min-width:23px;padding-inline:4px;font-size:15px}
.workspace-drag {flex:1;align-self:stretch;min-width:24px;display:flex;align-items:center;justify-content:center;cursor:default}
.workspace-drag span {font-size:12px;color:#527092;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;padding-inline:5px}
.workspace-window {display:none;flex:none}
.desktop-shell .workspace-window {display:flex}
.workspace-window .workspace-close:hover {background:#ba2c39;color:white}
.workspace-add-tab .chat-menu-items {left:0;right:auto}
.workspace-add-tab .chat-menu-items button {font-size:13px;text-align:left}
.workspace-resize {position:fixed;right:0;bottom:0;width:17px;height:17px;z-index:13000;cursor:nwse-resize;touch-action:none;
  background:linear-gradient(135deg,transparent 58%,#4b77a880 60% 65%,transparent 67% 72%,#4b77a880 74% 79%,transparent 81%)}
body:not(.app-logged) .workspace-chrome :is(.workspace-navigation,.workspace-tabs,.workspace-add-tab) {display:none}
.app-logged #app {flex:1;height:auto;min-height:0}
@media(max-width:700px){.workspace-chrome {gap:3px}.workspace-drag span {display:none}.workspace-tab {max-width:125px}}

#drive-view {height:100%;overflow:auto;display:grid;align-content:start;gap:12px;padding:clamp(10px,2vw,24px);background:var(--workspace-background);background-size:var(--workspace-size)}
.drive-card {padding:14px;border:1px solid #d5e5ee;border-radius:12px;background:#fff;color:#284762}
.drive-header,.drive-link {display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.drive-header h2,.drive-card h3 {margin:0;flex:1}
.drive-header a {text-decoration:none;border-radius:8px}
.drive-form {display:grid;grid-template-columns:repeat(auto-fit,minmax(160px,1fr));align-items:end;gap:10px}
.drive-form label {min-width:0;font-size:13px}
.drive-form input {margin-bottom:0}
.drive-link {padding:9px 0;border-bottom:1px solid #deebf2}
.drive-link:last-child {border-bottom:0}
.drive-link a {flex:1;min-width:100px;overflow-wrap:anywhere;color:#225c92}
.drive-chat-choice {display:block;width:100%;margin:4px 0;text-align:left}
.msg .text a {color:#185586;text-decoration:underline;overflow-wrap:anywhere}
