:root{--bg:#0f0f11;--surface:#18181c;--surface2:#222228;--border:rgba(255,255,255,0.07);--border2:rgba(255,255,255,0.12);--text:#e8e8ec;--text2:#aaaabc;--text3:#6e6e80;--accent:#5b6af0;--accent2:#7b8af8;--success:#2dd98d;--warning:#f0b429;--danger:#f06060;--radius:10px;--radius-lg:14px;--sidebar-font:13px;--table-font:13px;--chat-font:14px;--detail-font:13px;--subtask-font:13px;--badge-color:var(--text);--av-size:22px;--av-font:10px;--av-radius:5px;}
*{box-sizing:border-box;margin:0;padding:0;}
body{font-family:'DM Sans',sans-serif;background:var(--bg);color:var(--text);height:100vh;display:flex;font-size:14px;}
.sidebar{width:220px;background:var(--surface);border-right:1px solid var(--border);display:flex;flex-direction:column;flex-shrink:0;transition:transform 0.25s;height:100vh;overflow:hidden;}.sidebar-overlay{display:none;position:fixed;inset:0;background:rgba(0,0,0,0.5);z-index:90;}
.hamburger{display:none;align-items:center;justify-content:center;width:36px;height:36px;border:none;background:none;cursor:pointer;color:var(--text);}
@media(max-width:700px){
  .sidebar{position:fixed;top:0;left:0;height:100vh;z-index:100;transform:translateX(-100%);width:200px!important;}
  .sidebar.open{transform:translateX(0);}
  .sidebar-overlay.open{display:block;}
  .hamburger{display:flex;}
  .main{width:100%;min-width:0;}
  .content{padding:12px!important;}
  .topbar{padding:10px 12px!important;}
  }
.logo{padding:20px 18px 16px;border-bottom:1px solid var(--border);}
.logo-text{font-size:15px;font-weight:500;}
.logo-dot{display:inline-block;width:7px;height:7px;background:var(--accent);border-radius:50%;margin-right:8px;}
.nav{flex:1;padding:12px 8px;overflow-y:auto;min-height:0;}
.nav-section{margin-bottom:14px;}
.nav-label{font-size:10px;font-weight:500;color:var(--text3);letter-spacing:0.08em;text-transform:uppercase;padding:0 10px;margin-bottom:6px;display:flex;align-items:center;justify-content:space-between;}
.nav-label-add{cursor:pointer;color:var(--text3);font-size:14px;line-height:1;padding:0 10px;}
.nav-label-add:hover{color:var(--text2);}
.nav-item{display:flex;align-items:center;gap:8px;padding:4px 10px;border-radius:var(--radius);cursor:pointer;color:var(--text2);font-size:var(--sidebar-font);transition:all 0.15s;position:relative;}
.nav-item:hover{background:var(--surface2);color:var(--text);}
.nav-item.active{background:var(--accent);color:#fff;}
.nav-count{margin-left:auto;font-size:12px;font-weight:600;background:var(--surface2);color:var(--badge-color);padding:1px 7px;border-radius:20px;}
.nav-count.unread{background:var(--accent);color:#fff;}
.nav-dot{width:8px;height:8px;border-radius:50%;flex-shrink:0;}
.nav-item .edit-proj{display:none;position:absolute;right:8px;color:var(--text3);font-size:11px;}
.nav-item:hover .edit-proj{display:block;}
.nav-item:hover .nav-count{display:none;}
.channel-item{display:flex;align-items:center;gap:8px;padding:4px 10px;border-radius:var(--radius);cursor:pointer;color:var(--text2);font-size:var(--sidebar-font);transition:all 0.15s;}
.channel-item:hover{background:var(--surface2);color:var(--text);}
.channel-item.active{background:var(--accent);color:#fff;}
.dm-item{display:flex;align-items:center;gap:8px;padding:4px 10px;border-radius:var(--radius);cursor:pointer;color:var(--text2);font-size:var(--sidebar-font);transition:all 0.15s;}
.dm-item:hover{background:var(--surface2);color:var(--text);}
.dm-item.active{background:var(--accent);color:#fff;}
/* TOPBAR INFO */
.topbar-info{display:flex;flex-direction:column;justify-content:center;flex:1;}
.topbar-title{font-size:16px;font-weight:500;}
.topbar-subtitle{font-size:12px;color:var(--text3);margin-top:2px;}
/* LOGIN SCREEN */
.login-screen{position:fixed;top:0;left:0;right:0;bottom:0;width:100%;height:100%;background:var(--bg);display:flex;align-items:center;justify-content:center;z-index:1000;}
#app-wrapper{display:flex;}
#app-wrapper[hidden]{display:none!important;}
.login-box{background:var(--surface);border:1px solid var(--border2);border-radius:var(--radius-lg);padding:36px;width:340px;box-shadow:0 20px 60px rgba(0,0,0,0.5);}
.login-logo{text-align:center;margin-bottom:28px;}
.login-logo-dot{display:inline-block;width:8px;height:8px;background:var(--accent);border-radius:50%;margin-right:6px;}
.login-logo-text{font-size:18px;font-weight:500;}
.login-title{font-size:13px;color:var(--text2);text-align:center;margin-bottom:24px;}
.login-field{display:flex;flex-direction:column;gap:6px;margin-bottom:14px;}
.login-field label{font-size:12px;color:var(--text2);font-weight:500;}
.login-field input{background:var(--surface2);border:1px solid var(--border);border-radius:var(--radius);padding:9px 12px;color:var(--text);font-size:13px;font-family:inherit;outline:none;transition:border-color 0.15s;}
.login-field input:focus{border-color:var(--accent);}
.login-btn{width:100%;padding:10px;background:var(--accent);border:none;border-radius:var(--radius);color:#fff;font-size:13px;font-family:inherit;cursor:pointer;margin-top:6px;transition:background 0.15s;}
.login-btn:hover{background:var(--accent2);}
.login-error{font-size:12px;color:var(--danger);text-align:center;margin-top:8px;min-height:18px;}
/* ADMIN PASSWORD MODAL */
.admin-lock-overlay{position:fixed;inset:0;background:rgba(0,0,0,0.6);display:flex;align-items:center;justify-content:center;z-index:200;backdrop-filter:blur(4px);}
.admin-lock-box{background:var(--surface);border:1px solid var(--border2);border-radius:var(--radius-lg);padding:28px;width:320px;box-shadow:0 20px 60px rgba(0,0,0,0.5);}
.admin-lock-title{font-size:15px;font-weight:500;margin-bottom:6px;}
.admin-lock-sub{font-size:12px;color:var(--text3);margin-bottom:20px;}
/* CHAT TABS */
.chat-tabs{display:flex;gap:0;border-bottom:1px solid var(--border);flex-shrink:0;}
.chat-tab{padding:8px 16px;font-size:12px;cursor:pointer;color:var(--text3);border-bottom:2px solid transparent;margin-bottom:-1px;transition:all 0.15s;}
.chat-tab:hover{color:var(--text2);}
.chat-tab.active{color:var(--accent2);border-bottom-color:var(--accent);}
/* DATE SEPARATOR */
.date-sep{display:flex;align-items:center;gap:10px;padding:12px 0;margin:4px 0;}
.date-sep-line{flex:1;height:1px;background:var(--border);}
.date-sep-label{font-size:12px;color:var(--text3);font-weight:500;white-space:nowrap;padding:3px 10px;border:1px solid var(--border);border-radius:20px;background:var(--surface);}
.linked-msg{display:flex;gap:8px;padding:8px 12px;border-radius:var(--radius);background:var(--surface2);margin-bottom:6px;font-size:12px;cursor:pointer;border:1px solid var(--border);}
.linked-msg:hover{border-color:var(--border2);}
.linked-msg-chan{font-size:11px;color:var(--accent2);margin-bottom:2px;}
.linked-msg-text{color:var(--text2);line-height:1.4;}
.user-av{width:var(--av-size);height:var(--av-size);border-radius:var(--av-radius);font-size:var(--av-font);font-weight:500;display:flex;align-items:center;justify-content:center;flex-shrink:0;background:rgba(91,106,240,0.2);color:var(--accent2);}
.online-dot{width:7px;height:7px;border-radius:50%;background:var(--success);flex-shrink:0;}
.sidebar-bottom{padding:12px 8px;border-top:1px solid var(--border);flex-shrink:0;background:var(--surface);}
.user-btn{display:flex;align-items:center;gap:10px;padding:8px 10px;border-radius:var(--radius);cursor:pointer;transition:background 0.15s;}
.user-btn:hover{background:var(--surface2);}
.avatar{width:var(--av-size);height:var(--av-size);border-radius:var(--av-radius);background:rgba(91,106,240,0.2);color:var(--accent2);font-size:var(--av-font);font-weight:500;display:flex;align-items:center;justify-content:center;flex-shrink:0;}
.main{flex:1;display:flex;flex-direction:column;overflow:hidden;height:100vh;min-width:0;}
.topbar{padding:0 24px;border-bottom:1px solid var(--border);display:flex;align-items:center;gap:12px;flex-shrink:0;height:61px;}
.topbar-title{font-size:16px;font-weight:500;flex:1;}
.btn{display:inline-flex;align-items:center;gap:6px;padding:7px 14px;border-radius:var(--radius);border:1px solid var(--border2);background:var(--surface2);color:var(--text);font-size:13px;cursor:pointer;transition:all 0.15s;font-family:inherit;}
.btn:hover{background:var(--surface);}
.btn-primary{background:var(--accent);border-color:var(--accent);color:#fff;}
.btn-primary:hover{background:var(--accent2);border-color:var(--accent2);}
.btn-danger{background:rgba(240,96,96,0.15);border-color:rgba(240,96,96,0.3);color:var(--danger);}
.btn-sm{padding:4px 10px;font-size:12px;}
.content{flex:1;overflow-y:auto;padding:24px;}
/* FILTERS & TABLE */
.filters{display:flex;gap:8px;margin-bottom:16px;flex-wrap:wrap;align-items:center;}
.filter-btn{padding:5px 12px;border-radius:20px;border:1px solid var(--border);background:none;color:var(--text2);font-size:12px;cursor:pointer;font-family:inherit;transition:all 0.15s;display:flex;align-items:center;gap:5px;}
.filter-btn:hover{border-color:var(--border2);color:var(--text);}
.filter-btn.active{background:rgba(91,106,240,0.15);border-color:rgba(91,106,240,0.4);color:var(--accent2);}
.filter-dot{width:6px;height:6px;border-radius:50%;}
.cols-btn{margin-left:0;padding:5px 10px;border-radius:var(--radius);border:1px solid var(--border);background:none;color:var(--text3);font-size:12px;cursor:pointer;font-family:inherit;display:flex;align-items:center;gap:5px;}
.cols-btn:hover{color:var(--text2);border-color:var(--border2);}
.table-wrap{border:1px solid var(--border);border-radius:var(--radius-lg);overflow:hidden;}
table{width:100%;border-collapse:collapse;table-layout:fixed;}
.task-name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
thead{background:var(--surface);}
th{text-align:left;padding:11px 14px;font-size:11px;font-weight:600;color:var(--text2);letter-spacing:0.06em;text-transform:uppercase;border-bottom:1px solid var(--border2);white-space:nowrap;cursor:pointer;background:var(--surface);}
th:hover{color:var(--text2);}
td{padding:11px 14px;border-bottom:1px solid var(--border);vertical-align:middle;font-size:var(--table-font);}
tr:last-child td{border-bottom:none;}
tr:hover td{background:rgba(255,255,255,0.02);}
tr.done td{opacity:0.4;}
.cb{width:15px;height:15px;border:1.5px solid var(--border2);border-radius:4px;cursor:pointer;display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;transition:all 0.15s;}
.cb:hover{border-color:var(--accent);}
.cb.checked{background:var(--success);border-color:var(--success);}
.cb.checked::after{content:'';width:8px;height:5px;border-left:1.5px solid #000;border-bottom:1.5px solid #000;transform:rotate(-45deg) translate(1px,-1px);display:block;}
.task-title{display:flex;align-items:center;gap:8px;}
.task-name{color:var(--text);flex:1;cursor:pointer;font-weight:500;}
.task-name:hover{color:var(--accent2);}
.sub-count{font-size:11px;color:var(--text3);}
.expand-btn{width:16px;height:16px;cursor:pointer;color:var(--text3);display:inline-flex;align-items:center;justify-content:center;transition:transform 0.15s;flex-shrink:0;}
.expand-btn.open{transform:rotate(90deg);}
.prio{display:inline-flex;align-items:center;font-size:12px;padding:3px 8px;border-radius:20px;white-space:nowrap;}
.prio-hoch{background:rgba(240,96,96,0.18);color:#f07070;font-weight:500;}
.prio-mittel{background:rgba(240,180,41,0.18);color:#e8b840;font-weight:500;}
.prio-niedrig{background:rgba(45,217,141,0.18);color:#3dcc8e;font-weight:500;}
.status-badge{display:inline-flex;align-items:center;gap:5px;font-size:12px;color:var(--text);}
.status-dot{width:6px;height:6px;border-radius:50%;flex-shrink:0;}
.dot-offen{background:var(--text3);}.dot-laufend{background:var(--accent);}.dot-fertig{background:var(--success);}
.date-cell{font-size:12px;font-family:'DM Mono',monospace;white-space:nowrap;}
.overdue{color:var(--danger);}.soon{color:var(--warning);}.date-ok{color:var(--text);}
.av-stack{display:flex;align-items:center;gap:4px;}
.av{width:var(--av-size);height:var(--av-size);border-radius:var(--av-radius);font-size:var(--av-font);font-weight:500;display:flex;align-items:center;justify-content:center;margin-left:5px;flex-shrink:0;}
.av:first-child{margin-left:0;}
.av-b{background:rgba(91,106,240,0.2);color:var(--accent2);}
.av-p{background:rgba(180,91,240,0.2);color:#c090f8;}
.av-t{background:rgba(45,217,141,0.2);color:var(--success);}
.av-a{background:rgba(240,180,41,0.2);color:var(--warning);}
.proj-tag{font-size:11px;padding:3px 9px;border-radius:5px;white-space:nowrap;font-weight:500;}
.subtask-inner{display:flex;align-items:center;gap:8px;padding:6px 14px 6px 48px;font-size:var(--subtask-font);color:var(--text2);border-bottom:1px solid var(--border);background:rgba(255,255,255,0.01);}
/* MYDAY */
.myday-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(280px,1fr));gap:12px;}
.proj-card{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius-lg);padding:14px 16px;}
.proj-card-link{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius-lg);padding:12px 14px;cursor:pointer;transition:border-color 0.15s;}
.proj-card-link:hover{border-color:var(--border2);}
.proj-card-header{display:flex;align-items:center;gap:8px;margin-bottom:12px;font-size:13px;font-weight:500;}
.proj-task{display:flex;align-items:center;gap:8px;padding:6px 0;border-bottom:1px solid var(--border);font-size:13px;}
.proj-task:last-child{border-bottom:none;}
/* CHAT */
.chat-layout{display:flex;height:100%;overflow:hidden;}
.chat-sidebar{width:180px;border-right:1px solid var(--border);padding:12px 8px;flex-shrink:0;overflow-y:auto;}
@media(max-width:700px){.chat-sidebar{display:none;}.chat-main{width:100%!important;}}
@media(max-width:700px){.chat-sidebar{display:none;} .chat-main{width:100%;}}
.chat-main{flex:1;display:flex;flex-direction:column;overflow:hidden;}
.chat-header{padding:12px 20px;border-bottom:1px solid var(--border);display:flex;align-items:center;gap:8px;flex-shrink:0;font-weight:500;font-size:14px;}
.chat-messages{flex:1;overflow-y:auto;padding:16px 20px;display:flex;flex-direction:column;gap:4px;min-height:0;}
/* MSG AVATAR */
.msg{display:flex;align-items:flex-start;padding:3px 8px;border-radius:var(--radius);position:relative;line-height:1.6;gap:0;}
.msg:hover{background:rgba(255,255,255,0.03);}
.msg-avatar{width:var(--av-size);height:var(--av-size);border-radius:var(--av-radius);font-size:var(--av-font);font-weight:500;display:flex;align-items:center;justify-content:center;flex-shrink:0;margin-top:3px;letter-spacing:0.02em;}
.msg-actions{display:none;position:absolute;right:8px;top:4px;gap:2px;background:var(--surface);border:1px solid var(--border2);border-radius:8px;padding:3px 4px;z-index:2;box-shadow:0 2px 10px rgba(0,0,0,0.35);}
.msg:hover .msg-actions{display:flex;}
.msg-action-btn{background:none;border:none;cursor:pointer;color:var(--text3);padding:4px 6px;border-radius:5px;display:flex;align-items:center;}
.msg-action-btn:hover{background:var(--surface2);color:var(--text);}
.msg-action-del:hover{background:rgba(240,96,96,0.15);color:var(--danger);}
.msg-av{display:none;}
.msg-body{flex:1;min-width:0;padding-left:10px;display:grid;grid-template-columns:220px 1fr;column-gap:16px;align-items:baseline;}
.msg-initials{display:none;}
.msg-header{grid-column:1;grid-row:1;display:flex;align-items:baseline;gap:6px;flex-wrap:nowrap;overflow:hidden;}
.msg-name{font-size:var(--sidebar-font);font-weight:500;color:var(--text);margin-right:8px;flex-shrink:0;}
.msg-time{font-size:11px;color:var(--text3);font-family:'DM Mono',monospace;white-space:nowrap;flex-shrink:0;}
.msg-sep{color:var(--text3);margin-right:8px;font-size:12px;flex-shrink:0;}
.msg-text{font-size:var(--chat-font);color:var(--text2);line-height:1.6;word-break:break-word;overflow-wrap:anywhere;}
.msg-task-link{display:inline-flex;align-items:center;gap:5px;font-size:12px;padding:3px 8px;border-radius:var(--radius);background:rgba(91,106,240,0.1);color:var(--accent2);margin-top:4px;cursor:pointer;border:1px solid rgba(91,106,240,0.2);vertical-align:top;}
.msg-task-link:hover{background:rgba(91,106,240,0.2);}
.msg-file{display:inline-flex;align-items:center;gap:5px;font-size:12px;padding:3px 8px;border-radius:var(--radius);background:var(--surface2);color:var(--text2);margin-top:4px;cursor:pointer;border:1px solid var(--border);vertical-align:top;}
.chat-input-area{padding:12px 20px;border-top:1px solid var(--border);flex-shrink:0;}
.chat-input-toolbar{display:flex;align-items:center;gap:6px;margin-bottom:6px;}
.toolbar-btn{width:34px;height:34px;border-radius:var(--radius);border:none;background:none;color:var(--text2);cursor:pointer;display:flex;align-items:center;justify-content:center;font-size:18px;transition:all 0.15s;}
.toolbar-btn:hover{background:var(--surface2);color:var(--text);}
.toolbar-btn svg{width:18px;height:18px;}
/* Reply quote */
.reply-quote{display:block;background:var(--surface2);border-left:3px solid var(--accent);border-radius:0 6px 6px 0;padding:5px 10px;margin-top:4px;font-size:12px;color:var(--text2);opacity:0.85;clear:both;}
.reply-quote .rq-name{font-weight:600;color:var(--accent2);margin-bottom:2px;}
.reply-preview{display:flex;align-items:center;gap:8px;padding:6px 12px;background:var(--surface2);border-left:3px solid var(--accent);border-radius:0 6px 6px 0;margin:4px 16px 0;font-size:12px;color:var(--text2);}
.reply-preview .rp-cancel{cursor:pointer;margin-left:auto;color:var(--text3);font-size:16px;}
.task-link-badge{display:inline-flex;align-items:center;gap:6px;font-size:12px;padding:3px 10px;border-radius:20px;background:rgba(91,106,240,0.1);color:var(--accent2);border:1px solid rgba(91,106,240,0.2);margin-bottom:6px;}
.task-link-badge .remove{cursor:pointer;color:var(--text3);margin-left:4px;}
.chat-input-wrap{display:flex;gap:8px;align-items:flex-end;background:var(--surface2);border:1px solid var(--border);border-radius:var(--radius-lg);padding:10px 14px;}
.chat-input{flex:1;background:none;border:none;outline:none;color:var(--text);font-size:13px;font-family:inherit;resize:none;max-height:120px;line-height:1.5;}
.chat-input::placeholder{color:var(--text3);}
.send-btn{width:32px;height:32px;border-radius:var(--radius);background:var(--accent);border:none;cursor:pointer;display:flex;align-items:center;justify-content:center;flex-shrink:0;}
.send-btn:hover{background:var(--accent2);}
/* EMOJI PICKER */
.emoji-picker{position:absolute;bottom:100px;left:20px;background:var(--surface);border:1px solid var(--border2);border-radius:var(--radius-lg);padding:10px;z-index:50;display:grid;grid-template-columns:repeat(8,32px);gap:2px;box-shadow:0 10px 40px rgba(0,0,0,0.4);}
.emoji-btn{width:32px;height:32px;border:none;background:none;cursor:pointer;border-radius:var(--radius);font-size:18px;display:flex;align-items:center;justify-content:center;transition:background 0.1s;}
.emoji-btn:hover{background:var(--surface2);}
.task-detail-top{display:flex;height:45%;min-height:120px;max-height:80%;border-bottom:none;overflow:hidden;flex-shrink:0;}
.task-detail-left{flex:1;min-width:0;overflow-y:auto;overflow-x:hidden;padding:20px 24px;}
.task-detail-right{width:35%;min-width:160px;border-left:1px solid var(--border);display:flex;flex-direction:column;overflow-y:auto;overflow-x:hidden;padding:16px;}
.detail-top-resize{width:5px;background:var(--border);cursor:col-resize;flex-shrink:0;transition:background 0.15s;}
.detail-top-resize:hover,.detail-top-resize.dragging{background:var(--accent);}
/* VERTICAL RESIZE between top and bottom */
.detail-vert-resize{height:8px;background:var(--surface2);cursor:row-resize;flex-shrink:0;display:flex;align-items:center;justify-content:center;border-top:1px solid var(--border);border-bottom:1px solid var(--border);}
.detail-vert-resize:hover,.detail-vert-resize.dragging{background:rgba(91,106,240,0.2);}
.detail-vert-resize::after{content:'';width:40px;height:3px;border-radius:2px;background:var(--border2);}
.detail-vert-resize:hover::after,.detail-vert-resize.dragging::after{background:var(--accent);}
@media(max-width:700px){
  .task-detail-top{flex-direction:column;height:auto;max-height:50vh;}
  .task-detail-right{width:100%;border-left:none;border-top:1px solid var(--border);}
  .detail-top-resize,.detail-vert-resize{display:none;}
}
.task-detail-bottom{display:flex;flex:1;min-height:0;border-top:1px solid var(--border);overflow:hidden;}
.task-detail-chat{flex:1;min-width:0;display:flex;flex-direction:column;overflow:hidden;min-height:0;}
.task-detail-comments{width:40%;min-width:200px;border-left:1px solid var(--border);display:flex;flex-direction:column;overflow:hidden;min-height:0;}
.detail-resize{width:6px;background:var(--border);cursor:col-resize;flex-shrink:0;transition:background 0.15s;position:relative;}
.detail-resize:hover,.detail-resize.dragging{background:var(--accent);}
.detail-resize::after{content:'';position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);width:2px;height:24px;border-radius:2px;background:var(--border2);}
@media(max-width:700px){
  .task-detail-bottom{flex-direction:column;}
  .task-detail-comments{width:100%;border-left:none;border-top:1px solid var(--border);min-height:200px;}
  .task-detail-main{max-height:none;}
}
.back-btn{display:inline-flex;align-items:center;gap:6px;font-size:13px;color:var(--text2);cursor:pointer;margin-bottom:20px;}
.back-btn:hover{color:var(--text);}
.subtask-item{display:flex;align-items:center;gap:8px;padding:7px 4px;border-bottom:1px solid var(--border);font-size:var(--subtask-font);}
.subtask-item.done-item{opacity:1;}
.subtask-title{flex:1;cursor:pointer;color:var(--text);}
.subtask-title:hover{color:var(--text);}
.subtask-title.done-title{color:var(--text);}
.subtask-del{background:none;border:none;cursor:pointer;color:var(--text3);font-size:12px;padding:2px 4px;border-radius:4px;opacity:0;}
.subtask-item:hover .subtask-del{opacity:1;}
.subtask-del:hover{color:var(--danger);}
.sub-move-btn{opacity:1!important;color:var(--accent2)!important;}
.sub-move-btn:hover{color:var(--accent)!important;}
.sub-attach-btn{background:none;border:none;padding:2px 4px;}
.subtask-item:hover .sub-attach-btn{opacity:1!important;}
.subtask-add-input{width:100%;background:none;border:none;border-bottom:1px dashed var(--border2);padding:7px 2px;color:var(--text);font-size:var(--detail-font);font-family:inherit;outline:none;margin-top:6px;}
.subtask-add-input:focus{border-bottom-color:var(--accent);}
.subtask-add-input::placeholder{color:var(--text3);}
.detail-grid{display:grid;grid-template-columns:1fr 1fr;gap:16px;margin-bottom:20px;}
.detail-label{font-size:11px;font-weight:500;color:var(--text3);text-transform:uppercase;letter-spacing:0.05em;margin-bottom:6px;}
.detail-select{background:var(--surface);border:1px solid var(--border);border-radius:6px;color:var(--text);font-size:13px;font-family:inherit;outline:none;cursor:pointer;padding:4px 6px;color-scheme:dark;}
/* COLUMNS PANEL */
.cols-panel{position:absolute;top:48px;right:0;width:260px;background:var(--surface);border:1px solid var(--border2);border-radius:var(--radius-lg);z-index:40;box-shadow:0 10px 40px rgba(0,0,0,0.4);overflow:hidden;}
.cols-panel-header{padding:10px 14px;border-bottom:1px solid var(--border);font-size:13px;font-weight:500;display:flex;align-items:center;justify-content:space-between;}
.col-row{display:flex;align-items:center;gap:10px;padding:8px 14px;border-bottom:1px solid var(--border);font-size:13px;cursor:grab;}
.col-row:last-child{border-bottom:none;}
.col-row:hover{background:var(--surface2);}
.col-row.dragging{opacity:0.5;}
.col-toggle{width:32px;height:18px;border-radius:9px;cursor:pointer;position:relative;transition:background 0.2s;flex-shrink:0;}
.col-toggle.on{background:var(--accent);}
.col-toggle.off{background:var(--border2);}
.col-toggle-thumb{position:absolute;top:2px;width:14px;height:14px;border-radius:50%;background:#fff;transition:left 0.2s;}
.col-toggle.on .col-toggle-thumb{left:16px;}
.col-toggle.off .col-toggle-thumb{left:2px;}
.drag-handle{color:var(--text3);font-size:14px;cursor:grab;}
/* SETTINGS PANEL */
.settings-overlay{position:fixed;inset:0;z-index:500;background:rgba(0,0,0,0.6);}
.settings-header{padding:16px 20px;border-bottom:1px solid var(--border);font-size:15px;font-weight:600;display:flex;align-items:center;justify-content:space-between;background:var(--surface);flex-shrink:0;}
.settings-section{padding:14px 20px;border-bottom:1px solid var(--border);}

.settings-section:last-child{border-bottom:none;}
.settings-label{font-size:10px;font-weight:500;color:var(--text3);letter-spacing:0.08em;text-transform:uppercase;margin-bottom:10px;}
.size-btns{display:flex;gap:6px;}
.size-btn{flex:1;padding:6px;border:1px solid var(--border);border-radius:var(--radius);background:none;color:var(--text2);font-size:12px;cursor:pointer;font-family:inherit;text-align:center;transition:all 0.15s;}
.size-btn:hover{border-color:var(--border2);color:var(--text);}
.size-btn.active{border-color:var(--accent);background:rgba(91,106,240,0.15);color:var(--accent2);}
.color-swatches{display:flex;gap:8px;flex-wrap:wrap;}
.swatch{width:22px;height:22px;border-radius:50%;cursor:pointer;border:2px solid transparent;transition:border-color 0.15s;}
.swatch.active{border-color:#fff;}
.toggle-row{display:flex;align-items:center;justify-content:space-between;margin-bottom:8px;font-size:13px;color:var(--text);}
.toggle-row:last-child{margin-bottom:0;}
.toggle{width:32px;height:18px;border-radius:9px;cursor:pointer;position:relative;transition:background 0.2s;flex-shrink:0;}
.toggle.on{background:var(--success);}
.toggle.off{background:var(--border2);}
.toggle-thumb{position:absolute;top:2px;width:14px;height:14px;border-radius:50%;background:#fff;transition:left 0.2s;}
.toggle.on .toggle-thumb{left:16px;}
.toggle.off .toggle-thumb{left:2px;}
.reset-select{width:100%;padding:7px 10px;border-radius:var(--radius);border:1px solid var(--border);background:var(--surface2);color:var(--text2);font-size:12px;font-family:inherit;outline:none;margin-bottom:8px;}
.save-settings{width:100%;padding:9px;background:var(--accent);border:none;border-radius:var(--radius);color:#fff;font-size:13px;font-family:inherit;cursor:pointer;}
.save-settings:hover{background:var(--accent2);}
/* ADMIN */
.admin-grid{display:grid;grid-template-columns:200px 1fr;gap:0;height:100%;}
.admin-nav{border-right:1px solid var(--border);padding:12px 8px;}
.admin-nav-item{padding:8px 12px;border-radius:var(--radius);cursor:pointer;font-size:13px;color:var(--text2);transition:all 0.15s;margin-bottom:2px;}
.admin-nav-item:hover{background:var(--surface2);color:var(--text);}
.admin-nav-item.active{background:rgba(91,106,240,0.15);color:var(--accent2);}
.admin-content{padding:24px;overflow-y:auto;}
.admin-section-title{font-size:15px;font-weight:500;margin-bottom:16px;}
.form-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin-bottom:16px;}
.field{display:flex;flex-direction:column;gap:6px;}
.field label{font-size:12px;color:var(--text2);font-weight:500;}
.field input,.field select,.field textarea{background:var(--surface2);border:1px solid var(--border);border-radius:var(--radius);padding:8px 12px;color:var(--text);font-size:13px;font-family:inherit;outline:none;transition:border-color 0.15s;}
.field input:focus,.field select:focus,.field textarea:focus{border-color:var(--accent);}
.field textarea{resize:vertical;min-height:80px;}
.field-full{grid-column:1/-1;}
/* MODALS */
.modal-backdrop{position:fixed;inset:0;background:rgba(0,0,0,0.6);display:flex;align-items:center;justify-content:center;z-index:9999;padding:24px;}
.modal{background:var(--surface);border:1px solid var(--border2);border-radius:var(--radius-lg);width:100%;max-width:560px;max-height:90vh;overflow-y:auto;}
.modal-header{padding:18px 20px;border-bottom:1px solid var(--border);display:flex;align-items:center;justify-content:space-between;position:sticky;top:0;background:var(--surface);z-index:1;}
.modal-title{font-size:15px;font-weight:500;}
.modal-close{cursor:pointer;color:var(--text3);font-size:20px;line-height:1;padding:4px;}
.modal-body{padding:20px;display:flex;flex-direction:column;gap:14px;}
.modal-footer{padding:14px 20px;border-top:1px solid var(--border);display:flex;justify-content:flex-end;gap:8px;}
.field-row{display:grid;grid-template-columns:1fr 1fr;gap:12px;}
/* TASK PICKER MODAL */
.task-picker-list{max-height:300px;overflow-y:auto;}
.task-pick-item{display:flex;align-items:center;gap:10px;padding:8px 12px;border-radius:var(--radius);cursor:pointer;font-size:13px;color:var(--text2);transition:all 0.15s;}
.task-pick-item:hover{background:var(--surface2);color:var(--text);}
.task-pick-item.selected{background:rgba(91,106,240,0.15);color:var(--accent2);}
/* USER MANAGEMENT */
.user-table{width:100%;border-collapse:collapse;}
.user-table th{text-align:left;padding:8px 12px;font-size:11px;font-weight:500;color:var(--text3);text-transform:uppercase;border-bottom:1px solid var(--border);}
.user-table td{padding:10px 12px;border-bottom:1px solid var(--border);font-size:13px;}
.user-table tr:last-child td{border-bottom:none;}
.role-badge{font-size:11px;padding:2px 8px;border-radius:20px;}
.role-admin{background:rgba(91,106,240,0.15);color:var(--accent2);}
.role-verwalter{background:rgba(45,180,130,0.15);color:var(--success);}
.role-member{background:var(--surface2);color:var(--text3);}
/* TOAST */
.toast{position:fixed;bottom:24px;right:24px;background:var(--surface);border:1px solid var(--border2);border-radius:var(--radius);padding:10px 16px;font-size:13px;color:var(--text);z-index:200;transform:translateY(60px);opacity:0;transition:all 0.25s;}
.toast.show{transform:translateY(0);opacity:1;}
.toast.error{border-color:rgba(240,96,96,0.4);color:var(--danger);}
.toast.success{border-color:rgba(45,217,141,0.3);}
.loading{display:flex;align-items:center;justify-content:center;padding:60px;color:var(--text3);gap:10px;}
.spinner{width:16px;height:16px;border:2px solid var(--border);border-top-color:var(--accent);border-radius:50%;animation:spin 0.8s linear infinite;}
@keyframes spin{to{transform:rotate(360deg);}}
.empty{text-align:center;padding:60px;color:var(--text3);}
input[type=search]{background:var(--surface2);border:1px solid var(--border);border-radius:var(--radius);padding:7px 12px;color:var(--text);font-size:13px;font-family:inherit;outline:none;width:100%;}
input[type=search]:focus{border-color:var(--accent);}
input[type=date]{color-scheme:dark;}
input[type=date]::-webkit-calendar-picker-indicator{filter:invert(0.7);}
.assignee-chip{display:inline-flex;align-items:center;gap:6px;padding:4px 10px 4px 5px;border-radius:20px;background:rgba(91,106,240,0.15);border:1px solid rgba(91,106,240,0.25);font-size:13px;color:var(--accent2);cursor:pointer;}
.assignee-chip:hover{background:rgba(91,106,240,0.25);}
.assignee-chip .rm{color:var(--text3);margin-left:2px;font-size:14px;line-height:1;}
.assignee-chip .rm:hover{color:var(--danger);}
.user-pick-item{display:flex;align-items:center;gap:8px;padding:7px 10px;border-radius:var(--radius);cursor:pointer;font-size:13px;color:var(--text2);transition:all 0.15s;}
.user-pick-item:hover{background:var(--surface2);color:var(--text);}
.user-pick-item.assigned{background:rgba(91,106,240,0.1);color:var(--accent2);}
/* Fix 12: Slim scrollbars */
::-webkit-scrollbar{width:4px;height:4px;}
::-webkit-scrollbar-track{background:transparent;}
::-webkit-scrollbar-thumb{background:var(--text3);border-radius:4px;}
::-webkit-scrollbar-thumb:hover{background:var(--text2);}

/* Proj-Chat button blink when unread */
@keyframes tt-blink {
  0%,100%{opacity:1;} 50%{opacity:0.4;}
}
.proj-chat-unread {
  animation: tt-blink 1.2s ease-in-out infinite;
  border-color: var(--danger) !important;
  color: var(--danger) !important;
}


/* === SETTINGS PANEL CLEAN === */
.settings-panel{position:fixed;top:50%;left:50%;transform:translate(-50%,-50%);width:min(500px,95vw);max-height:88vh;background:var(--surface);border:1px solid var(--border2);border-radius:14px;z-index:120;box-shadow:0 20px 60px rgba(0,0,0,0.7);flex-direction:column;}
.avatar-swatch:hover{opacity:0.85;}
.avatar-swatch.active{border-color:var(--accent)!important;box-shadow:0 0 0 2px var(--accent);}
@media(max-width:600px){.settings-panel{width:98vw;max-height:95vh;}}

/* Universal avatar chip - size controlled by --av-size */
.av-chip{width:var(--av-size);height:var(--av-size);border-radius:var(--av-radius);font-size:var(--av-font);font-weight:700;display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;}
.table-wrap table th:last-child, .table-wrap table td:last-child{padding-right:12px;overflow:visible;}

@keyframes taskBlink {
  0%,100%{background:transparent;}
  50%{background:rgba(91,106,240,0.15);}
}
.task-blink td {animation:taskBlink 1.2s ease-in-out infinite;}
.task-blink .task-name {color:var(--accent2)!important;}

/* ============================================================
   TEAM TOOL — Design Enhancements (desktop-enhanced.css)
   Alle Layout-Regeln bleiben identisch zur desktop.css.
   Nur Animationen, Hover-Effekte und visuelle Politur werden
   hier ergänzt oder überschrieben.
   ============================================================ */

/* ── Transitions verbessern ─────────────────────────────── */
.nav-item        { transition: background 0.15s, color 0.15s, transform 0.12s !important; }
.channel-item    { transition: background 0.15s, color 0.15s, transform 0.12s !important; }
.dm-item         { transition: background 0.15s, color 0.15s, transform 0.12s !important; }
.nav-item:hover  { transform: translateX(2px); }

/* ── Buttons ─────────────────────────────────────────────── */
.btn {
  transition: background 0.15s, border-color 0.15s, color 0.15s,
              transform 0.12s, box-shadow 0.15s !important;
}
.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 3px 10px rgba(0,0,0,0.28);
}
.btn:active {
  transform: translateY(0) !important;
  box-shadow: none !important;
}

/* Primary — Indigo Glow */
.btn-primary:hover {
  background: var(--accent2) !important;
  border-color: var(--accent2) !important;
  box-shadow: 0 4px 18px rgba(91,106,240,0.45) !important;
}

/* Danger — Red Glow */
.btn-danger:hover {
  background: rgba(240,96,96,0.25) !important;
  box-shadow: 0 3px 12px rgba(240,96,96,0.25) !important;
}

/* Icon-only buttons in topbar */
#notif-btn:hover,
#search-btn:hover,
#proj-chat-btn:hover {
  background: var(--surface) !important;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
}

/* Login Button */
.login-btn {
  transition: background 0.15s, transform 0.12s, box-shadow 0.15s !important;
}
.login-btn:hover {
  background: var(--accent2) !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 18px rgba(91,106,240,0.4);
}
.login-btn:active {
  transform: translateY(0) !important;
  box-shadow: none !important;
}

/* ── Send Button (Chat) ──────────────────────────────────── */
.send-btn {
  transition: background 0.15s, transform 0.12s, box-shadow 0.15s !important;
}
.send-btn:hover {
  background: var(--accent2) !important;
  transform: translateY(-1px) scale(1.07);
  box-shadow: 0 3px 14px rgba(91,106,240,0.5);
}
.send-btn:active {
  transform: scale(0.93) !important;
  box-shadow: none !important;
}

/* ── Toolbar-Buttons (Chat Formatierung) ─────────────────── */
.toolbar-btn {
  transition: background 0.12s, color 0.12s, transform 0.1s !important;
}
.toolbar-btn:hover {
  background: var(--surface2) !important;
  color: var(--text) !important;
  transform: scale(1.1);
}

/* ── Filter-Buttons ──────────────────────────────────────── */
.filter-btn {
  transition: background 0.15s, border-color 0.15s, color 0.15s,
              transform 0.12s !important;
}
.filter-btn:hover {
  transform: translateY(-1px);
  border-color: var(--border2) !important;
  color: var(--text) !important;
}
.filter-btn.active {
  transform: none;
}

/* ── Tabelle — Zeilen ────────────────────────────────────── */
tr { transition: background 0.1s; }
.task-name {
  transition: color 0.15s !important;
}
.cb {
  transition: border-color 0.15s, background 0.15s, transform 0.1s !important;
}
.cb:hover {
  border-color: var(--accent) !important;
  transform: scale(1.1);
}
.cb.checked {
  animation: cbPop 0.2s ease;
}
@keyframes cbPop {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.25); }
  100% { transform: scale(1); }
}

/* ── Projekt-Cards (Mein Tag) ────────────────────────────── */
.proj-card-link {
  transition: border-color 0.18s, transform 0.15s, box-shadow 0.18s !important;
}
.proj-card-link:hover {
  border-color: var(--border2) !important;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.25);
}

/* ── Modals — Einblende-Animation ────────────────────────── */
.modal-backdrop {
  animation: backdropIn 0.15s ease;
}
@keyframes backdropIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.modal {
  animation: modalSlideUp 0.2s cubic-bezier(0.34, 1.12, 0.64, 1);
}
@keyframes modalSlideUp {
  from { transform: translateY(16px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}
.admin-lock-box {
  animation: modalSlideUp 0.2s cubic-bezier(0.34, 1.12, 0.64, 1);
}

/* ── Modal Close Button ──────────────────────────────────── */
.modal-close {
  transition: color 0.15s, background 0.15s, transform 0.12s !important;
  border-radius: 6px;
}
.modal-close:hover {
  color: var(--text) !important;
  background: var(--surface2);
  transform: rotate(90deg);
}

/* ── Toast ───────────────────────────────────────────────── */
.toast {
  transition: transform 0.25s cubic-bezier(0.34, 1.2, 0.64, 1),
              opacity 0.25s ease !important;
}
.toast.show {
  animation: toastIn 0.3s cubic-bezier(0.34, 1.2, 0.64, 1);
}
@keyframes toastIn {
  from { transform: translateY(20px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

/* ── Input Focus ─────────────────────────────────────────── */
.field input, .field select, .field textarea,
.login-field input,
input[type=search],
.chat-input {
  transition: border-color 0.15s, box-shadow 0.15s !important;
}
.field input:focus, .field select:focus, .field textarea:focus,
.login-field input:focus,
input[type=search]:focus {
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 3px rgba(91,106,240,0.15);
}

/* ── Chat Input Wrap ─────────────────────────────────────── */
.chat-input-wrap {
  transition: border-color 0.15s, box-shadow 0.15s !important;
}
.chat-input-wrap:focus-within {
  border-color: var(--border2) !important;
  box-shadow: 0 0 0 3px rgba(91,106,240,0.08);
}

/* ── Nachrichten hover ───────────────────────────────────── */
.msg {
  transition: background 0.1s !important;
}

/* ── Spinner verbessern ──────────────────────────────────── */
.spinner {
  animation: spin 0.7s cubic-bezier(0.4, 0, 0.6, 1) infinite !important;
}

/* ── Swatch hover ────────────────────────────────────────── */
.swatch {
  transition: border-color 0.15s, transform 0.12s !important;
}
.swatch:hover {
  transform: scale(1.18);
}

/* ── Avatar hover (user-btn) ─────────────────────────────── */
.user-btn {
  transition: background 0.15s, transform 0.12s !important;
}
.user-btn:hover {
  background: var(--surface2) !important;
}

/* ── Expand-Button ───────────────────────────────────────── */
.expand-btn {
  transition: transform 0.18s cubic-bezier(0.34, 1.2, 0.64, 1) !important;
}

/* ── Resize-Handle ───────────────────────────────────────── */
.detail-top-resize,
.detail-resize {
  transition: background 0.15s !important;
}
.detail-vert-resize {
  transition: background 0.15s !important;
}
.detail-vert-resize::after {
  transition: background 0.15s !important;
}

/* ── Back-Button ─────────────────────────────────────────── */
.back-btn {
  transition: color 0.15s, transform 0.12s !important;
}
.back-btn:hover {
  color: var(--text) !important;
  transform: translateX(-2px);
}

/* ── Size-Buttons (Einstellungen) ────────────────────────── */
.size-btn {
  transition: border-color 0.15s, background 0.15s, color 0.15s,
              transform 0.1s !important;
}
.size-btn:hover {
  transform: translateY(-1px);
  border-color: var(--border2) !important;
}
.size-btn.active {
  transform: none;
}

/* ── Col-Toggle ──────────────────────────────────────────── */
.col-toggle {
  transition: background 0.2s !important;
}
.col-toggle-thumb {
  transition: left 0.2s cubic-bezier(0.34, 1.3, 0.64, 1) !important;
}

/* ── Toggle (Einstellungen) ──────────────────────────────── */
.toggle {
  transition: background 0.2s !important;
}
.toggle-thumb {
  transition: left 0.2s cubic-bezier(0.34, 1.3, 0.64, 1) !important;
}

/* ── Assignee Chip ───────────────────────────────────────── */
.assignee-chip {
  transition: background 0.15s, transform 0.1s !important;
}
.assignee-chip:hover {
  background: rgba(91,106,240,0.25) !important;
  transform: scale(1.03);
}

/* ── Task-Name in Tabelle ────────────────────────────────── */
.task-name:hover {
  color: var(--accent2) !important;
}

/* ── Admin Nav Items ─────────────────────────────────────── */
.admin-nav-item {
  transition: background 0.15s, color 0.15s, transform 0.1s !important;
}
.admin-nav-item:hover {
  transform: translateX(2px);
}

/* ── Prio/Status Badges — subtile hover ──────────────────── */
.prio, .role-badge {
  transition: filter 0.15s, transform 0.1s !important;
}
.prio:hover {
  filter: brightness(1.15);
}

/* ── MOB FAB ─────────────────────────────────────────────── */
.mob-fab {
  transition: transform 0.15s, background 0.15s,
              box-shadow 0.15s !important;
}
.mob-fab:hover {
  box-shadow: 0 6px 24px rgba(91,106,240,0.55);
  transform: scale(1.06);
}


/* ============================================================
   ERWEITERUNGEN — Links, Unterpunkt-Buttons, Avatar-Blinken
   ============================================================ */

/* ── Chat: Links mit Akzentfarbe + Hover ────────────────────
   linkify() setzt bereits color:var(--accent2), aber wir
   ergänzen einen schöneren Hover-Effekt und Transition.      */
.msg-text a {
  color: var(--accent2) !important;
  text-decoration: underline !important;
  text-underline-offset: 2px;
  text-decoration-color: rgba(123,138,248,0.4) !important;
  transition: color 0.15s, text-decoration-color 0.15s !important;
  word-break: break-all;
}
.msg-text a:hover {
  color: var(--text) !important;
  text-decoration-color: var(--accent2) !important;
}

/* Auch in Reply-Quotes und Task-Kommentaren */
.reply-quote a,
.linked-msg-text a {
  color: var(--accent2) !important;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ── Unterpunkt-Buttons: immer sichtbar, statt opacity:0 ────
   Delete → immer leicht sichtbar, hover = roter Glow
   Attach → immer leicht sichtbar, hover = Indigo
   Move   → bereits opacity:1, hover = Indigo stärker         */

/* Löschen-Button */
.subtask-del {
  opacity: 0.35 !important;
  color: var(--text3) !important;
  transition: opacity 0.15s, color 0.15s, transform 0.12s,
              background 0.15s !important;
  border-radius: 5px !important;
  padding: 3px 5px !important;
}
.subtask-item:hover .subtask-del {
  opacity: 1 !important;
}
.subtask-del:hover {
  opacity: 1 !important;
  color: var(--danger) !important;
  background: rgba(240,96,96,0.15) !important;
  transform: scale(1.15) !important;
}

/* Datei-Anhängen-Button */
.sub-attach-btn {
  opacity: 0.35 !important;
  transition: opacity 0.15s, color 0.15s, background 0.15s,
              transform 0.12s !important;
  border-radius: 5px !important;
}
.subtask-item:hover .sub-attach-btn {
  opacity: 1 !important;
}
.sub-attach-btn:hover {
  opacity: 1 !important;
  background: rgba(91,106,240,0.18) !important;
  color: var(--accent2) !important;
  transform: scale(1.1) !important;
}

/* Verschieben-Button */
.sub-move-btn {
  transition: color 0.15s, background 0.15s, transform 0.12s !important;
  border-radius: 5px !important;
  padding: 3px 5px !important;
}
.sub-move-btn:hover {
  color: var(--accent) !important;
  background: rgba(91,106,240,0.18) !important;
  transform: scale(1.15) rotate(-10deg) !important;
}

/* ── Unterpunkt-Avatar: Blinken on hover ────────────────────
   Der Avatar öffnet den Zuweisung-Picker — visuelles Signal.  */
.subtask-item [onclick*="showSubtaskAssigneePicker"] {
  transition: transform 0.15s, box-shadow 0.15s !important;
  position: relative;
}
.subtask-item [onclick*="showSubtaskAssigneePicker"]:hover {
  animation: avatarPulse 0.9s ease-in-out infinite !important;
  box-shadow: 0 0 0 2px var(--accent), 0 0 8px rgba(91,106,240,0.5) !important;
  cursor: pointer;
}
@keyframes avatarPulse {
  0%,100% { box-shadow: 0 0 0 2px var(--accent), 0 0 6px rgba(91,106,240,0.4); }
  50%      { box-shadow: 0 0 0 3px var(--accent2), 0 0 14px rgba(123,138,248,0.65); }
}

/* Tooltip-Hinweis beim Avatar-Hover */
.subtask-item [onclick*="showSubtaskAssigneePicker"]::after {
  content: 'Zuweisen';
  position: absolute;
  bottom: calc(100% + 5px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--surface2);
  border: 1px solid var(--border2);
  color: var(--text2);
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 6px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s;
  font-family: 'DM Sans', sans-serif;
  font-weight: 500;
}
.subtask-item [onclick*="showSubtaskAssigneePicker"]:hover::after {
  opacity: 1;
}


/* ============================================================
   FIX — Links weiß, Buttons sichtbarer, WS-Avatar-Pulse
   ============================================================ */

/* ── Chat-Links: Weiß mit Unterstreichung ───────────────────
   Inline-Style aus linkify() wird mit !important überschrieben */
.msg-text a,
.msg-text a:link,
.msg-text a:visited {
  color: #e8e8ec !important;
  text-decoration: underline !important;
  text-decoration-color: rgba(232,232,236,0.4) !important;
  text-underline-offset: 2px;
  transition: color 0.15s, text-decoration-color 0.15s !important;
  word-break: break-all;
}
.msg-text a:hover {
  color: #ffffff !important;
  text-decoration-color: rgba(255,255,255,0.8) !important;
}
.reply-quote a, .linked-msg-text a {
  color: #e8e8ec !important;
  text-decoration: underline !important;
}

/* ── Buttons: sichtbarer ─────────────────────────────────── */
/* Secondary (Standard) */
.btn {
  background: #2a2a32 !important;
  border: 1px solid rgba(255,255,255,0.18) !important;
  color: #d8d8e0 !important;
}
.btn:hover {
  background: #32323e !important;
  border-color: rgba(255,255,255,0.28) !important;
  color: #e8e8ec !important;
}

/* Primary — Accent mit Glow */
.btn.btn-primary,
.btn-primary {
  background: var(--accent) !important;
  border-color: var(--accent) !important;
  color: #ffffff !important;
}
.btn.btn-primary:hover,
.btn-primary:hover {
  background: var(--accent2) !important;
  border-color: var(--accent2) !important;
  box-shadow: 0 4px 18px rgba(91,106,240,0.5) !important;
}

/* Danger */
.btn.btn-danger,
.btn-danger {
  background: rgba(240,96,96,0.18) !important;
  border-color: rgba(240,96,96,0.4) !important;
  color: #f07070 !important;
}
.btn.btn-danger:hover,
.btn-danger:hover {
  background: rgba(240,96,96,0.28) !important;
  border-color: rgba(240,96,96,0.6) !important;
  box-shadow: 0 3px 12px rgba(240,96,96,0.3) !important;
}

/* Size-Buttons in Einstellungen */
.size-btn {
  background: rgba(255,255,255,0.04) !important;
  border-color: rgba(255,255,255,0.14) !important;
  color: var(--text2) !important;
}
.size-btn:hover {
  background: rgba(255,255,255,0.08) !important;
  border-color: rgba(255,255,255,0.24) !important;
  color: var(--text) !important;
}
.size-btn.active {
  background: rgba(91,106,240,0.2) !important;
  border-color: rgba(91,106,240,0.5) !important;
  color: var(--accent2) !important;
}

/* ── WS Avatar (Sidebar User-Btn): Pulse on hover ────────── */
#user-avatar {
  transition: box-shadow 0.15s, transform 0.15s !important;
  cursor: pointer;
}
.user-btn:hover #user-avatar {
  animation: wsAvatarPulse 1s ease-in-out infinite !important;
}
@keyframes wsAvatarPulse {
  0%,100% {
    box-shadow: 0 0 0 2px var(--accent), 0 0 6px rgba(91,106,240,0.4);
    transform: scale(1);
  }
  50% {
    box-shadow: 0 0 0 3px var(--accent2), 0 0 14px rgba(123,138,248,0.65);
    transform: scale(1.08);
  }
}


/* ============================================================
   FIX — Unterpunkt-Buttons: immer sichtbar, klare Farben
   ============================================================ */

/* Löschen (✕) — immer sichtbar, rot getönt */
.subtask-del {
  opacity: 1 !important;
  color: rgba(240,96,96,0.7) !important;
  background: rgba(240,96,96,0.08) !important;
  border-radius: 5px !important;
  padding: 3px 6px !important;
  font-size: 12px !important;
  transition: color 0.15s, background 0.15s, transform 0.12s,
              box-shadow 0.15s !important;
}
.subtask-del:hover {
  color: #f06060 !important;
  background: rgba(240,96,96,0.22) !important;
  box-shadow: 0 2px 8px rgba(240,96,96,0.3) !important;
  transform: scale(1.15) !important;
}

/* Datei-Anhängen (📎) — immer sichtbar, indigo getönt */
.sub-attach-btn {
  opacity: 1 !important;
  color: rgba(123,138,248,0.75) !important;
  background: rgba(91,106,240,0.1) !important;
  border: 1px solid rgba(91,106,240,0.2) !important;
  border-radius: 5px !important;
  font-size: 11px !important;
  padding: 3px 6px !important;
  transition: color 0.15s, background 0.15s, border-color 0.15s,
              transform 0.12s, box-shadow 0.15s !important;
}
.sub-attach-btn:hover {
  color: var(--accent2) !important;
  background: rgba(91,106,240,0.22) !important;
  border-color: rgba(91,106,240,0.45) !important;
  box-shadow: 0 2px 8px rgba(91,106,240,0.3) !important;
  transform: scale(1.1) !important;
}

/* Verschieben (↗) — immer sichtbar, cyan getönt */
.sub-move-btn {
  color: rgba(45,217,141,0.75) !important;
  background: rgba(45,217,141,0.08) !important;
  border: 1px solid rgba(45,217,141,0.2) !important;
  border-radius: 5px !important;
  padding: 3px 6px !important;
  font-size: 14px !important;
  transition: color 0.15s, background 0.15s, border-color 0.15s,
              transform 0.15s, box-shadow 0.15s !important;
}
.sub-move-btn:hover {
  color: var(--success) !important;
  background: rgba(45,217,141,0.18) !important;
  border-color: rgba(45,217,141,0.45) !important;
  box-shadow: 0 2px 8px rgba(45,217,141,0.3) !important;
  transform: scale(1.15) rotate(-5deg) !important;
}


/* ── Assignee-Picker: Scrollbalken ausblenden ────────────── */
#sub-assignee-picker {
  scrollbar-width: none !important; /* Firefox */
}
#sub-assignee-picker::-webkit-scrollbar {
  display: none !important; /* Chrome/Safari */
}

/* Hover-Zeile im Picker */
.sub-ap-row {
  transition: background 0.12s !important;
  border-radius: 6px !important;
}
.sub-ap-row:hover {
  background: var(--surface2) !important;
}


/* ── Mein Tag: Subtask-Zeilen nicht umbrechen ────────────── */
.proj-card {
  overflow: hidden;
  min-width: 0;
}
.proj-task {
  min-width: 0;
}
.proj-task span[style*="flex:1"] {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* Subtask-Zeilen im Mein Tag */
.proj-card > div[style*="display:flex"][style*="padding:4px"] {
  min-width: 0;
}
.proj-card > div[style*="display:flex"][style*="padding:4px"] span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}


/* ============================================================
   MEIN TAG — Karten-Animationen
   ============================================================ */

/* ── Karten Einlauf (gestaffelt) ────────────────────────── */
.myday-grid {
  perspective: 800px;
}

.proj-card {
  animation: cardFadeIn 0.35s ease both;
  transform-origin: top center;
}

/* Gestaffelte Verzögerung für die ersten 12 Karten */
.myday-grid .proj-card:nth-child(1)  { animation-delay: 0.00s; }
.myday-grid .proj-card:nth-child(2)  { animation-delay: 0.05s; }
.myday-grid .proj-card:nth-child(3)  { animation-delay: 0.10s; }
.myday-grid .proj-card:nth-child(4)  { animation-delay: 0.15s; }
.myday-grid .proj-card:nth-child(5)  { animation-delay: 0.20s; }
.myday-grid .proj-card:nth-child(6)  { animation-delay: 0.25s; }
.myday-grid .proj-card:nth-child(7)  { animation-delay: 0.30s; }
.myday-grid .proj-card:nth-child(8)  { animation-delay: 0.35s; }
.myday-grid .proj-card:nth-child(9)  { animation-delay: 0.40s; }
.myday-grid .proj-card:nth-child(10) { animation-delay: 0.45s; }
.myday-grid .proj-card:nth-child(11) { animation-delay: 0.50s; }
.myday-grid .proj-card:nth-child(12) { animation-delay: 0.55s; }

@keyframes cardFadeIn {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ── Karten Hover ────────────────────────────────────────── */
.proj-card {
  transition: border-color 0.2s, transform 0.18s, box-shadow 0.2s !important;
}
.proj-card:hover {
  border-color: var(--border2) !important;
  transform: translateY(-3px) !important;
  box-shadow: 0 8px 24px rgba(0,0,0,0.3) !important;
}
/* Expanded card (volle Breite) nicht heben */
.proj-card[style*="grid-column"] {
  transform: none !important;
  box-shadow: none !important;
}
.proj-card[style*="grid-column"]:hover {
  transform: none !important;
  box-shadow: 0 4px 16px rgba(0,0,0,0.2) !important;
}

/* ── Gruppen-Header Einlauf ─────────────────────────────── */
.content > div[style*="margin-bottom:24px"] {
  animation: sectionFadeIn 0.3s ease both;
}
.content > div[style*="margin-bottom:24px"]:nth-child(1) { animation-delay: 0.0s; }
.content > div[style*="margin-bottom:24px"]:nth-child(2) { animation-delay: 0.1s; }
.content > div[style*="margin-bottom:24px"]:nth-child(3) { animation-delay: 0.2s; }

@keyframes sectionFadeIn {
  from { opacity: 0; transform: translateX(-8px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ── Subtask-Zeilen: Einblenden beim Expand ─────────────── */
.proj-card div[style*="padding:5px 4px 5px 28px"],
.proj-card div[style*="padding:4px 4px 4px 32px"] {
  animation: subFadeIn 0.2s ease both;
}

/* Gestaffelt für die ersten 15 Subtasks */
.proj-card div[style*="border-bottom"]:nth-child(2)  { animation-delay: 0.02s; }
.proj-card div[style*="border-bottom"]:nth-child(3)  { animation-delay: 0.04s; }
.proj-card div[style*="border-bottom"]:nth-child(4)  { animation-delay: 0.06s; }
.proj-card div[style*="border-bottom"]:nth-child(5)  { animation-delay: 0.08s; }
.proj-card div[style*="border-bottom"]:nth-child(6)  { animation-delay: 0.10s; }
.proj-card div[style*="border-bottom"]:nth-child(7)  { animation-delay: 0.12s; }
.proj-card div[style*="border-bottom"]:nth-child(8)  { animation-delay: 0.14s; }
.proj-card div[style*="border-bottom"]:nth-child(9)  { animation-delay: 0.16s; }
.proj-card div[style*="border-bottom"]:nth-child(10) { animation-delay: 0.18s; }

@keyframes subFadeIn {
  from { opacity: 0; transform: translateX(-6px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ── Expand-Button: Rotation smooth ────────────────────── */
.expand-btn {
  transition: transform 0.22s cubic-bezier(0.34, 1.3, 0.64, 1) !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.expand-btn.open {
  transform: rotate(90deg) !important;
}

/* ── Proj-Task Hover ────────────────────────────────────── */
.proj-task {
  transition: background 0.12s !important;
  border-radius: 6px;
  margin: 0 -4px;
  padding-left: 4px !important;
  padding-right: 4px !important;
}
.proj-task:hover {
  background: rgba(255,255,255,0.04) !important;
}


/* ── Chat/DM Nachrichten-Aktionen: farbig wie Unterpunkt-Buttons ── */

/* Aktions-Container: gleicher Stil wie Unterpunkt-Leiste */
.msg-actions {
  background: var(--surface) !important;
  border: 1px solid var(--border2) !important;
  border-radius: 9px !important;
  padding: 3px 5px !important;
  box-shadow: 0 3px 12px rgba(0,0,0,0.35) !important;
  gap: 3px !important;
}

/* Basis für alle Action-Buttons */
.msg-action-btn {
  border-radius: 6px !important;
  padding: 4px 7px !important;
  transition: background 0.15s, color 0.15s, transform 0.12s, box-shadow 0.15s !important;
  display: flex !important;
  align-items: center !important;
  border: 1px solid transparent !important;
}

/* Antworten — Indigo (wie Datei-Anhängen) */
.msg-action-btn:not(.msg-action-del):first-child {
  color: rgba(123,138,248,0.8) !important;
  background: rgba(91,106,240,0.1) !important;
  border-color: rgba(91,106,240,0.2) !important;
}
.msg-action-btn:not(.msg-action-del):first-child:hover {
  color: var(--accent2) !important;
  background: rgba(91,106,240,0.22) !important;
  border-color: rgba(91,106,240,0.45) !important;
  box-shadow: 0 2px 8px rgba(91,106,240,0.3) !important;
  transform: scale(1.1) !important;
}

/* Bearbeiten — Grün/Cyan (wie Verschieben) */
.msg-action-btn:not(.msg-action-del):nth-child(2) {
  color: rgba(45,217,141,0.8) !important;
  background: rgba(45,217,141,0.08) !important;
  border-color: rgba(45,217,141,0.2) !important;
}
.msg-action-btn:not(.msg-action-del):nth-child(2):hover {
  color: var(--success) !important;
  background: rgba(45,217,141,0.18) !important;
  border-color: rgba(45,217,141,0.45) !important;
  box-shadow: 0 2px 8px rgba(45,217,141,0.3) !important;
  transform: scale(1.1) !important;
}

/* Löschen — Rot (wie Unterpunkt Löschen) */
.msg-action-del {
  color: rgba(240,96,96,0.75) !important;
  background: rgba(240,96,96,0.08) !important;
  border-color: rgba(240,96,96,0.2) !important;
}
.msg-action-del:hover {
  color: var(--danger) !important;
  background: rgba(240,96,96,0.22) !important;
  border-color: rgba(240,96,96,0.4) !important;
  box-shadow: 0 2px 8px rgba(240,96,96,0.3) !important;
  transform: scale(1.1) !important;
}

/* Einblend-Animation wenn msg:hover die Actions zeigt */
.msg:hover .msg-actions {
  animation: msgActionsIn 0.15s ease both !important;
}
@keyframes msgActionsIn {
  from { opacity: 0; transform: translateY(-4px) scale(0.95); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}


/* ── Task-Detail: Details-Spalte (rechts oben) schmäler aber nicht gequetscht ── */
.task-detail-right {
  min-width: 200px !important;
  max-width: none !important;
  padding: 16px 14px !important;
}

/* Aufgaben-Metadaten: kompakteres Grid */
.detail-grid {
  grid-template-columns: 1fr 1fr !important;
  gap: 12px !important;
  margin-bottom: 14px !important;
}

/* Detail-Labels etwas kleiner */
.detail-label {
  font-size: 10px !important;
  margin-bottom: 4px !important;
}

/* Detail-Select: kompakter */
.detail-select {
  font-size: 12px !important;
  padding: 3px 5px !important;
}

/* ── Chat: Mindestbreite größer ──────────────────────────── */
.task-detail-chat {
  min-width: 280px !important;
}

/* Kommentare-Spalte: etwas schmäler möglich */
.task-detail-comments {
  min-width: 160px !important;
  max-width: 320px !important;
}


/* ── Task-Detail: volle Breite sicherstellen ────────────── */
.task-detail-comments {
  min-width: 160px !important;
  max-width: none !important;
}
.task-detail-top,
.task-detail-bottom {
  width: 100% !important;
}

/* ── Notification-Permission Banner ────────────────────────── */
.notif-banner {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 9999;
  background: linear-gradient(90deg, var(--accent), var(--accent2, var(--accent)));
  color: #fff;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
.notif-banner-icon { font-size: 20px; flex-shrink: 0; }
.notif-banner-text { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.notif-banner-text strong { font-weight: 600; }
.notif-banner-text span { font-size: 11px; opacity: 0.9; line-height: 1.3; }
.notif-banner .btn-primary {
  background: rgba(255,255,255,0.95);
  color: var(--accent);
  border: none;
  font-weight: 600;
  flex-shrink: 0;
}
.notif-banner .btn-primary:hover { background: #fff; }
.notif-banner-dismiss,
.notif-banner-never {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.4);
  color: #fff;
  cursor: pointer;
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 12px;
  flex-shrink: 0;
}
.notif-banner-dismiss { padding: 4px 8px; font-size: 14px; }
.notif-banner-dismiss:hover,
.notif-banner-never:hover { background: rgba(255,255,255,0.15); }
body.has-notif-banner { padding-top: 52px; }
body.has-notif-banner .sidebar,
body.has-notif-banner .content { height: calc(100vh - 52px); }
@media (max-width: 768px) {
  .notif-banner { padding: 8px 10px; gap: 8px; font-size: 12px; flex-wrap: wrap; }
  .notif-banner-text strong { font-size: 12px; }
  .notif-banner-text span { font-size: 10px; }
  .notif-banner-never { display: none; }
  body.has-notif-banner { padding-top: 76px; }
  body.has-notif-banner .sidebar,
  body.has-notif-banner .content { height: calc(100vh - 76px); }
}

/* ============================================================
   MEIN BEREICH — Notizen (v14)
   ============================================================ */
.notes-view { display:flex; flex-direction:column; height:100%; min-height:0; }

.notes-header {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.notes-header-title { font-size: 18px; font-weight: 500; }
.notes-header-sub { font-size: 12px; color: var(--text3); margin-top: 2px; }

.notes-toolbar {
  padding: 10px 20px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 10px;
}
.notes-search { position: relative; flex: 1; }
.notes-search input {
  width: 100%; height: 32px; padding: 0 10px 0 32px; font-size: 13px;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); color: var(--text);
  box-sizing: border-box;
}
.notes-search-icon {
  position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
  font-size: 14px; color: var(--text3); pointer-events: none;
}
.notes-tabs { display: flex; gap: 4px; }
.notes-tab {
  height: 32px; padding: 0 10px; font-size: 12px; cursor: pointer;
  background: transparent; color: var(--text2);
  border: 1px solid var(--border); border-radius: var(--radius);
}
.notes-tab.active { background: var(--accent); color: #fff; border-color: var(--accent); }

.notes-list-header {
  padding: 8px 20px; border-bottom: 1px solid var(--border);
  display: grid; grid-template-columns: 28px 1fr 110px; gap: 12px;
  font-size: 10px; color: var(--text3); text-transform: uppercase; letter-spacing: 0.5px;
}
.notes-list-header .col-date { text-align: right; }

.notes-list { flex: 1; overflow-y: auto; }
.note-row {
  padding: 12px 20px;
  display: grid; grid-template-columns: 28px 1fr 110px; gap: 12px;
  align-items: center;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.12s;
  position: relative;
}
.note-row:hover { background: var(--surface2); }
.note-row .col-icon { display: flex; align-items: center; justify-content: center; width: 28px; font-size: 14px; }
.note-row .col-icon .icon-box {
  width: 22px; height: 22px; border-radius: 4px;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px;
}
.note-row .col-icon .ic-pin     { color: var(--accent); }
.note-row .col-icon .ic-link    { color: var(--success); }
.note-row .col-icon .ic-text    { color: var(--text2); }
.note-row .col-icon .icon-box.bg-info    { background: rgba(74,144,226,0.15); color: var(--accent); }
.note-row .col-icon .icon-box.bg-danger  { background: rgba(229,69,69,0.15); color: var(--danger); }
.note-row .col-icon .icon-box.bg-success { background: rgba(46,160,67,0.15); color: var(--success); }
.note-row .col-icon .icon-box.bg-neutral { background: var(--surface2); color: var(--text2); }
.note-row .col-title { font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.note-row .col-title .shared-badge {
  display: inline-flex; align-items: center; gap: 4px;
  margin-left: 8px; padding: 2px 8px 2px 4px;
  font-size: 10px; font-weight: 500;
  background: var(--surface2); color: var(--text2); border-radius: 10px;
  vertical-align: 1px;
}
.note-row .col-title .shared-badge.tag-shared { padding-left: 3px; }
.note-row .col-title .shared-badge.tag-mine {
  padding: 2px 8px;
  background: rgba(74,144,226,0.12);
  color: var(--accent);
}
.note-row .col-title .shared-badge .sb-av {
  width: 16px; height: 16px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 9px; font-weight: 500; color: #fff;
  line-height: 1;
}
.note-row .col-date { font-size: 11px; color: var(--text3); text-align: right; }

/* Hover-Preview */
.note-preview {
  position: fixed; z-index: 200;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.18);
  width: 340px; max-width: 90vw;
  font-size: 12px; line-height: 1.6;
  pointer-events: none;
}
.note-preview-title {
  font-size: 13px; font-weight: 500; margin-bottom: 6px;
  padding-bottom: 6px; border-bottom: 1px solid var(--border);
  color: var(--text);
}
.note-preview-body {
  color: var(--text2);
  max-height: 180px; overflow: hidden;
  display: -webkit-box; -webkit-line-clamp: 8; -webkit-box-orient: vertical;
  white-space: pre-wrap; word-break: break-word;
}
.note-preview-meta {
  margin-top: 8px; padding-top: 6px;
  border-top: 1px solid var(--border);
  display: flex; align-items: center; gap: 8px;
  font-size: 10px; color: var(--text3);
}

.notes-empty {
  padding: 60px 20px; text-align: center; color: var(--text3); font-size: 13px;
}

.notes-fab {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 12px; font-size: 13px;
  background: var(--accent); color: #fff;
  border: none; border-radius: var(--radius);
  cursor: pointer;
}
.notes-fab:hover { opacity: 0.9; }

/* ============================================================
   NOTIZ-DETAIL Modal (analog Task-Detail)
   ============================================================ */
.note-modal-overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(0,0,0,0.45);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 4vh 1rem;
  overflow-y: auto;
}
.note-modal {
  width: 760px; max-width: 100%;
  min-width: 480px;
  min-height: 400px;
  max-height: calc(100vh - 8vh);
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
  display: flex; flex-direction: column;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  resize: both;
  position: relative;
}
/* Custom resize-grip in corner (sichtbarer als browser default) */
.note-modal::after {
  content: '';
  position: absolute;
  right: 2px; bottom: 2px;
  width: 14px; height: 14px;
  background:
    linear-gradient(135deg, transparent 0%, transparent 45%, var(--text3) 45%, var(--text3) 55%, transparent 55%, transparent 70%, var(--text3) 70%, var(--text3) 80%, transparent 80%);
  opacity: 0.5;
  pointer-events: none;
}
.note-modal-body { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.note-modal-header {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  background: var(--surface2);
}
.note-modal-header-left { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 11px; color: var(--text3); flex-wrap: wrap; }
.note-modal-header-right { display: flex; align-items: center; gap: 2px; }
.note-modal-btn {
  width: 30px; height: 30px; padding: 0;
  display: flex; align-items: center; justify-content: center;
  background: transparent; border: none; border-radius: 6px;
  cursor: pointer; color: var(--text2);
  font-size: 15px;
}
.note-modal-btn:hover { background: var(--surface); color: var(--text); }
.note-modal-btn.danger:hover { color: var(--danger); }
.note-modal-btn.active { color: var(--accent); }
.note-modal-sep { width: 1px; height: 18px; background: var(--border); margin: 0 4px; }

.note-modal-title { padding: 16px 20px 4px; }
.note-modal-title input {
  width: 100%; padding: 4px 0;
  font-size: 20px; font-weight: 500;
  border: none; background: transparent; outline: none;
  color: var(--text);
  box-sizing: border-box;
}
.note-modal-shared {
  padding: 0 20px 12px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  font-size: 11px;
}
.note-modal-shared-label { color: var(--text3); text-transform: uppercase; letter-spacing: 0.5px; margin-right: 4px; }
.note-shared-chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px 2px 4px; border-radius: 12px;
  background: var(--surface2); font-size: 11px; color: var(--text2);
}
.note-shared-chip .av { width: 18px; height: 18px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 9px; font-weight: 500; color:#fff; }
.note-shared-chip .perm-edit { color: var(--accent); font-size: 11px; margin-left:2px; }
.note-shared-chip .rm { cursor: pointer; color: var(--text3); margin-left: 2px; font-weight:700; }
.note-shared-chip .rm:hover { color: var(--danger); }

.note-modal-body { padding: 4px 20px 12px; flex: 1; min-height: 0; display: flex; flex-direction: column; }
.note-modal-body textarea {
  width: 100%; flex: 1; min-height: 220px;
  padding: 12px;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); color: var(--text);
  font-size: 14px; line-height: 1.7; resize: none;
  font-family: inherit;
  box-sizing: border-box;
}
.note-modal-body textarea[readonly] { background: var(--surface2); }

.note-modal-link-row { padding: 4px 20px 12px; }
.note-link-wrap {
  display: flex; align-items: center; gap: 8px;
  padding: 0 10px;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface);
  height: 36px;
}
.note-link-icon { font-size: 13px; color: var(--text3); flex-shrink: 0; }
.note-link-wrap input {
  flex: 1; min-width: 0;
  height: 100%; padding: 0;
  border: none; background: transparent; color: var(--text);
  font-size: 13px; outline: none;
}
.note-link-open {
  flex-shrink: 0;
  height: 26px; padding: 0 10px;
  font-size: 11px; font-weight: 500; cursor: pointer;
  background: var(--accent); color: #fff;
  border: none; border-radius: 4px;
  white-space: nowrap;
}
.note-link-open:hover { opacity: 0.9; }
.note-modal-link-row input[readonly] { color: var(--text2); }

.note-modal-attachments { padding: 0 20px 12px; }
.note-modal-attachments-label {
  font-size: 10px; color: var(--text3); text-transform: uppercase;
  letter-spacing: 0.5px; margin-bottom: 6px;
}
.note-attach-row {
  padding: 8px 10px;
  border: 1px solid var(--border); border-radius: var(--radius);
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 6px; cursor: pointer;
}
.note-attach-row:hover { background: var(--surface2); }
.note-attach-icon { width: 28px; height: 28px; border-radius: 4px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 13px; }
.note-attach-icon.bg-info    { background: rgba(74,144,226,0.15); color: var(--accent); }
.note-attach-icon.bg-danger  { background: rgba(229,69,69,0.15); color: var(--danger); }
.note-attach-icon.bg-success { background: rgba(46,160,67,0.15); color: var(--success); }
.note-attach-icon.bg-neutral { background: var(--surface2); color: var(--text2); }
.note-attach-info { flex: 1; min-width: 0; }
.note-attach-info .nm { font-size: 12px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.note-attach-info .sz { font-size: 10px; color: var(--text3); }
.note-attach-rm { color: var(--text3); cursor: pointer; padding: 4px; font-weight:700; }
.note-attach-rm:hover { color: var(--danger); }

.note-modal-footer {
  padding: 10px 20px;
  border-top: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  background: var(--surface2);
  flex-wrap: wrap; gap: 8px;
}
.note-modal-footer-left { display: flex; align-items: center; gap: 4px; }
.note-modal-footer-btn {
  height: 30px; padding: 0 10px;
  display: flex; align-items: center; gap: 5px;
  font-size: 12px; cursor: pointer;
  background: transparent; color: var(--text2);
  border: 1px solid var(--border); border-radius: 6px;
}
.note-modal-footer-btn:hover { background: var(--surface); color: var(--text); }
.note-modal-footer-status {
  display: flex; align-items: center; gap: 6px;
  font-size: 11px; color: var(--text3);
}
.note-modal-footer-status .saved { color: var(--success); }

/* TEILEN-Dialog */
.note-share-modal {
  width: 460px; max-width: 100%;
  background: var(--surface); border-radius: var(--radius);
  border: 1px solid var(--border); overflow: hidden;
  display: flex; flex-direction: column;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.note-share-search { padding: 10px 18px; position: relative; }
.note-share-search input {
  width: 100%; height: 34px; padding: 0 10px 0 32px;
  font-size: 13px; border: 1px solid var(--border);
  border-radius: var(--radius); background: var(--surface); color: var(--text);
  box-sizing: border-box;
}
.note-share-search-icon {
  position: absolute; left: 28px; top: 50%; transform: translateY(-50%);
  font-size: 14px; color: var(--text3); pointer-events: none;
}
.note-share-suggest {
  padding: 0 10px 8px;
  max-height: 200px; overflow-y: auto;
}
.note-share-suggest-item {
  padding: 8px; border-radius: 6px;
  display: flex; align-items: center; gap: 10px;
  cursor: pointer;
}
.note-share-suggest-item:hover { background: var(--surface2); }
.note-share-suggest-item .av {
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 500; color: #fff;
}
.note-share-list { padding: 4px 18px 8px; }
.note-share-list-label {
  font-size: 10px; color: var(--text3); text-transform: uppercase;
  letter-spacing: 0.5px; margin-bottom: 6px;
}
.note-share-list-row {
  padding: 8px 10px; border-radius: 6px;
  border: 1px solid var(--border);
  display: flex; align-items: center; gap: 10px; margin-bottom: 6px;
}
.note-share-list-row .av {
  width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 500; color: #fff;
}
.note-share-list-row .nm { flex: 1; font-size: 13px; color: var(--text); }
.note-share-list-row select {
  height: 28px; font-size: 11px; padding: 0 6px; width: auto;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border); border-radius: 4px;
}
.note-share-list-row .rm {
  width: 24px; height: 24px; padding: 0;
  display: flex; align-items: center; justify-content: center;
  background: transparent; border: none; cursor: pointer;
  color: var(--text3); font-size: 14px; font-weight: 700;
}
.note-share-list-row .rm:hover { color: var(--danger); }

/* ============================================================
   SIDEBAR — SECTION DRAG-SORT
   ============================================================ */
.section-drag-label {
  position: relative;
}
.section-drag-handle {
  position: absolute;
  left: -2px;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex; align-items: center; justify-content: center;
  width: 12px; height: 14px;
  color: var(--text3);
  cursor: grab;
  opacity: 0;
  transition: opacity 0.15s;
  font-size: 11px;
  letter-spacing: -2px;
  user-select: none;
  pointer-events: auto;
}
.section-drag-handle:active { cursor: grabbing; }
.sortable-section:hover .section-drag-handle,
.section-drag-handle:focus-visible { opacity: 0.7; }
.section-drag-handle:hover { opacity: 1; color: var(--text2); }

.sortable-section.section-dragging { opacity: 0.4; }
.sortable-section.section-drop-before { box-shadow: inset 0 2px 0 0 var(--accent); }
.sortable-section.section-drop-after  { box-shadow: inset 0 -2px 0 0 var(--accent); }

/* Mobile: Drag-Handle immer sichtbar (kein Hover) */
@media (hover: none) {
  .section-drag-handle { opacity: 0.5; }
}

/* ============================================================
   MEDIATHEK
   ============================================================ */
.mediathek-box {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface2);
  padding: 8px 10px;
  margin-bottom: 6px;
  transition: border-color 0.15s, background 0.15s;
}
.mediathek-box.drag {
  border-color: var(--accent);
  background: rgba(91,106,240,0.08);
}
.mediathek-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.mediathek-title {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  user-select: none;
}
.mediathek-chev {
  font-size: 9px;
  color: var(--text3);
  width: 10px;
  display: inline-block;
  text-align: center;
}
.mediathek-count {
  font-size: 11px;
  color: var(--text3);
  background: var(--surface);
  padding: 1px 7px;
  border-radius: 10px;
  border: 1px solid var(--border);
}
.mediathek-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}
.media-view-switch {
  display: flex;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1px;
  gap: 1px;
}
.media-view-switch button {
  background: transparent;
  border: none;
  color: var(--text3);
  font-size: 13px;
  width: 24px;
  height: 22px;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  padding: 0;
}
.media-view-switch button.active {
  background: var(--accent);
  color: #fff;
}
.media-view-switch button:hover:not(.active) {
  background: var(--surface2);
  color: var(--text);
}
.media-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text2);
  font-size: 12px;
  height: 24px;
  padding: 0 8px;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  line-height: 1;
}
.media-btn:hover { background: var(--surface2); color: var(--text); }
.media-btn-close:hover { background: var(--danger); color: #fff; border-color: var(--danger); }

.mediathek-body { margin-top: 8px; }

/* Kachel-Grid (Standard) — Max 140px */
.media-grid {
  display: grid;
  gap: 8px;
}
.media-grid-tile { grid-template-columns: repeat(auto-fill, minmax(110px, 140px)); }
.media-grid-sm   { grid-template-columns: repeat(auto-fill, minmax(50px, 60px)); }
.media-grid-max  { grid-template-columns: repeat(auto-fill, minmax(160px, 200px)); }

.media-tile {
  position: relative;
  aspect-ratio: 1;
  border-radius: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  cursor: pointer;
  overflow: hidden;
  transition: transform 0.12s, border-color 0.12s;
}
.media-tile:hover { border-color: var(--accent); transform: scale(1.02); }
.media-tile-img {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-color: var(--surface2);
}
.media-fileicon {
  display: flex !important;
  align-items: center;
  justify-content: center;
  background: var(--surface) !important;
}
.media-icon-glyph {
  font-size: 28px;
  line-height: 1;
  opacity: 0.9;
}
.media-grid-sm .media-icon-glyph { font-size: 22px; }
.media-grid-max .media-icon-glyph { font-size: 40px; }
.media-tile-label {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 3px 5px;
  background: linear-gradient(transparent, rgba(0,0,0,0.78));
  font-size: 10px;
  color: #fff;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  pointer-events: none;
}
.media-tile-del {
  position: absolute;
  top: 4px; right: 4px;
  width: 20px; height: 20px;
  border-radius: 50%;
  border: none;
  background: rgba(0,0,0,0.6);
  color: #fff;
  font-size: 12px;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.media-tile:hover .media-tile-del { display: flex; }
.media-tile-del:hover { background: var(--danger); }

/* Liste */
.media-list { display: flex; flex-direction: column; gap: 2px; }
.media-row {
  display: grid;
  grid-template-columns: 28px 1fr 130px 70px 22px;
  gap: 8px;
  padding: 4px 6px;
  font-size: 12px;
  border-radius: 4px;
  align-items: center;
  cursor: pointer;
}
.media-row:hover { background: var(--surface); }
.media-row-thumb {
  width: 24px; height: 24px;
  border-radius: 3px;
  background-size: cover;
  background-position: center;
  background-color: var(--surface);
  border: 1px solid var(--border);
}
.media-row-thumb.media-fileicon .media-icon-glyph { font-size: 14px; }
.media-row-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
}
.media-row-src { color: var(--text3); font-size: 11px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.media-row-size { color: var(--text3); font-size: 11px; text-align: right; }
.media-row-del {
  background: transparent;
  border: none;
  color: var(--text3);
  font-size: 14px;
  cursor: pointer;
  padding: 0;
  border-radius: 3px;
  width: 22px; height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.media-row-del:hover { color: #fff; background: var(--danger); }

/* Maximieren-Overlay */
.mediathek-max-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.82);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.mediathek-max-box {
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 1300px;
  height: 92vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,0.6);
}
.mediathek-max-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  gap: 12px;
  flex-shrink: 0;
}
.mediathek-max-strip {
  flex-shrink: 0;
  display: flex;
  gap: 6px;
  padding: 10px 14px;
  overflow-x: auto;
  overflow-y: hidden;
  border-bottom: 1px solid var(--border);
  background: var(--surface2);
  scrollbar-width: thin;
}
.media-strip-thumb {
  flex-shrink: 0;
  width: 64px;
  height: 64px;
  border-radius: 5px;
  border: 2px solid transparent;
  cursor: pointer;
  overflow: hidden;
  position: relative;
  background: var(--surface);
  transition: border-color 0.12s, transform 0.12s;
}
.media-strip-thumb:hover { border-color: var(--border2); transform: scale(1.04); }
.media-strip-thumb.selected { border-color: var(--accent); }
.media-strip-img {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-color: var(--surface2);
}
.media-strip-img.media-fileicon { display: flex; align-items: center; justify-content: center; }
.media-strip-img.media-fileicon .media-icon-glyph { font-size: 24px; }
.mediathek-max-preview {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  position: relative;
  background: var(--surface2);
}
.mediathek-max-preview-wrap {
  flex: 1;
  min-height: 0;
  position: relative;
  display: flex;
  align-items: stretch;
}
.media-nav-arrow {
  flex-shrink: 0;
  width: 56px;
  align-self: stretch;
  background: var(--surface2);
  border: none;
  border-right: 1px solid var(--border);
  color: var(--text);
  font-size: 36px;
  line-height: 1;
  cursor: pointer;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, opacity 0.15s;
  padding-bottom: 4px;
}
.media-nav-next { border-right: none; border-left: 1px solid var(--border); }
.media-nav-arrow:hover:not(:disabled) { background: var(--surface); color: var(--accent2); }
.media-nav-arrow:disabled { opacity: 0.25; cursor: default; }
.mediathek-max-preview-wrap .mediathek-max-preview {
  flex: 1;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.media-preview-wrap {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  overflow: hidden;
}
.media-preview-meta {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 16px;
  border-top: 1px solid var(--border);
  background: var(--surface);
  font-size: 12px;
}
.media-preview-name {
  color: var(--text);
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
}
.media-preview-src { color: var(--text3); flex-shrink: 0; }
.media-preview-download {
  color: var(--accent2);
  text-decoration: none;
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  flex-shrink: 0;
  font-size: 14px;
  background: transparent;
  cursor: pointer;
  font-family: inherit;
  line-height: 1.4;
}
.media-preview-download:hover { background: var(--surface2); }
