:root{--bg:#f5f7fb;--panel:#fff;--soft:#eef3fb;--soft2:#e5edf7;--text:#142033;--muted:#64748b;--border:#d7e0ea;--primary:#2563eb;--primary2:#1d4ed8;--danger:#dc2626;--warning:#d97706;--success:#16a34a;--shadow:0 18px 50px rgba(15,23,42,.08);--radius:18px}body.dark{--bg:#0f172a;--panel:#111827;--soft:#172033;--soft2:#1f2937;--text:#e5e7eb;--muted:#9ca3af;--border:#263244;--primary:#3b82f6;--primary2:#2563eb;--shadow:0 18px 50px rgba(0,0,0,.32)}*{box-sizing:border-box}html,body{margin:0;min-height:100%;font-family:Inter,ui-sans-serif,system-ui,-apple-system,"Segoe UI",sans-serif;background:var(--bg);color:var(--text)}button,input,select,textarea{font:inherit}button{border:0;cursor:pointer}button:disabled{opacity:.5;cursor:not-allowed}input,select,textarea{border:1px solid var(--border);background:var(--panel);color:var(--text);outline:none;border-radius:12px;padding:10px 12px}textarea{min-height:120px;resize:vertical}.hidden{display:none!important}.muted{color:var(--muted)}.full{width:100%}.primary,.secondary,.danger,.icon{border-radius:12px;font-weight:800;padding:10px 13px}.primary{background:var(--primary);color:#fff}.primary:hover{background:var(--primary2)}.secondary{background:var(--soft);color:var(--text)}.secondary:hover,.icon:hover{background:var(--soft2)}.danger{background:var(--danger);color:#fff}.small{padding:7px 10px;font-size:13px}.icon{background:transparent;color:var(--text);padding:8px 10px}.toast{position:fixed;right:22px;bottom:22px;z-index:9999;background:#111827;color:#fff;padding:13px 16px;border-radius:14px;box-shadow:var(--shadow);font-weight:800}.auth-screen{min-height:100vh;display:grid;place-items:center;padding:28px;background:radial-gradient(circle at 18% 12%,rgba(37,99,235,.18),transparent 34%),radial-gradient(circle at 82% 78%,rgba(6,182,212,.14),transparent 35%),var(--bg)}.auth-card{width:min(980px,100%)}.brand{display:flex;align-items:center;gap:14px;margin-bottom:18px}.brand h1{margin:0;font-size:34px;letter-spacing:-.05em}.brand p{margin:4px 0;color:var(--muted)}.brand-logo{width:58px;height:58px;display:grid;place-items:center;border-radius:20px;background:linear-gradient(135deg,#2563eb,#06b6d4);color:#fff;font-weight:900;font-size:28px;box-shadow:0 16px 35px rgba(37,99,235,.25)}.brand-logo.small{width:42px;height:42px;border-radius:14px;font-size:22px}.auth-grid{display:grid;grid-template-columns:1fr 1fr;gap:18px}.card,.panel,.form-card{background:var(--panel);border:1px solid var(--border);border-radius:var(--radius);box-shadow:var(--shadow);padding:20px}.form-card{display:grid;gap:10px}.form-card h2,.panel h2{margin:0 0 10px;letter-spacing:-.03em}.demo-box{background:var(--soft);padding:12px;border-radius:14px;color:var(--muted);line-height:1.6}.shell{display:grid;grid-template-columns:300px 1fr;height:100vh;overflow:hidden}.sidebar{display:flex;flex-direction:column;gap:12px;background:var(--panel);border-right:1px solid var(--border);padding:16px;overflow:hidden}.sidebar-head{display:flex;align-items:center;gap:12px;padding-bottom:12px;border-bottom:1px solid var(--border)}.sidebar-title{min-width:0;flex:1}.sidebar-title b,.sidebar-title span{display:block;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.sidebar-title span{color:var(--muted);font-size:12px;font-weight:700}.nav{display:grid;gap:5px}.nav-btn{display:flex;align-items:center;gap:10px;background:transparent;color:var(--text);padding:10px 11px;border-radius:12px;text-align:left}.nav-btn:hover,.nav-btn.active{background:var(--soft)}.side-scroll{overflow:auto;min-height:0;padding-right:2px}.side-title{font-size:12px;font-weight:900;letter-spacing:.13em;color:var(--muted);margin:14px 0 8px}.notebook-item{width:100%;display:flex;align-items:center;justify-content:space-between;gap:8px;background:transparent;color:var(--text);padding:10px;border-radius:12px;text-align:left}.notebook-item:hover,.notebook-item.active{background:var(--soft)}.notebook-item span{min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.notebook-item small{background:var(--soft);color:var(--muted);border-radius:999px;padding:3px 7px}.sidebar-collapsed{grid-template-columns:82px 1fr}.sidebar-collapsed .sidebar{padding:12px}.sidebar-collapsed .sidebar-title,.sidebar-collapsed .nav-btn b,.sidebar-collapsed .side-label,.sidebar-collapsed .side-title,.sidebar-collapsed .notebook-item span,.sidebar-collapsed .notebook-item small{display:none}.sidebar-collapsed .nav-btn{justify-content:center}.main{height:100vh;overflow:auto}.topbar{position:sticky;top:0;z-index:5;display:flex;align-items:center;justify-content:space-between;gap:16px;padding:18px 24px;border-bottom:1px solid var(--border);background:rgba(245,247,251,.86);backdrop-filter:blur(18px)}body.dark .topbar{background:rgba(15,23,42,.86)}.topbar h1{margin:0;font-size:28px;letter-spacing:-.05em}.topbar p{margin:4px 0 0;color:var(--muted)}.top-actions{display:flex;gap:8px}.content{padding:22px}.home-grid{display:grid;grid-template-columns:repeat(4,minmax(140px,1fr));gap:16px}.stat-card{background:var(--panel);border:1px solid var(--border);border-radius:var(--radius);box-shadow:var(--shadow);padding:18px}.stat-card span{color:var(--muted);font-weight:800}.stat-card strong{display:block;margin-top:6px;font-size:34px;letter-spacing:-.05em}.wide{grid-column:span 2}.btn-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px}.note-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(230px,1fr));gap:14px}.note-card{background:var(--soft);border:1px solid var(--border);border-radius:18px;padding:15px;min-height:145px;cursor:pointer;display:flex;flex-direction:column}.note-card:hover{border-color:var(--primary);transform:translateY(-1px)}.note-card h3{margin:0 0 8px}.note-card p{margin:0;flex:1;color:var(--muted);line-height:1.5}.note-card span{font-size:11px;font-weight:900;color:var(--muted);margin-top:10px}.list-line,.user-row,.history-row,.task-row,.attach-row,.audit-row,.mail-card,.comment,.chat-msg{display:flex;gap:12px;align-items:center;justify-content:space-between;padding:12px;border-radius:14px;background:var(--soft);margin:8px 0}.list-line div,.user-row div{min-width:0}.list-line span,.user-row small,.history-row small,.task-row small,.mail-card small,.comment small,.chat-msg small{display:block;color:var(--muted);font-size:12px}.unread{border:1px solid var(--primary)}.split{display:grid;grid-template-columns:330px 1fr;gap:16px;min-height:calc(100vh - 132px)}.notelist-collapsed .split{grid-template-columns:76px 1fr}.list-panel,.editor-panel{background:var(--panel);border:1px solid var(--border);border-radius:var(--radius);box-shadow:var(--shadow);overflow:hidden}.panel-head{display:flex;justify-content:space-between;align-items:center;gap:8px;padding:14px;border-bottom:1px solid var(--border)}.panel-head h2{margin:0;font-size:18px}.notes-list{height:calc(100vh - 220px);overflow:auto;padding:10px}.note-row{width:100%;display:block;text-align:left;background:transparent;color:var(--text);border-radius:14px;padding:12px}.note-row:hover,.note-row.active{background:var(--soft)}.note-row b,.note-row small{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.note-row small{color:var(--muted);font-size:12px;margin-top:4px}.notelist-collapsed .list-panel h2,.notelist-collapsed .note-row small,.notelist-collapsed .note-row b:not(:first-letter),.notelist-collapsed .danger{display:none}.locked,.empty{display:grid;place-content:center;text-align:center;min-height:420px;padding:28px;color:var(--muted)}.editor-shell{display:flex;flex-direction:column;height:100%;padding:16px}.title-input{border:0;border-bottom:1px solid var(--border);border-radius:0;background:transparent;font-size:28px;font-weight:900;letter-spacing:-.04em;padding:4px 2px 12px}.meta-grid,.search-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:8px;margin:12px 0}.toolbar{display:flex;flex-wrap:wrap;gap:5px;padding:8px;border:1px solid var(--border);border-radius:14px;background:var(--soft);margin-bottom:8px}.toolbar button{background:transparent;color:var(--text);border-radius:9px;padding:7px 9px;font-weight:800}.toolbar button:hover{background:var(--soft2)}.note-editor{flex:1;min-height:360px;padding:18px;border:1px solid var(--border);border-radius:16px;background:var(--panel);line-height:1.7;overflow:auto}.note-editor.editing{outline:2px solid rgba(37,99,235,.18)}.note-editor table{border-collapse:collapse;width:100%;margin:10px 0}.note-editor td,.note-editor th{border:1px solid var(--border);padding:8px;min-width:80px}.note-editor img{max-width:100%;border-radius:12px}.actionbar{display:flex;flex-wrap:wrap;gap:8px;margin:12px 0}.warning-box{padding:10px 12px;border-radius:12px;background:rgba(217,119,6,.13);color:var(--warning);font-weight:800;margin:8px 0}.tabs-panel details{background:var(--soft);border-radius:14px;padding:10px 12px;margin:8px 0}.tabs-panel summary{font-weight:900;cursor:pointer}.find-panel{display:grid;grid-template-columns:1fr 1fr auto auto auto auto auto;gap:6px;align-items:center;background:var(--soft);border:1px solid var(--border);border-radius:14px;padding:8px;margin:8px 0}.inline-form{display:flex;gap:8px;margin-top:10px}.inline-form input,.inline-form select{flex:1}.admin-grid,.mail-grid,.chat-layout{display:grid;grid-template-columns:330px 1fr;gap:16px}.chat-list{height:55vh;overflow:auto;border:1px solid var(--border);border-radius:16px;padding:10px}.chat-msg,.mail-card,.comment{display:block}.audit-row{display:block}.audit-row pre{white-space:pre-wrap;overflow:auto}.pad{padding:12px}@media(max-width:1200px){.home-grid{grid-template-columns:repeat(2,1fr)}.wide{grid-column:span 2}.split{grid-template-columns:290px 1fr}.meta-grid,.search-grid{grid-template-columns:1fr 1fr}.admin-grid,.mail-grid,.chat-layout{grid-template-columns:1fr}}@media(max-width:780px){.shell{display:block;height:auto}.sidebar{height:auto;max-height:none;border-right:0;border-bottom:1px solid var(--border)}.main{height:auto}.topbar{position:relative;display:grid}.top-actions{flex-wrap:wrap}.content{padding:14px}.home-grid{grid-template-columns:1fr}.wide{grid-column:span 1}.split{grid-template-columns:1fr}.notes-list{height:auto;max-height:260px}.meta-grid,.search-grid{grid-template-columns:1fr}.find-panel{grid-template-columns:1fr}.inline-form{display:grid}.list-line,.user-row,.history-row,.task-row,.attach-row{display:grid;align-items:start}.auth-grid{grid-template-columns:1fr}.sidebar-collapsed{display:block}.sidebar-collapsed .sidebar-title,.sidebar-collapsed .nav-btn b,.sidebar-collapsed .side-label,.sidebar-collapsed .side-title,.sidebar-collapsed .notebook-item span,.sidebar-collapsed .notebook-item small{display:initial}.sidebar-collapsed .nav-btn{justify-content:flex-start}}


/* v7 UI fixes */
.tools-parent{justify-content:space-between}.tools-parent em{margin-left:auto;font-style:normal;color:var(--muted);font-weight:900}.tools-group{display:grid;gap:5px;padding-left:10px;border-left:2px solid var(--soft2);margin-left:12px}.tools-group .nav-btn{padding:9px 10px}.side-toggle{width:100%;display:flex;align-items:center;justify-content:space-between;background:transparent;color:var(--muted);border-radius:10px;padding:6px 4px;text-align:left}.side-toggle:hover{background:var(--soft)}.side-group-body{display:grid;gap:3px}.section-heading{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;margin-bottom:14px}.section-heading h2{margin:0}.template-card button{margin-top:12px}.settings-panel{max-width:1100px}.settings-row{display:grid;grid-template-columns:220px 1fr;align-items:center;gap:12px;padding:12px 14px;border-radius:14px;background:var(--soft);margin:10px 0}.settings-actions{display:flex;gap:8px;justify-content:flex-end;flex-wrap:wrap}.settings-row>.secondary,.settings-row>.primary{justify-self:end}.editor-panel{min-width:0}.list-panel{min-width:260px}.split{grid-template-columns:minmax(280px,330px) minmax(0,1fr)}.notelist-collapsed .split{grid-template-columns:72px minmax(0,1fr)}.notelist-collapsed .list-panel{min-width:72px}.notelist-collapsed .panel-head{padding:10px 6px}.notelist-collapsed .panel-head div{display:grid;gap:4px}.notelist-collapsed .notes-list{padding:6px}.notelist-collapsed .note-row{padding:10px 6px}.notelist-collapsed .note-row b{display:block;width:1.2em;overflow:hidden;white-space:nowrap}.tabs-panel details:not([open]){padding:10px 12px}.tabs-panel details[open]{max-height:260px;overflow:auto}.note-editor{min-height:430px}.editor-shell{min-width:0}.title-input{width:100%}.meta-grid{grid-template-columns:minmax(120px,160px) minmax(180px,1fr) minmax(150px,1fr) minmax(150px,1fr)}button:not(.primary):not(.secondary):not(.danger):not(.icon):not(.nav-btn):not(.notebook-item):not(.note-row):not(.side-toggle){background:var(--soft);color:var(--text);border-radius:10px;padding:8px 10px;font-weight:800}button:not(.primary):not(.secondary):not(.danger):not(.icon):not(.nav-btn):not(.notebook-item):not(.note-row):not(.side-toggle):hover{background:var(--soft2)}

@media(max-width:1100px){.shell{grid-template-columns:260px 1fr}.split{grid-template-columns:minmax(240px,300px) minmax(0,1fr)}.meta-grid{grid-template-columns:1fr 1fr}.note-editor{min-height:360px}}
@media(max-width:900px){.shell{grid-template-columns:1fr}.sidebar{position:relative;height:auto;max-height:55vh}.side-scroll{max-height:32vh}.topbar{position:relative}.split{grid-template-columns:1fr}.list-panel{min-width:0}.notes-list{height:auto;max-height:240px}.notelist-collapsed .split{grid-template-columns:1fr}.notelist-collapsed .list-panel{min-width:0}.notelist-collapsed .notes-list{display:none}.settings-row{grid-template-columns:1fr}.settings-row>.secondary,.settings-row>.primary,.settings-actions{justify-self:stretch}.settings-actions .primary,.settings-actions .secondary{width:100%}}
@media(max-width:560px){.content{padding:10px}.topbar{padding:14px}.topbar h1{font-size:23px}.top-actions{width:100%}.top-actions button{flex:1}.card,.panel,.form-card{padding:14px;border-radius:14px}.editor-shell{padding:10px}.actionbar,.toolbar{gap:4px}.actionbar button,.toolbar button{font-size:12px;padding:7px 8px}.title-input{font-size:22px}.meta-grid{grid-template-columns:1fr}.note-editor{min-height:320px;padding:12px}.find-panel{grid-template-columns:1fr}.tools-group{padding-left:6px;margin-left:6px}.auth-screen{padding:14px}}

/* v8 final responsive + collapse fixes */
.shell.sidebar-collapsed{grid-template-columns:76px minmax(0,1fr)}
.sidebar-collapsed .sidebar{align-items:center;padding:12px 8px;gap:10px;overflow:visible}
.sidebar-collapsed .sidebar-head{width:100%;justify-content:center;gap:0;border-bottom:1px solid var(--border);padding-bottom:10px}
.sidebar-collapsed .sidebar-head .brand-logo{width:40px;height:40px;min-width:40px}
.sidebar-collapsed .sidebar-title,
.sidebar-collapsed .side-label,
.sidebar-collapsed .side-scroll,
.sidebar-collapsed .tools-group{display:none!important}
.sidebar-collapsed .nav{width:100%;display:grid;gap:7px}
.sidebar-collapsed .nav-btn,
.sidebar-collapsed .tools-parent{width:48px;height:44px;display:grid;place-items:center;justify-content:center;padding:0;margin:0 auto;border-radius:14px}
.sidebar-collapsed .nav-btn span,
.sidebar-collapsed .tools-parent span{font-size:18px}
.sidebar-collapsed .nav-btn b,
.sidebar-collapsed .tools-parent b,
.sidebar-collapsed .tools-parent em{display:none!important}
.sidebar-collapsed .icon[data-action="toggleSidebar"]{position:absolute;top:54px;right:-14px;width:30px;height:30px;display:grid;place-items:center;padding:0;border:1px solid var(--border);background:var(--panel);box-shadow:var(--shadow);z-index:20}

.split{grid-template-columns:minmax(300px,340px) minmax(0,1fr)}
.list-panel{min-width:300px}.editor-panel{min-width:0}.editor-shell{min-width:0}.notes-list{min-width:0}.note-row b,.note-row small{max-width:100%}
.notelist-collapsed .split{grid-template-columns:64px minmax(0,1fr)}
.notelist-collapsed .list-panel{min-width:64px;width:64px;overflow:visible}
.notelist-collapsed .panel-head{height:100%;min-height:calc(100vh - 150px);display:flex;flex-direction:column;justify-content:flex-start;align-items:center;padding:12px 6px;gap:12px}
.notelist-collapsed .panel-head h2{writing-mode:vertical-rl;transform:rotate(180deg);font-size:13px;max-height:220px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;margin-top:8px}
.notelist-collapsed .panel-head>div{display:grid;gap:6px}.notelist-collapsed .panel-head .danger,.notelist-collapsed .panel-head button:not([data-action="toggleNoteList"]){display:none!important}
.notelist-collapsed .notes-list{display:none!important}

.template-layout{display:grid;grid-template-columns:minmax(280px,360px) minmax(0,1fr);gap:16px;align-items:start}.template-form{position:sticky;top:96px}.template-actions{display:flex;flex-wrap:wrap;gap:8px;margin-top:12px}.template-actions button{font-size:12px;padding:7px 9px}.template-card{min-height:190px}.template-card span{display:block}

@media(max-width:1100px){.template-layout{grid-template-columns:1fr}.template-form{position:relative;top:auto}.split{grid-template-columns:minmax(260px,300px) minmax(0,1fr)}}
@media(max-width:900px){.shell.sidebar-collapsed{display:block}.sidebar-collapsed .sidebar{align-items:stretch}.sidebar-collapsed .sidebar-title,.sidebar-collapsed .side-label,.sidebar-collapsed .side-scroll,.sidebar-collapsed .tools-group{display:block!important}.sidebar-collapsed .nav-btn,.sidebar-collapsed .tools-parent{width:100%;height:auto;display:flex;justify-content:flex-start;padding:10px 11px}.sidebar-collapsed .nav-btn b,.sidebar-collapsed .tools-parent b,.sidebar-collapsed .tools-parent em{display:block!important}.sidebar-collapsed .icon[data-action="toggleSidebar"]{position:static;width:auto;height:auto;border:0;box-shadow:none}.sidebar-collapsed .sidebar-head{justify-content:flex-start;gap:12px}.split,.notelist-collapsed .split{grid-template-columns:1fr}.list-panel,.notelist-collapsed .list-panel{min-width:0;width:auto}.notelist-collapsed .panel-head{min-height:auto;height:auto;flex-direction:row;justify-content:space-between}.notelist-collapsed .panel-head h2{writing-mode:initial;transform:none;font-size:18px}.notelist-collapsed .notes-list{display:none!important}}

/* v9 sidebar fixed bottom toggle + custom modal system */
.sidebar{position:relative;padding-bottom:72px!important;}
.sidebar-bottom-toggle{position:sticky;bottom:0;z-index:50;margin-top:auto;padding:10px 0 0;background:linear-gradient(to top,var(--panel) 82%,rgba(255,255,255,0));border-top:1px solid var(--border)}
.sidebar-bottom-toggle button{display:flex;align-items:center;justify-content:center;gap:8px;box-shadow:var(--shadow)}
.sidebar-collapsed .sidebar-bottom-toggle{width:100%;padding:10px 0;background:var(--panel)}
.sidebar-collapsed .sidebar-bottom-toggle button{width:48px;height:44px;margin:0 auto;padding:0;border-radius:14px}
.sidebar-collapsed .sidebar-bottom-toggle b{display:none!important}
.sidebar-collapsed .sidebar-bottom-toggle span{font-size:22px;line-height:1}
.sidebar-collapsed .icon[data-action="toggleSidebar"]{display:none!important}
@media(max-width:900px){.sidebar{padding-bottom:18px!important}.sidebar-bottom-toggle{position:relative}.sidebar-collapsed .sidebar-bottom-toggle button{width:100%;height:auto;padding:10px 12px}.sidebar-collapsed .sidebar-bottom-toggle b{display:inline!important}}

.modal-backdrop{position:fixed;inset:0;z-index:20000;display:grid;place-items:center;padding:20px;background:rgba(15,23,42,.55);backdrop-filter:blur(8px)}
.app-modal{width:min(520px,calc(100vw - 28px));max-height:min(82vh,760px);display:flex;flex-direction:column;border:1px solid var(--border);border-radius:22px;background:var(--panel);color:var(--text);box-shadow:0 24px 80px rgba(0,0,0,.3);overflow:hidden;animation:modalIn .16s ease-out}
@keyframes modalIn{from{opacity:0;transform:translateY(10px) scale(.985)}to{opacity:1;transform:none}}
.modal-head{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:16px 18px;border-bottom:1px solid var(--border);background:var(--soft)}
.modal-head h2{font-size:18px;line-height:1.2;margin:0;letter-spacing:-.02em}.modal-x{width:34px;height:34px;display:grid;place-items:center;border-radius:10px;background:var(--panel)!important;color:var(--text)!important;padding:0!important}.modal-body{padding:18px;overflow:auto;line-height:1.55}.modal-body p{white-space:pre-wrap;margin:0 0 12px}.modal-actions{display:flex;justify-content:flex-end;gap:10px;padding:14px 18px;border-top:1px solid var(--border);background:var(--soft)}.modal-label{display:block;font-weight:900;margin:0 0 8px;color:var(--muted)}.modal-input{width:100%;min-height:42px;border:1px solid var(--border);border-radius:12px;background:var(--panel);color:var(--text);padding:10px 12px;outline:none}.modal-input:focus{border-color:var(--primary);box-shadow:0 0 0 3px rgba(37,99,235,.12)}.modal-textarea{min-height:180px;resize:vertical;font-family:inherit}.modal-actions .primary,.modal-actions .secondary,.modal-actions .danger{min-width:94px}.dark .modal-backdrop{background:rgba(0,0,0,.66)}
@media(max-width:560px){.modal-backdrop{padding:10px;place-items:end center}.app-modal{width:100%;max-height:90vh;border-radius:18px}.modal-actions{display:grid;grid-template-columns:1fr}.modal-actions button{width:100%}}

/* v10 fixes: robust sidebar bottom toggle, notebook action layout, locked search preview */
@media (min-width:901px){
  .sidebar{height:100vh!important;max-height:none!important;display:flex!important;flex-direction:column!important;overflow:hidden!important;padding-bottom:12px!important;}
  .sidebar .side-scroll{flex:1 1 auto;min-height:0;overflow:auto;}
  .sidebar .sidebar-bottom-toggle{flex:0 0 auto;position:sticky;bottom:0;z-index:80;margin-top:auto;background:linear-gradient(to top,var(--panel) 85%,rgba(255,255,255,0));}
  body.dark .sidebar .sidebar-bottom-toggle{background:linear-gradient(to top,var(--panel) 85%,rgba(17,24,39,0));}
  .sidebar-collapsed .sidebar{padding-bottom:12px!important;}
  .sidebar-collapsed .nav{flex:0 0 auto;}
  .sidebar-collapsed .sidebar-bottom-toggle{margin-top:auto!important;display:block!important;}
}
.notebook-head{display:flex;flex-direction:column;align-items:stretch!important;justify-content:flex-start!important;gap:10px;}
.notebook-head h2{width:100%;line-height:1.25;white-space:normal;overflow-wrap:anywhere;}
.notebook-actions{display:flex!important;align-items:center;justify-content:flex-start;gap:8px;flex-wrap:wrap;width:100%;}
.notebook-actions .icon,.notebook-actions .danger{min-width:38px;}
.note-card.locked-preview{border-style:dashed;}
.note-card.locked-preview p{font-weight:800;color:var(--warning);}
.notelist-collapsed .notebook-head{align-items:center!important;}
.notelist-collapsed .notebook-actions{justify-content:center;}
@media(max-width:900px){.notebook-head{flex-direction:row;align-items:center!important;justify-content:space-between!important}.notebook-actions{width:auto;justify-content:flex-end}}

/* v11 fixes and new workspace/editor features */
.workspace-tabs{border:1px solid var(--border);border-radius:14px;background:var(--soft);padding:8px;margin-bottom:10px;overflow:auto}
.tab-row{display:flex;gap:6px;align-items:center;overflow:auto;padding-bottom:4px}
.note-tab{display:inline-flex!important;align-items:center;gap:8px;white-space:nowrap;border-radius:999px!important;padding:7px 10px!important;background:var(--panel)!important;color:var(--text)!important;border:1px solid var(--border)!important}
.note-tab.active{background:var(--primary)!important;color:white!important;border-color:var(--primary)!important}
.note-tab span{display:inline-grid;place-items:center;width:18px;height:18px;border-radius:999px;background:rgba(0,0,0,.08);font-weight:900}
.split-preview{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:8px;margin-top:8px}
.side-note{max-height:220px;overflow:auto;border:1px solid var(--border);background:var(--panel);border-radius:12px;padding:10px}
.side-note h3{margin:0 0 8px;font-size:16px}.side-note p{margin:.4em 0}
.floating-layer{position:fixed;inset:0;pointer-events:none;z-index:15000}.floating-note{position:absolute;width:min(420px,calc(100vw - 24px));max-height:460px;display:flex;flex-direction:column;pointer-events:auto;background:var(--panel);border:1px solid var(--border);border-radius:16px;box-shadow:0 22px 70px rgba(0,0,0,.28);overflow:hidden}.floating-head{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:10px 12px;background:var(--soft);border-bottom:1px solid var(--border);cursor:move}.floating-head b{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.floating-head span{display:flex;gap:6px}.floating-body{padding:12px;overflow:auto;line-height:1.55}.floating-body img{max-width:100%}
.rich-toolbar{position:sticky;top:0;z-index:5;align-items:center;gap:5px;max-height:110px;overflow:auto}.rich-toolbar select{height:34px;border:1px solid var(--border);background:var(--panel);color:var(--text);border-radius:10px;padding:0 8px;font-weight:800}.color-tool{height:34px;min-width:34px;display:inline-grid;place-items:center;position:relative;border-radius:10px;background:var(--soft);font-weight:900}.color-tool input{position:absolute;inset:0;opacity:0;cursor:pointer}.checklist{list-style:none;padding-left:18px}.fullscreen-editor{position:fixed!important;inset:14px!important;z-index:19000!important;background:var(--panel)!important;border:1px solid var(--border);border-radius:18px;box-shadow:0 24px 80px rgba(0,0,0,.35);padding:14px!important;overflow:auto}.fullscreen-editor .note-editor{min-height:calc(100vh - 260px)}
.editor-shell .tabs-panel{display:block}.editor-shell:has(.note-editor.editing) .tabs-panel{display:none!important}.note-editor.editing{min-height:560px}.modal-body .modal-label{margin-top:10px}.modal-body .modal-label:first-child{margin-top:0}.modal-body select.modal-input{height:42px}.sidebar-bottom-toggle{position:sticky!important;bottom:0!important;z-index:999!important}.sidebar-collapsed .sidebar-bottom-toggle{display:block!important;visibility:visible!important}.sidebar-collapsed .sidebar-bottom-toggle button{display:grid!important;place-items:center!important}.notelist-collapsed .notes-list{display:none!important}.notelist-collapsed .list-panel{min-width:64px!important;max-width:64px!important}.notelist-collapsed .panel-head h2{writing-mode:vertical-rl;transform:rotate(180deg);font-size:14px;max-height:180px;overflow:hidden}.notelist-collapsed .notebook-actions{display:grid!important;grid-template-columns:1fr!important;gap:5px}.notebook-head{align-items:flex-start;flex-direction:column}.notebook-actions{display:flex;gap:6px;flex-wrap:wrap;margin-top:4px}
@media(max-width:900px){.floating-note{left:12px!important;right:12px;width:auto}.rich-toolbar{max-height:150px}.note-editor.editing{min-height:420px}.workspace-tabs{margin-left:-4px;margin-right:-4px}.split-preview{grid-template-columns:1fr}.notelist-collapsed .panel-head h2{writing-mode:initial;transform:none}.notelist-collapsed .list-panel{max-width:none!important;min-width:0!important}}

/* ===== v12 UI refinements ===== */
.topbar{min-height:44px!important;padding:8px 18px!important;gap:12px!important;}
.topbar h1{font-size:23px!important;line-height:1.05!important;}
.topbar p{font-size:12px!important;margin-top:2px!important;}
.top-actions .secondary,.top-actions .danger{padding:8px 11px!important;border-radius:11px!important;}
.content{padding-top:16px!important;}
.split{min-height:calc(100vh - 90px)!important;}

.sidebar-head .icon[data-action="toggleSidebar"]{display:none!important;}
.sidebar{position:relative;}
.sidebar-bottom-toggle{position:sticky!important;bottom:0!important;z-index:999!important;margin-top:auto!important;padding:10px 0 0!important;background:linear-gradient(to top,var(--panel) 78%,rgba(255,255,255,0))!important;border-top:1px solid var(--border)!important;display:flex!important;justify-content:flex-end!important;}
body.dark .sidebar-bottom-toggle{background:linear-gradient(to top,var(--panel) 78%,rgba(17,24,39,0))!important;}
.sidebar-toggle-modern{width:38px!important;height:38px!important;border-radius:999px!important;display:grid!important;place-items:center!important;padding:0!important;background:var(--soft)!important;color:var(--text)!important;border:1px solid var(--border)!important;box-shadow:0 10px 24px rgba(15,23,42,.12)!important;font-size:20px!important;font-weight:900!important;line-height:1!important;}
.sidebar-toggle-modern:hover{background:var(--primary)!important;color:#fff!important;border-color:var(--primary)!important;transform:translateY(-1px);}
.sidebar-collapsed .sidebar-bottom-toggle{justify-content:center!important;width:100%!important;}
.sidebar-collapsed .sidebar-toggle-modern{width:44px!important;height:44px!important;border-radius:14px!important;font-size:22px!important;}

/* Toolbar is rendered only in edit mode; this keeps view mode clean. */
.editor-shell:not(:has(.note-editor.editing)) .rich-toolbar{display:none!important;}
.editor-shell:not(:has(.note-editor.editing)) .note-editor{min-height:560px;}

@media(max-width:900px){
  .topbar{padding:10px 14px!important;}
  .topbar h1{font-size:22px!important;}
  .sidebar-bottom-toggle{position:relative!important;justify-content:center!important;}
  .sidebar-toggle-modern{width:100%!important;max-width:160px!important;height:40px!important;border-radius:12px!important;}
}

/* ===== v13 refinements: compact tabs, top note action buttons, IP whitelist UI ===== */
.workspace-tabs{padding:5px 6px!important;margin-bottom:7px!important;border-radius:12px!important;}
.tab-row{gap:5px!important;padding-bottom:0!important;}
.note-tab{padding:5px 8px!important;font-size:12px!important;min-height:28px!important;border-radius:999px!important;}
.note-tab span{width:16px!important;height:16px!important;font-size:11px!important;}
.note-actionbar.view-actions{position:sticky;top:0;z-index:8;background:var(--panel);border:1px solid var(--border);border-radius:14px;padding:7px!important;margin:8px 0;display:flex;gap:6px;flex-wrap:wrap;align-items:center;box-shadow:0 10px 20px rgba(15,23,42,.05)}
.note-actionbar.editing-actions{padding:7px!important;margin:8px 0;}
.note-actionbar.view-actions button{padding:7px 10px!important;font-size:12px!important;border-radius:10px!important;}
.modal-panel-content{display:grid;gap:10px;min-width:min(640px,calc(100vw - 64px));}
.modal-panel-content .inline-form{display:grid;grid-template-columns:1fr auto auto;gap:8px;align-items:center;margin-top:10px;}
.modal-panel-content .history-row,.modal-panel-content .comment,.modal-panel-content .task-row,.modal-panel-content .attach-row{border:1px solid var(--border);background:var(--soft);border-radius:12px;padding:10px;}
.form-card textarea{min-height:86px;resize:vertical;border:1px solid var(--border);border-radius:12px;background:var(--panel);color:var(--text);padding:10px 12px;font:inherit;outline:none;}
.form-card textarea:focus{border-color:var(--primary);box-shadow:0 0 0 3px rgba(37,99,235,.12)}
.checkline{display:flex;align-items:center;gap:8px;font-weight:800;color:var(--muted);font-size:13px;}
.checkline input{width:auto!important;height:auto!important;}
.modal-check{margin:4px 0 8px;}
.ip-textarea{min-height:96px!important;}
.user-row small{line-height:1.45;}
@media(max-width:700px){
  .note-actionbar.view-actions{overflow:auto;flex-wrap:nowrap;}
  .note-actionbar.view-actions button{white-space:nowrap;}
  .modal-panel-content{min-width:0;}
  .modal-panel-content .inline-form{grid-template-columns:1fr;}
  .workspace-tabs{margin-left:-2px;margin-right:-2px;}
  .note-tab{font-size:11px!important;padding:5px 7px!important;}
}

/* ===== v14 refinements: compact density, top note action bar, heartbeat badge ===== */
:root{
  --compact-font:13px;
  --compact-radius:10px;
  --compact-gap:8px;
}
html{font-size:13px;}
body{font-size:var(--compact-font);}
.sidebar{width:238px!important;padding:10px!important;gap:7px!important;}
.sidebar-head{padding-bottom:8px!important;margin-bottom:6px!important;}
.brand-logo{width:32px!important;height:32px!important;border-radius:10px!important;font-size:16px!important;}
.sidebar-head b{font-size:13px!important;}
.sidebar-head small{font-size:10px!important;}
.nav-btn,.notebook-item{min-height:32px!important;padding:7px 9px!important;border-radius:10px!important;font-size:12px!important;}
.nav-btn span{font-size:14px!important;}
.side-title{font-size:10px!important;margin:8px 0 5px!important;letter-spacing:.08em!important;}
.primary,.secondary,.danger,button{font-size:12px!important;}
.primary,.secondary,.danger{padding:8px 10px!important;border-radius:10px!important;}
.topbar{min-height:34px!important;padding:5px 14px!important;gap:8px!important;}
.topbar h1{font-size:19px!important;line-height:1!important;margin:0!important;}
.topbar p{font-size:10px!important;margin-top:1px!important;}
.top-actions{gap:6px!important;}
.top-actions .secondary,.top-actions .danger{padding:6px 9px!important;border-radius:9px!important;font-size:11px!important;}
.content{padding:10px!important;}
.panel,.card,.list-panel,.editor-panel{border-radius:13px!important;}
.panel{padding:12px!important;}
.stat-card{padding:11px!important;border-radius:13px!important;}
.stat-card strong{font-size:24px!important;}
.split{gap:10px!important;min-height:calc(100vh - 62px)!important;}
.list-panel{min-width:260px!important;}
.panel-head{padding:10px!important;min-height:42px!important;}
.panel-head h2{font-size:15px!important;}
.notebook-actions{gap:5px!important;}
.notebook-actions .icon,.notebook-actions .danger{min-width:30px!important;height:30px!important;padding:5px!important;border-radius:9px!important;}
.notes-list{padding:8px!important;}
.note-row{padding:8px!important;border-radius:10px!important;}
.note-row b{font-size:12px!important;}.note-row small{font-size:10px!important;}
.editor-panel{padding:10px!important;}
.title-input{font-size:19px!important;min-height:36px!important;padding:4px 2px 8px!important;}
.meta-grid{gap:6px!important;margin:6px 0!important;}
.meta-grid input,.meta-grid select,input,select,textarea{min-height:32px!important;border-radius:10px!important;padding:7px 9px!important;font-size:12px!important;}
.note-editor{padding:12px!important;line-height:1.55!important;min-height:430px!important;border-radius:12px!important;}
.note-editor.editing{min-height:500px!important;}
.rich-toolbar{padding:6px!important;gap:4px!important;max-height:86px!important;border-radius:12px!important;}
.rich-toolbar button,.rich-toolbar select,.color-tool{height:28px!important;min-height:28px!important;padding:4px 7px!important;border-radius:8px!important;font-size:11px!important;}
.workspace-tabs{padding:4px 5px!important;margin-bottom:5px!important;border-radius:10px!important;}
.note-tab{padding:4px 7px!important;font-size:11px!important;min-height:24px!important;}
.note-tab span{width:14px!important;height:14px!important;font-size:10px!important;}
.note-actionbar.view-actions,.note-actionbar.editing-actions{position:sticky;top:0;z-index:12;margin:0 0 7px!important;padding:5px!important;border-radius:12px!important;background:var(--panel)!important;border:1px solid var(--border)!important;box-shadow:0 8px 18px rgba(15,23,42,.06)!important;}
.note-top-actionbar{display:flex!important;align-items:flex-start!important;justify-content:space-between!important;gap:8px!important;flex-wrap:wrap!important;}
.note-actions-left{display:flex;align-items:center;gap:5px;flex-wrap:wrap;min-width:0;flex:1 1 auto;}
.note-actions-right{display:flex;align-items:center;justify-content:flex-end;min-width:max-content;}
.note-actionbar button{padding:5px 8px!important;font-size:11px!important;border-radius:8px!important;min-height:28px!important;}
.edit-status-pill{display:inline-flex;align-items:center;gap:5px;white-space:nowrap;border-radius:999px;padding:5px 8px;font-size:10px;font-weight:900;background:rgba(217,119,6,.12);color:var(--warning);border:1px solid rgba(217,119,6,.18);}
.edit-status-pill.locked-other{background:rgba(220,38,38,.10);color:var(--danger);border-color:rgba(220,38,38,.18);}
.warning-box{display:none!important;}
.note-grid{gap:10px!important;}.note-card{padding:11px!important;border-radius:12px!important;min-height:118px!important;}.note-card h3{font-size:14px!important;margin-bottom:5px!important;}.note-card p{font-size:11px!important;line-height:1.45!important;}.note-card span{font-size:10px!important;}
.modal-card{max-width:min(680px,calc(100vw - 28px))!important;border-radius:16px!important;}.modal-head{padding:12px 14px!important;}.modal-body{padding:14px!important;}.modal-actions{padding:10px 14px!important;}
.form-card{gap:7px!important;}.form-card h2{font-size:18px!important;}.form-card label{font-size:11px!important;}
.sidebar-toggle-modern{width:34px!important;height:34px!important;font-size:18px!important;}
.sidebar-collapsed .sidebar{width:58px!important;padding:8px!important;}
.sidebar-collapsed .sidebar-toggle-modern{width:38px!important;height:38px!important;font-size:20px!important;}
.sidebar-collapsed .brand-text,.sidebar-collapsed .side-label,.sidebar-collapsed .nav-btn b,.sidebar-collapsed .nav-btn em,.sidebar-collapsed .side-section{display:none!important;}
.sidebar-collapsed .sidebar-bottom-toggle{justify-content:center!important;border-top:none!important;padding-top:8px!important;}
@media(max-width:900px){
  html{font-size:13px;}
  .sidebar{width:auto!important;}
  .topbar{min-height:38px!important;padding:7px 10px!important;}
  .content{padding:8px!important;}
  .split{gap:8px!important;}
  .list-panel{min-width:0!important;}
  .note-top-actionbar{position:sticky;top:0;overflow:auto;max-height:86px;}
  .note-actions-right{width:100%;justify-content:flex-start;}
  .note-editor{min-height:360px!important;}
}

/* ===== v15 fixes: real topbar note actions + tighter shell spacing ===== */
.shell{grid-template-columns:238px minmax(0,1fr)!important;column-gap:0!important;}
.shell.sidebar-collapsed{grid-template-columns:58px minmax(0,1fr)!important;}
.main{min-width:0!important;}
.content{padding-left:8px!important;padding-right:8px!important;}
.compact-topbar{display:grid!important;grid-template-columns:minmax(120px,220px) minmax(0,1fr) auto!important;align-items:center!important;gap:8px!important;padding:5px 10px!important;min-height:42px!important;}
.compact-topbar .topbar-title{min-width:0!important;}
.compact-topbar .topbar-title h1,.compact-topbar .topbar-title p{overflow:hidden!important;white-space:nowrap!important;text-overflow:ellipsis!important;}
.topbar-note-actions{min-width:0!important;display:flex!important;align-items:center!important;overflow:hidden!important;}
.topbar-note-actions .note-actionbar{position:static!important;margin:0!important;padding:0!important;border:0!important;box-shadow:none!important;background:transparent!important;width:100%!important;display:flex!important;align-items:center!important;justify-content:space-between!important;gap:6px!important;}
.topbar-note-actions .note-actions-left{display:flex!important;align-items:center!important;gap:5px!important;flex-wrap:wrap!important;max-height:64px!important;overflow:auto!important;scrollbar-width:thin!important;}
.topbar-note-actions .note-actions-right{align-self:flex-start!important;padding-top:1px!important;}
.topbar-note-actions button{padding:5px 8px!important;font-size:11px!important;min-height:26px!important;border-radius:8px!important;white-space:nowrap!important;}
.topbar-note-actions .edit-status-pill{font-size:10px!important;padding:4px 7px!important;}
.editor-shell>.note-actionbar{display:none!important;}
.split{grid-template-columns:minmax(260px,300px) minmax(0,1fr)!important;gap:8px!important;}
.notelist-collapsed .split{grid-template-columns:58px minmax(0,1fr)!important;}
.list-panel{min-width:0!important;}
.editor-panel{min-width:0!important;}
@media(max-width:1100px){
  .compact-topbar{grid-template-columns:minmax(120px,180px) minmax(0,1fr) auto!important;}
  .topbar-note-actions .note-actions-left{flex-wrap:nowrap!important;overflow-x:auto!important;max-height:36px!important;}
}
@media(max-width:760px){
  .shell,.shell.sidebar-collapsed{grid-template-columns:1fr!important;}
  .compact-topbar{grid-template-columns:1fr auto!important;grid-template-areas:'title actions' 'note note'!important;}
  .compact-topbar .topbar-title{grid-area:title;}
  .compact-topbar .top-actions{grid-area:actions;}
  .topbar-note-actions{grid-area:note;width:100%;}
  .topbar-note-actions .note-actions-left{max-height:34px!important;flex-wrap:nowrap!important;overflow-x:auto!important;}
  .split{grid-template-columns:1fr!important;}
}


/* ===== v16: top note action bar alignment + compact horizontal scroll ===== */
.compact-topbar{
  grid-template-columns:minmax(260px,300px) minmax(0,1fr) auto!important;
  align-items:center!important;
}
.topbar-note-actions{
  justify-self:stretch!important;
  width:100%!important;
  min-width:0!important;
  overflow:hidden!important;
}
.topbar-note-actions .note-actionbar{
  justify-content:flex-start!important;
  align-items:center!important;
  width:100%!important;
  min-width:0!important;
}
.topbar-note-actions .note-actions-left{
  flex:1 1 auto!important;
  min-width:0!important;
  display:flex!important;
  align-items:center!important;
  justify-content:flex-start!important;
  flex-wrap:nowrap!important;
  overflow-x:auto!important;
  overflow-y:hidden!important;
  max-height:34px!important;
  padding-bottom:2px!important;
  scrollbar-width:thin!important;
  scroll-behavior:smooth!important;
}
.topbar-note-actions .note-actions-left::-webkit-scrollbar{height:6px!important;}
.topbar-note-actions .note-actions-left::-webkit-scrollbar-thumb{background:var(--border)!important;border-radius:999px!important;}
.topbar-note-actions .note-actions-left button{
  flex:0 0 auto!important;
  white-space:nowrap!important;
}
.topbar-note-actions .note-actions-right{
  flex:0 0 auto!important;
  margin-left:6px!important;
  align-self:center!important;
  padding-top:0!important;
}
.topbar-note-actions .note-actions-right:empty{display:none!important;}
.topbar-note-actions button{min-height:24px!important;padding:4px 7px!important;font-size:10.5px!important;}
@media(max-width:1100px){
  .compact-topbar{grid-template-columns:minmax(220px,270px) minmax(0,1fr) auto!important;}
}
@media(max-width:760px){
  .compact-topbar{grid-template-columns:1fr auto!important;grid-template-areas:'title actions' 'note note'!important;}
  .topbar-note-actions .note-actions-left{max-height:32px!important;}
}


/* ===== Hostinger v8 updates: cleaner login, tag-only sidebar, settings account controls, full notebook modal ===== */
.auth-card .brand p,.demo-box{display:none!important;}
.top-actions:empty{display:none!important;}
.settings-panel .settings-row{display:flex;align-items:center;justify-content:space-between;gap:14px;padding:12px;border:1px solid var(--border);background:var(--soft);border-radius:14px;margin:10px 0;}
.settings-panel .settings-row small{display:block;margin-top:3px;font-size:12px;}
.compact-textarea{min-height:90px!important;}
.editor-shell .meta-grid{grid-template-columns:150px minmax(180px,1fr) minmax(180px,1fr)!important;}

/* Keep note top actions aligned with editor panel when note-list changes width. */
.shell .compact-topbar{grid-template-columns:minmax(260px,300px) minmax(0,1fr) auto!important;}
.shell.notelist-collapsed .compact-topbar{grid-template-columns:58px minmax(0,1fr) auto!important;}
.topbar-note-actions{justify-content:flex-start!important;}
.topbar-note-actions .note-actionbar{justify-content:flex-start!important;}
.topbar-note-actions .note-actions-left{justify-content:flex-start!important;}
@media(max-width:900px){
  .shell .compact-topbar,.shell.notelist-collapsed .compact-topbar{grid-template-columns:1fr!important;grid-template-areas:'title' 'note'!important;}
  .compact-topbar .topbar-title{grid-area:title!important;}
  .topbar-note-actions{grid-area:note!important;width:100%!important;}
  .editor-shell .meta-grid{grid-template-columns:1fr!important;}
}

/* ===== Hostinger v9 fixes: compact document spacing, draggable/resizable mini view, true side-by-side notes ===== */
.note-editor{
  line-height:1.35!important;
  letter-spacing:0!important;
}
.note-editor p,
.note-editor div{
  margin-top:2px!important;
  margin-bottom:2px!important;
}
.note-editor br{line-height:1.15!important;}
.note-editor ul,.note-editor ol{margin-top:4px!important;margin-bottom:4px!important;}
.note-editor li{margin:1px 0!important;}
.note-editor h1,.note-editor h2,.note-editor h3{margin-top:8px!important;margin-bottom:6px!important;line-height:1.18!important;}
.note-editor blockquote{margin:6px 0!important;}
.note-editor pre{line-height:1.35!important;margin:6px 0!important;}

.floating-layer{pointer-events:none!important;}
.floating-note{
  min-width:280px!important;
  min-height:44px!important;
  max-width:calc(100vw - 18px)!important;
  max-height:calc(100vh - 18px)!important;
  resize:both!important;
  overflow:auto!important;
  overscroll-behavior:contain!important;
}
.floating-note.minimized{resize:none!important;overflow:hidden!important;min-height:44px!important;}
.floating-note.minimized .floating-body,.floating-note.minimized .floating-resize-hint{display:none!important;}
.floating-head{user-select:none!important;touch-action:none!important;}
.floating-head button{border:0;background:var(--panel);color:var(--text);border-radius:8px;padding:4px 7px;font-weight:900;line-height:1;}
.floating-head button:hover{background:var(--soft2);}
.floating-resize-hint{position:absolute;right:6px;bottom:3px;color:var(--muted);font-size:12px;pointer-events:none;}
.floating-body{line-height:1.35!important;}
.floating-body p,.floating-body div{margin-top:2px!important;margin-bottom:2px!important;}

.side-by-side-workspace{min-width:0;}
.side-by-side-workspace.active{
  display:grid!important;
  grid-template-columns:minmax(0,1fr) minmax(320px,38%,520px)!important;
  gap:10px!important;
  align-items:stretch!important;
}
.primary-note-pane{min-width:0!important;display:flex;flex-direction:column;}
.side-by-side-notes{
  min-width:0!important;
  display:flex!important;
  flex-direction:column!important;
  gap:10px!important;
  max-height:calc(100vh - 190px)!important;
  overflow:auto!important;
  padding-left:2px!important;
}
.side-note{
  background:var(--panel)!important;
  border:1px solid var(--border)!important;
  border-radius:16px!important;
  box-shadow:var(--shadow)!important;
  padding:12px!important;
  cursor:pointer!important;
  min-height:240px!important;
  overflow:auto!important;
}
.side-note:hover{border-color:var(--primary)!important;}
.side-note header{display:flex;align-items:flex-start;justify-content:space-between;gap:8px;border-bottom:1px solid var(--border);padding-bottom:7px;margin-bottom:8px;}
.side-note h3{margin:0!important;font-size:14px!important;line-height:1.2!important;}
.side-note small{color:var(--muted);font-size:10px;white-space:nowrap;}
.side-note-body{line-height:1.35!important;font-size:12px!important;}
.side-note-body p,.side-note-body div{margin:2px 0!important;}
.side-note-body img{max-width:100%;border-radius:10px;}
@media(max-width:980px){
  .side-by-side-workspace.active{
    display:flex!important;
    overflow-x:auto!important;
    gap:10px!important;
    align-items:stretch!important;
    padding-bottom:6px!important;
  }
  .side-by-side-workspace.active .primary-note-pane{flex:0 0 min(760px,86vw)!important;}
  .side-by-side-notes{flex:0 0 340px!important;max-height:none!important;}
  .side-note{min-height:360px!important;}
}

/* v10 chat + floating notes fixes */
.floating-layer{pointer-events:none!important;z-index:15000!important;}
.floating-note{position:fixed!important;pointer-events:auto!important;}
.floating-head{cursor:grab!important;}
.floating-head:active{cursor:grabbing!important;}
.chat-layout-pro{display:grid;grid-template-columns:minmax(180px,240px) minmax(360px,1fr) minmax(180px,260px);gap:12px;align-items:stretch;min-height:calc(100vh - 150px)}
.chat-side-head,.chat-room-head{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:10px}.chat-side-head h2,.chat-room-head h2{margin:0}.chat-room-list{display:grid;gap:6px;margin-top:10px;max-height:calc(100vh - 260px);overflow:auto}.chat-room-list .nav-btn{justify-content:flex-start;text-align:left}.chat-room-list .nav-btn small{display:block;color:var(--muted);font-size:10px;margin-left:auto}.chat-box{display:flex;flex-direction:column;min-height:520px}.chat-list{flex:1;overflow:auto;display:grid;align-content:start;gap:8px;padding:8px;border:1px solid var(--border);border-radius:14px;background:var(--soft)}.chat-msg{padding:10px;border-radius:12px;background:var(--panel);border:1px solid var(--border)}.chat-msg.mine{border-color:var(--primary);background:rgba(37,99,235,.08)}.chat-msg b{display:block}.chat-msg small{display:block;color:var(--muted);font-size:11px}.chat-msg p{margin:6px 0;white-space:pre-wrap}.mini-link{border:0;background:transparent;color:var(--primary);font-size:11px;padding:2px 4px}.danger-text{color:var(--danger)!important}.chat-members{overflow:auto}.member-row{padding:8px;border-bottom:1px solid var(--border)}.member-row b{display:block}.member-row small{color:var(--muted);font-size:11px}.chat-head-actions{display:flex;gap:6px;flex-wrap:wrap}.modal-grid{display:grid;gap:8px}.modal-grid label{font-weight:800;color:var(--muted);font-size:12px}
@media(max-width:980px){.chat-layout-pro{grid-template-columns:1fr}.chat-box{min-height:420px}.chat-members{max-height:260px}}

/* v11 messenger chat permissions + attachments */
.messenger-list{display:flex!important;flex-direction:column;gap:8px;background:linear-gradient(180deg,var(--soft),rgba(37,99,235,.035));padding:12px!important}
.chat-row{display:flex;align-items:flex-end;gap:8px;width:100%;margin:4px 0}
.chat-row.mine{justify-content:flex-end}
.chat-row.theirs{justify-content:flex-start}
.chat-avatar{width:28px;height:28px;border-radius:999px;display:grid;place-items:center;background:var(--soft2);color:var(--muted);font-size:12px;font-weight:900;flex:0 0 auto}
.chat-row.mine .chat-avatar{display:none}
.chat-bubble{max-width:min(72%,680px);padding:9px 11px;border-radius:18px;background:var(--panel);border:1px solid var(--border);box-shadow:0 8px 20px rgba(15,23,42,.06);overflow:hidden}
.chat-row.mine .chat-bubble{background:linear-gradient(135deg,var(--primary),#0ea5e9);color:#fff;border-color:transparent;border-bottom-right-radius:6px}
.chat-row.theirs .chat-bubble{border-bottom-left-radius:6px}
.chat-meta{display:flex;align-items:center;gap:8px;margin-bottom:4px}
.chat-meta b{font-size:12px;line-height:1.1}.chat-meta span{font-size:10px;color:var(--muted)}
.chat-row.mine .chat-meta span,.chat-row.mine .chat-meta b{color:rgba(255,255,255,.85)}
.chat-body{white-space:pre-wrap;word-break:break-word;line-height:1.38}.chat-body a{color:inherit;text-decoration:underline;font-weight:800}
.chat-link-card{display:block;margin-top:7px;padding:8px;border-radius:12px;background:rgba(255,255,255,.72);border:1px solid var(--border);color:var(--primary);font-weight:800;word-break:break-all}.chat-row.mine .chat-link-card{background:rgba(255,255,255,.18);border-color:rgba(255,255,255,.24);color:#fff}
.chat-attachments{display:grid;gap:7px;margin-top:8px}.chat-attachment{display:block;border-radius:12px;overflow:hidden;text-decoration:none}.chat-attachment.image img{display:block;max-width:280px;max-height:220px;border-radius:12px;object-fit:cover}.chat-attachment.image span{display:block;margin-top:4px;font-size:11px;opacity:.85}.chat-attachment.media video{max-width:320px;width:100%;border-radius:12px}.chat-attachment.media audio{width:260px}.chat-attachment.file{padding:8px 10px;background:rgba(255,255,255,.72);border:1px solid var(--border);color:var(--text);font-weight:800}.chat-row.mine .chat-attachment.file{background:rgba(255,255,255,.18);color:#fff;border-color:rgba(255,255,255,.25)}
.chat-actions{display:flex;gap:6px;justify-content:flex-end;margin-top:6px}.chat-row.mine .mini-link{color:#fff}.chat-row.mine .danger-text{color:#fee2e2!important}.chat-compose{display:grid;grid-template-columns:minmax(160px,1fr) minmax(140px,.8fr) auto auto;gap:8px;align-items:center;margin-top:10px}.chat-compose input{min-height:38px;border-radius:12px;padding:0 12px}.attach-chat-btn{height:38px;min-width:40px;display:grid;place-items:center;border-radius:12px;background:var(--soft);border:1px solid var(--border);cursor:pointer;font-weight:900}.attach-chat-btn:hover{background:var(--soft2)}.chat-hint{display:block;margin-top:5px}.chat-members .member-row{border-bottom:1px solid var(--border)}
@media(max-width:780px){.chat-bubble{max-width:86%}.chat-compose{grid-template-columns:1fr auto}.chat-compose input[name="link"]{grid-column:1/-1;order:2}.attach-chat-btn{order:3}.chat-compose button{order:4}.chat-attachment.image img{max-width:220px}.chat-attachment.media video{max-width:240px}}

/* v12 chat presence, read receipts, stable floating drag */
.member-presence{display:flex!important;align-items:center!important;justify-content:flex-start!important;gap:10px!important}
.member-presence>div{min-width:0}.presence-dot{width:10px;height:10px;border-radius:999px;display:inline-block;flex:0 0 10px;box-shadow:0 0 0 3px rgba(148,163,184,.15)}.presence-dot.online{background:#22c55e;box-shadow:0 0 0 3px rgba(34,197,94,.18)}.presence-dot.offline{background:#94a3b8}.chat-read-row{display:flex;justify-content:flex-end;margin-top:4px;min-height:14px}.chat-read{font-size:11px!important;opacity:.82;text-decoration:none}.chat-row.mine .chat-read{color:rgba(255,255,255,.88)!important}.read-list{display:grid;gap:8px;max-height:320px;overflow:auto}.floating-note{touch-action:none!important;will-change:left,top}.floating-head{touch-action:none!important;cursor:grab!important}.floating-head:active{cursor:grabbing!important}.chat-room-head small{display:block;margin-top:2px}.chat-list{scroll-behavior:smooth}

/* ===== Hostinger v13 chat professional update ===== */
.chat-list.messenger-list{
  gap:4px!important;
  padding:10px!important;
}
.chat-row{
  margin:2px 0!important;
  align-items:flex-end!important;
  position:relative!important;
}
.chat-bubble{
  max-width:min(68%,620px)!important;
  padding:6px 9px!important;
  border-radius:16px!important;
  line-height:1.28!important;
  box-shadow:0 5px 14px rgba(15,23,42,.045)!important;
}
.chat-row.mine .chat-bubble{border-bottom-right-radius:5px!important;}
.chat-row.theirs .chat-bubble{border-bottom-left-radius:5px!important;}
.chat-bubble-top{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:6px;
  min-height:16px;
  margin-bottom:1px;
}
.chat-name{font-size:10.5px;font-weight:900;opacity:.82;line-height:1;}
.chat-row.mine .chat-name{color:rgba(255,255,255,.86);}
.chat-body{font-size:12.8px!important;line-height:1.28!important;margin:1px 0!important;white-space:pre-wrap!important;}
.chat-foot{display:flex;align-items:center;justify-content:flex-end;gap:7px;margin-top:2px;font-size:9.5px;opacity:.72;line-height:1;}
.chat-row.mine .chat-foot{color:rgba(255,255,255,.9);}
.chat-read-row{margin:0!important;min-height:0!important;display:inline-flex!important;}
.chat-read{font-size:9.5px!important;}
.chat-avatar{width:23px!important;height:23px!important;font-size:10px!important;}
.chat-link-card{margin-top:4px!important;padding:5px 7px!important;border-radius:9px!important;font-size:11px!important;}
.chat-attachments{gap:4px!important;margin-top:5px!important;}
.chat-attachment.file{padding:5px 7px!important;font-size:11px!important;}
.chat-attachment.image img{max-width:220px!important;max-height:160px!important;border-radius:10px!important;}
.chat-attachment.media video{max-width:260px!important;}
.chat-menu{position:relative;line-height:1;}
.chat-menu summary{list-style:none;cursor:pointer;width:21px;height:21px;border-radius:999px;display:grid;place-items:center;font-weight:900;opacity:.78;}
.chat-menu summary::-webkit-details-marker{display:none;}
.chat-menu summary:hover{background:rgba(148,163,184,.18);}
.chat-row.mine .chat-menu summary:hover{background:rgba(255,255,255,.18);}
.chat-menu-list{position:absolute;right:0;top:24px;z-index:40;display:grid;min-width:135px;padding:5px;background:var(--panel);border:1px solid var(--border);border-radius:12px;box-shadow:var(--shadow);}
.chat-row.mine .chat-menu-list{color:var(--text);}
.chat-menu-list button{background:transparent;color:var(--text);text-align:left;border-radius:8px;padding:7px 9px;font-size:12px;font-weight:800;}
.chat-menu-list button:hover{background:var(--soft);}
.chat-reply-preview,.compose-reply{border-left:3px solid var(--primary);background:rgba(148,163,184,.13);border-radius:9px;padding:5px 7px;margin:3px 0 5px;display:grid;gap:1px;}
.chat-row.mine .chat-reply-preview{background:rgba(255,255,255,.16);border-left-color:rgba(255,255,255,.65);}
.chat-reply-preview b,.compose-reply b{font-size:10.5px;}
.chat-reply-preview span,.compose-reply span{font-size:11px;opacity:.85;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.chat-forwarded{font-size:10px;font-weight:800;opacity:.72;margin:2px 0;}
.deleted-message .chat-bubble.deleted{background:var(--soft)!important;color:var(--muted)!important;border-style:dashed!important;}
.chat-select-check{display:flex;align-items:center;margin:0 3px;}
.chat-row.selected .chat-bubble{outline:2px solid rgba(37,99,235,.24);}
.chat-select-toolbar{display:flex;align-items:center;gap:9px;flex-wrap:wrap;background:var(--soft);border:1px solid var(--border);border-radius:13px;padding:8px 10px;margin-bottom:8px;}
.whatsapp-compose{display:grid!important;grid-template-columns:auto minmax(160px,1fr) auto!important;gap:7px!important;align-items:end!important;margin-top:8px!important;}
.whatsapp-compose input[name="body"]{min-height:38px!important;border-radius:999px!important;padding:0 14px!important;}
.whatsapp-compose .attach-chat-btn{border-radius:999px!important;}
.compose-reply{grid-column:1/-1;margin:0 0 2px!important;display:flex;align-items:center;justify-content:space-between;gap:8px;}
.compose-reply button{background:transparent;color:var(--text);border-radius:999px;padding:2px 7px;font-size:16px;}
.member-role-row{display:grid;grid-template-columns:minmax(170px,1fr) 150px;gap:8px;align-items:center;border-bottom:1px solid var(--border);padding:6px 0;}
.member-role-row select{min-height:34px!important;padding:4px 8px!important;font-size:12px;}
@media(max-width:780px){
  .chat-bubble{max-width:84%!important;}
  .whatsapp-compose{grid-template-columns:auto 1fr auto!important;}
  .member-role-row{grid-template-columns:1fr;}
}

/* ===== Hostinger v14 chat option menu + room delete fixes ===== */
.chat-row,
.chat-bubble,
.chat-bubble-top,
.messenger-list .chat-row,
.messenger-list .chat-bubble {
  overflow: visible !important;
}
.chat-menu {
  position: relative !important;
  z-index: 1200 !important;
}
.chat-menu[open] {
  z-index: 30000 !important;
}
.chat-menu-list {
  z-index: 30001 !important;
  min-width: 150px !important;
  max-height: none !important;
  overflow: visible !important;
  display: grid !important;
}
.chat-row.mine .chat-menu-list,
.chat-row.theirs .chat-menu-list {
  right: 0 !important;
  left: auto !important;
  top: 24px !important;
}
.chat-menu-list button {
  display: block !important;
  width: 100% !important;
  white-space: nowrap !important;
}

/* ===== Hostinger v15 chat fixes: global message menu + stable member list ===== */
.chat-menu-trigger{
  width:22px;height:22px;border:0;border-radius:999px;background:transparent;color:inherit;
  display:grid;place-items:center;font-weight:900;cursor:pointer;opacity:.82;line-height:1;
}
.chat-menu-trigger:hover{background:rgba(148,163,184,.18);opacity:1;}
.chat-row.mine .chat-menu-trigger:hover{background:rgba(255,255,255,.18);}
.chat-menu-portal{
  position:fixed;z-index:999999;display:grid;gap:2px;min-width:156px;padding:6px;
  background:var(--panel);border:1px solid var(--border);border-radius:14px;box-shadow:0 18px 45px rgba(15,23,42,.28);
  color:var(--text);
}
.chat-menu-portal button{
  border:0;background:transparent;color:var(--text);text-align:left;border-radius:10px;
  padding:8px 10px;font-size:12px;font-weight:900;cursor:pointer;white-space:nowrap;
}
.chat-menu-portal button:hover{background:var(--soft);}
.chat-menu-portal .danger-text{color:var(--danger)!important;}
.chat-menu-portal .danger-text:hover{background:rgba(220,38,38,.12)!important;}

/* ===== Hostinger v17 chat productivity update ===== */
.chat-layout-pro{grid-template-columns:330px minmax(460px,1fr) 300px;gap:14px}.chat-box{overflow:hidden}.messenger-list{background:linear-gradient(180deg,rgba(37,99,235,.03),transparent 46%),var(--panel)!important;border-radius:20px!important;padding:18px!important}.chat-row{align-items:flex-end!important;gap:9px!important;margin:12px 0!important}.chat-message-stack{display:grid;gap:4px;max-width:min(74%,720px)}.chat-row.mine .chat-message-stack{justify-items:end}.chat-row.theirs .chat-message-stack{justify-items:start}.chat-sender-line{display:flex;align-items:center;gap:8px;min-height:20px;color:var(--muted);font-size:11px;font-weight:900;padding:0 6px}.chat-row.mine .chat-sender-line{justify-content:flex-end}.chat-bubble{max-width:100%!important;border-radius:18px!important;padding:10px 12px!important;background:#f8fafc!important;border:1px solid rgba(148,163,184,.2)!important;box-shadow:0 8px 24px rgba(15,23,42,.06)!important;color:var(--text)!important}.chat-row.mine .chat-bubble{background:linear-gradient(135deg,#dbeafe,#bfdbfe)!important;color:#0f172a!important;border-color:#bfdbfe!important;border-bottom-right-radius:6px!important}.chat-row.theirs .chat-bubble{border-bottom-left-radius:6px!important}.chat-row.mine .chat-foot,.chat-row.mine .chat-read,.chat-row.mine .chat-body a{color:#334155!important}.chat-menu-trigger{width:auto!important;height:auto!important;border-radius:8px!important;background:transparent!important;padding:0 4px!important;color:var(--muted)!important;font-size:18px!important;line-height:1!important}.chat-menu-trigger:hover{background:rgba(37,99,235,.08)!important;color:var(--primary)!important}.chat-bubble-top,.chat-name{display:none!important}.chat-foot{font-size:10px!important;margin-top:6px!important;color:var(--muted)!important}.chat-avatar{width:30px!important;height:30px!important;background:linear-gradient(135deg,#dbeafe,#e0f2fe)!important;color:#2563eb!important}.chat-compose{display:block!important;margin-top:12px}.chat-compose-row{display:grid;grid-template-columns:auto auto auto minmax(160px,1fr) auto;gap:8px;align-items:end;padding:10px;border:1px solid var(--border);border-radius:18px;background:var(--panel);box-shadow:0 10px 26px rgba(15,23,42,.05)}.chat-compose-row textarea{min-height:42px!important;max-height:120px;resize:vertical;border:0!important;background:transparent!important;padding:10px 4px!important}.send-chat-btn{border-radius:999px!important;width:44px;height:44px;padding:0!important}.complaint-toggle{white-space:nowrap;background:var(--soft);border:1px solid var(--border);border-radius:999px;padding:9px 10px;font-size:12px;font-weight:900;color:var(--muted)}.complaint-toggle input{vertical-align:middle}.chat-draft-preview-host{grid-column:1/-1}.chat-draft-preview{display:flex;gap:8px;flex-wrap:wrap;margin-bottom:8px}.draft-attachment{position:relative;border:1px solid var(--border);border-radius:14px;overflow:hidden;background:var(--soft);min-width:88px;min-height:64px;display:grid;place-items:center}.draft-attachment img{display:block;width:116px;height:74px;object-fit:cover}.draft-attachment button{position:absolute;right:4px;top:4px;width:22px;height:22px;border-radius:999px;background:rgba(15,23,42,.72);color:#fff;font-weight:900}.draft-file{padding:10px;font-size:12px;font-weight:800}.complaint-card{margin-top:8px;border-radius:14px;padding:8px;background:rgba(148,163,184,.12);border:1px solid rgba(148,163,184,.22)}.complaint-main{display:flex;justify-content:space-between;gap:8px;align-items:center}.complaint-badge{display:inline-flex;align-items:center;border-radius:999px;padding:4px 8px;font-size:11px;font-weight:900;background:#e2e8f0;color:#334155}.complaint-pending .complaint-badge{background:#fef3c7;color:#92400e}.complaint-success .complaint-badge{background:#dcfce7;color:#166534}.complaint-failed .complaint-badge{background:#fee2e2;color:#991b1b}.complaint-actions{display:flex;gap:6px;margin-top:7px;flex-wrap:wrap}.complaint-actions button{border-radius:999px;padding:6px 9px;background:#fff;border:1px solid var(--border);color:#0f172a;font-size:12px;font-weight:900}.complaint-actions button:hover{border-color:var(--primary);color:var(--primary)}.complaint-reason{margin-top:6px;font-size:12px;line-height:1.35;color:#991b1b;background:rgba(254,226,226,.6);border-radius:10px;padding:6px 8px}.chat-row.selected .chat-message-stack{outline:2px solid rgba(37,99,235,.24);border-radius:20px}.chat-attachment.image img{max-width:280px!important;max-height:260px!important}.chat-attachment.image span{font-size:10px!important;color:var(--muted)}@media(max-width:1200px){.chat-layout-pro{grid-template-columns:1fr}.chat-members{display:none}.chat-message-stack{max-width:86%}}@media(max-width:780px){.chat-compose-row{grid-template-columns:auto auto 1fr auto}.complaint-toggle{grid-column:1/-1}.chat-message-stack{max-width:92%}}

/* v18 Complete Chat Workspace Update */
.content:has(.chat-layout-pro){height:calc(100vh - 78px);padding:14px;overflow:hidden}.chat-layout-pro{height:100%;min-height:0}.chat-box{display:flex;flex-direction:column;min-height:0}.chat-room-head{position:relative;display:flex;align-items:flex-start;justify-content:space-between;gap:12px;padding:8px 10px 12px;border-bottom:1px solid var(--border);margin-bottom:8px}.chat-room-head h2{margin:0;font-size:22px}.online-summary{display:inline-flex;align-items:center;gap:6px;margin:5px 0 0;padding:4px 9px;border-radius:999px;background:rgba(37,99,235,.08);color:var(--primary);font-weight:900;font-size:12px}.online-summary:hover{background:rgba(37,99,235,.14)}.online-summary.side{margin:0}.icon-only-actions{display:flex;gap:6px;align-items:center}.room-icon-action{position:relative;width:34px;height:34px;border-radius:12px;background:var(--soft);color:var(--text);display:grid;place-items:center;font-weight:900}.room-icon-action:hover{background:rgba(37,99,235,.12);color:var(--primary);transform:translateY(-1px)}.room-icon-action::after{content:attr(data-label);position:absolute;top:40px;right:0;white-space:nowrap;background:#0f172a;color:#fff;padding:6px 8px;border-radius:9px;font-size:11px;font-weight:900;box-shadow:var(--shadow);opacity:0;transform:translateY(-4px);pointer-events:none;transition:.18s ease;z-index:70}.room-icon-action:hover::after{opacity:1;transform:translateY(0)}.danger-icon{color:var(--danger)}.danger-icon:hover{background:rgba(220,38,38,.1);color:var(--danger)}.online-members-popover{position:absolute;right:8px;top:58px;z-index:65;width:min(300px,calc(100vw - 24px));max-height:320px;overflow:auto;background:var(--panel);border:1px solid var(--border);box-shadow:var(--shadow);border-radius:16px;padding:10px}.member-row.compact{margin:4px 0;padding:8px;background:transparent}.member-row.compact:hover{background:var(--soft)}.messenger-list{flex:1;min-height:0;height:auto!important;overflow:auto}.smart-composer{display:grid!important;grid-template-columns:1fr!important;gap:8px!important;align-items:stretch!important;padding:10px!important;border-radius:20px!important}.smart-composer textarea{width:100%;min-height:64px!important;max-height:220px!important;resize:none!important;overflow:hidden!important;border:1px solid transparent!important;background:rgba(248,250,252,.85)!important;border-radius:16px!important;padding:12px!important;line-height:1.45!important;font-size:14px!important}.smart-composer textarea:focus{border-color:rgba(37,99,235,.25)!important;box-shadow:0 0 0 4px rgba(37,99,235,.08)}.chat-compose-tools{display:flex;align-items:center;gap:7px;flex-wrap:wrap}.attach-chat-btn{min-height:36px;border:1px solid var(--border);background:var(--soft);color:var(--text);border-radius:12px!important;padding:8px 10px;font-weight:900;display:inline-flex;align-items:center;gap:6px}.attach-chat-btn:hover{background:var(--soft2);border-color:rgba(37,99,235,.24)}.template-btn span{display:inline}.chat-send-hint{margin-left:auto;color:var(--muted);font-size:12px;font-weight:800}.send-chat-btn{flex:0 0 44px}.complaint-toggle{display:inline-flex;align-items:center;gap:6px}.chat-draft-preview-host:not(:empty){padding:8px 10px 0}.chat-draft-preview{margin-bottom:0!important}.draft-attachment{min-width:150px!important;min-height:72px!important;grid-template-columns:64px 1fr}.draft-attachment img{width:150px!important;height:82px!important;object-fit:cover}.complaint-card{border-color:rgba(37,99,235,.24);background:linear-gradient(180deg,rgba(37,99,235,.08),rgba(37,99,235,.03))}.complaint-pending .complaint-badge{background:var(--primary);color:#fff}.complaint-main small{font-weight:800;color:var(--muted)}.complaint-actions button:first-child{background:#ecfdf5;color:#047857;border-color:#a7f3d0}.complaint-actions button:nth-child(2){background:#fff1f2;color:#be123c;border-color:#fecdd3}.chat-menu-portal{min-width:155px!important;padding:7px!important;border-radius:16px!important;box-shadow:0 18px 55px rgba(15,23,42,.16)!important}.chat-menu-portal button{padding:9px 10px!important;border-radius:11px!important;font-size:13px!important}.chat-insights{overflow:auto}.chat-insight-head{display:flex;align-items:center;justify-content:space-between;gap:8px;border-bottom:1px solid var(--border);padding-bottom:10px;margin-bottom:12px}.chat-insight-head h2{margin:0}.complaint-summary,.room-panel-block{background:var(--soft);border:1px solid var(--border);border-radius:16px;padding:12px;margin:10px 0}.complaint-summary h3,.room-panel-block h3{margin:0 0 9px;font-size:15px}.complaint-stats{display:grid;grid-template-columns:repeat(3,1fr);gap:8px}.complaint-stats div{background:#eff6ff;border:1px solid #bfdbfe;border-radius:14px;padding:10px;text-align:center}.complaint-stats .ok{background:#ecfdf5;border-color:#bbf7d0}.complaint-stats .fail{background:#fff1f2;border-color:#fecdd3}.complaint-stats b{display:block;font-size:22px}.complaint-stats span{display:block;font-size:11px;color:var(--muted);font-weight:900}.chat-hint{display:block;margin:7px 4px 0}.chat-row.has-complaint .chat-bubble{outline:1px solid rgba(37,99,235,.25)}@media(max-width:1200px){.content:has(.chat-layout-pro){height:auto;overflow:auto}.chat-layout-pro{height:auto}.messenger-list{min-height:55vh}.chat-insights{display:none}}@media(max-width:780px){.chat-send-hint{display:none}.template-btn span{display:none}.smart-composer textarea{min-height:86px!important}.room-icon-action::after{display:none}.chat-compose-tools{gap:5px}.attach-chat-btn{padding:8px}.online-members-popover{right:0;left:0;width:auto}}

/* v21 preview-match chat polish */
.chat-layout-preview-match{grid-template-columns:340px minmax(520px,1fr) 330px!important;gap:0!important;height:100%;border:1px solid var(--border);border-radius:22px;overflow:hidden;background:var(--panel);box-shadow:var(--shadow)}
.chat-layout-preview-match>.panel{border:0!important;border-radius:0!important;box-shadow:none!important;background:var(--panel);padding:0!important}.chat-layout-preview-match .chat-channels-pro{border-right:1px solid var(--border)!important;display:flex;flex-direction:column;min-height:0}.chat-layout-preview-match .chat-box-pro{display:flex;flex-direction:column;min-width:0}.chat-layout-preview-match .chat-room-info-panel{border-left:1px solid var(--border)!important;display:flex;flex-direction:column;min-height:0;overflow:auto}.chat-search-row{display:flex;gap:9px;padding:18px 14px 8px}.chat-search-box{flex:1;display:flex;align-items:center;gap:8px;background:#f3f7ff;border:1px solid rgba(203,213,225,.65);border-radius:14px;padding:0 10px;color:#64748b}.chat-search-box input{border:0;background:transparent;width:100%;padding:12px 2px;min-width:0}.filter-chip{width:42px;border-radius:14px;background:#f3f7ff;border:1px solid rgba(203,213,225,.65);font-weight:900;color:#334155}.new-chat-btn{margin:0 14px 12px;display:flex;align-items:center;justify-content:center;gap:8px;border-radius:13px!important;box-shadow:0 10px 22px rgba(37,99,235,.18)}.new-chat-btn span{margin-left:auto}.chat-tabs{display:flex;gap:8px;padding:0 14px 12px;border-bottom:1px solid var(--border)}.chat-tabs button{background:transparent;color:var(--muted);font-size:12px;font-weight:900;padding:8px 4px;border-bottom:2px solid transparent}.chat-tabs button.active{color:var(--primary);border-color:var(--primary)}.chat-tabs b{display:inline-grid;place-items:center;min-width:18px;height:18px;border-radius:999px;background:#334155;color:#fff;font-size:10px}.chat-side-scroll{overflow:auto;min-height:0;flex:1;padding:8px 12px}.chat-side-section h4{margin:9px 4px;color:var(--muted);font-size:12px;letter-spacing:.02em}.chat-room-card{width:100%;display:grid;grid-template-columns:42px 1fr auto;gap:10px;align-items:center;background:transparent;color:var(--text);border-radius:16px;padding:10px;margin:5px 0;text-align:left}.chat-room-card:hover,.chat-room-card.active{background:#eef5ff}.room-card-icon{width:38px;height:38px;border-radius:13px;background:#dbeafe;display:grid;place-items:center;color:var(--primary);font-size:18px}.room-card-main{min-width:0}.room-card-main b,.room-card-main small{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.room-card-main b{font-size:13px}.room-card-main small{font-size:11px;color:var(--muted);margin-top:3px}.room-card-meta{text-align:right;color:var(--muted);font-size:10px;display:grid;justify-items:end;gap:3px}.room-card-meta small{font-size:10px;color:var(--muted)}.room-card-meta em{font-style:normal;background:var(--primary);color:#fff;border-radius:999px;min-width:19px;height:19px;display:grid;place-items:center;font-size:10px;font-weight:900}.chat-template-card{margin:12px 14px 16px;padding:14px;border:1px solid #bfdbfe;border-radius:18px;background:linear-gradient(135deg,#eff6ff,#fff);display:grid;gap:6px}.chat-template-card b{font-size:13px}.chat-template-card small{color:var(--muted);line-height:1.35}.chat-room-head-pro{padding:18px!important;margin:0!important;align-items:center!important}.room-title-block{display:flex;align-items:center;gap:12px;min-width:0}.room-title-icon,.room-info-icon{width:48px;height:48px;border-radius:16px;background:#dbeafe;display:grid;place-items:center;color:var(--primary);font-size:22px}.room-title-block h2,.room-info-header h2{margin:0;font-size:18px}.star{color:#f59e0b;font-size:18px}.online-green{color:#16a34a}.date-pill{width:max-content;margin:12px auto;padding:6px 14px;border-radius:999px;background:var(--soft);color:var(--muted);font-size:12px;font-weight:900}.chat-layout-preview-match .messenger-list{border:0!important;border-radius:0!important;padding:8px 18px 10px!important}.chat-layout-preview-match .smart-compose-shell{padding:12px 18px 18px;border-top:1px solid rgba(203,213,225,.65);background:linear-gradient(180deg,rgba(255,255,255,.5),var(--panel))}.smart-composer-pro{border:1px solid #cbd5e1;border-radius:18px;background:#fff;box-shadow:0 10px 28px rgba(15,23,42,.06);padding:10px}.smart-composer-pro textarea{width:100%;min-height:92px!important;max-height:240px!important;border:0!important;border-radius:12px!important;background:#fff!important;resize:none!important;padding:10px 8px!important;line-height:1.45!important;box-shadow:none!important}.smart-composer-pro textarea:focus{outline:0!important}.smart-composer-pro .chat-compose-tools{border-top:1px solid #eef2f7;padding-top:9px}.chat-room-info-panel{font-size:13px}.room-info-header{display:flex;align-items:center;gap:12px;padding:18px;border-bottom:1px solid var(--border);position:relative}.room-info-header small b{color:#16a34a}.room-close{margin-left:auto;background:transparent;font-size:22px;color:#334155}.room-online-summary{position:relative;display:flex;align-items:center;justify-content:space-between;gap:8px;padding:14px 18px;border-bottom:1px solid var(--border);font-weight:800}.side-popover{top:46px!important;right:16px!important;width:230px!important}.room-panel-block,.complaint-summary{margin:14px 18px!important;background:#fff!important;border:0!important;border-bottom:1px solid var(--border)!important;border-radius:0!important;padding:0 0 14px!important}.room-panel-block p{margin:0 0 10px;color:#475569;line-height:1.45}.room-panel-block small{color:var(--muted)}.complaint-summary .mini-link,.room-panel-block .mini-link{margin-top:9px;background:transparent;color:var(--primary);font-weight:900;padding:0}.room-info-item{display:flex;gap:10px;align-items:center;padding:8px 0}.room-info-item .file-icon{width:28px;height:28px;border-radius:8px;background:#eff6ff;display:grid;place-items:center}.room-info-item b{display:block;font-size:12px}.room-info-item small{font-size:11px;color:var(--muted)}.chat-layout-preview-match .complaint-stats{grid-template-columns:repeat(3,1fr)}.chat-layout-preview-match .complaint-stats div{padding:10px 6px}.chat-layout-preview-match .complaint-stats b{font-size:24px;color:var(--primary)}.chat-layout-preview-match .complaint-stats .ok b{color:#16a34a}.chat-layout-preview-match .complaint-stats .fail b{color:#dc2626}.chat-layout-preview-match .chat-row{margin:11px 0}.chat-layout-preview-match .chat-bubble{box-shadow:0 8px 24px rgba(15,23,42,.05)!important}.chat-layout-preview-match .has-complaint .chat-bubble{background:#f8fbff!important;border-color:#93c5fd!important;outline:none!important}.chat-layout-preview-match .complaint-card{background:#eff6ff;border-color:#93c5fd}.chat-layout-preview-match .complaint-pending .complaint-badge{background:#0b6df5!important;color:#fff!important}.chat-layout-preview-match .chat-menu-portal{z-index:9999!important}.chat-layout-preview-match .chat-send-hint{font-size:11px}.chat-layout-preview-match .attach-chat-btn{background:#fff;border-color:#e2e8f0}.chat-layout-preview-match .send-chat-btn{margin-left:2px;background:#0b6df5!important}.chat-layout-preview-match .draft-attachment{background:#f8fafc}.chat-layout-preview-match .draft-attachment img{width:112px!important;height:70px!important}.presence-dot{width:9px;height:9px;border-radius:999px;background:#94a3b8;display:inline-block}.presence-dot.online{background:#22c55e}.presence-dot.offline{background:#94a3b8}
@media(max-width:1280px){.chat-layout-preview-match{grid-template-columns:300px minmax(420px,1fr)!important}.chat-layout-preview-match .chat-room-info-panel{display:none!important}}
@media(max-width:900px){.chat-layout-preview-match{grid-template-columns:1fr!important}.chat-layout-preview-match .chat-channels-pro{display:none!important}.chat-room-head-pro{padding:12px!important}.room-icon-action{width:32px;height:32px}.chat-head-actions{gap:3px}.chat-send-hint{display:none!important}}

/* v22 UI cleanup: readable links, cleaner New Chat, simplified composer/header */
.chat-bubble a,
.chat-msg a,
.chat-attachment a{
  color:#0f4fbf!important;
  font-weight:800;
  text-decoration:underline;
  text-underline-offset:2px;
}
.chat-bubble.mine a,
.chat-row.mine .chat-bubble a{
  color:#073b8e!important;
}
.link-preview,
.chat-link-preview{
  background:#ffffff!important;
  border:1px solid #bfdbfe!important;
  color:#0f172a!important;
  border-radius:12px!important;
}
.link-preview a,
.chat-link-preview a{color:#0f4fbf!important}
.new-chat-wrap{position:relative;margin:0 14px 12px;z-index:30}.new-chat-wrap .new-chat-btn{margin:0!important;height:42px;justify-content:flex-start!important;padding:0 13px!important;gap:9px!important;border-radius:14px!important;background:linear-gradient(135deg,#0b6df5,#2563eb)!important;box-shadow:0 10px 22px rgba(37,99,235,.20)!important;transition:transform .15s ease,box-shadow .15s ease}.new-chat-wrap .new-chat-btn:hover{transform:translateY(-1px);box-shadow:0 14px 28px rgba(37,99,235,.25)!important}.new-chat-plus{font-size:18px;line-height:1}.new-chat-caret{margin-left:auto;opacity:.9}.new-chat-menu{position:absolute;left:0;right:0;top:49px;background:#fff;border:1px solid #dbeafe;border-radius:18px;box-shadow:0 20px 55px rgba(15,23,42,.16);padding:8px;display:grid;gap:6px;z-index:9999}.new-chat-menu button{width:100%;display:flex;align-items:center;gap:10px;text-align:left;background:#fff;border:0;border-radius:13px;padding:10px;color:#0f172a}.new-chat-menu button:hover{background:#eff6ff}.new-chat-menu button>span{width:34px;height:34px;border-radius:12px;background:#dbeafe;color:#0b6df5;display:grid;place-items:center}.new-chat-menu b{display:block;font-size:13px}.new-chat-menu small{display:block;color:#64748b;font-size:11px;margin-top:2px}.chat-layout-preview-match .chat-head-actions.icon-only-actions{gap:8px}.chat-layout-preview-match .chat-head-actions.icon-only-actions .room-icon-action{background:#f3f7ff;border:1px solid #e2e8f0}.chat-layout-preview-match .chat-head-actions.icon-only-actions .danger-icon:hover{background:#fee2e2!important;color:#dc2626!important;border-color:#fecaca!important}.simplified-compose-tools{align-items:center!important;gap:8px!important}.simplified-compose-tools .attach-chat-btn{height:38px;display:inline-flex;align-items:center;gap:7px;border-radius:12px!important;padding:0 12px!important;background:#f8fafc!important;border:1px solid #dbeafe!important;font-weight:800;color:#334155}.simplified-compose-tools .upload-btn{cursor:pointer}.simplified-compose-tools .complaint-toggle{margin-left:0!important;height:38px;display:inline-flex;align-items:center;gap:8px;border-radius:999px;background:#eef5ff;border:1px solid #cbd5e1;padding:0 13px;font-weight:900;color:#475569}.simplified-compose-tools .send-chat-btn{margin-left:auto!important;width:44px;height:44px;border-radius:999px!important;display:grid;place-items:center;padding:0!important}.chat-send-hint{display:none!important}.room-create-form textarea,.direct-create-form textarea{min-height:90px;resize:vertical}.modal-card-options{display:grid;gap:6px;background:#f8fafc;border:1px solid #e2e8f0;border-radius:14px;padding:10px}.room-create-members{max-height:260px;overflow:auto;border:1px solid #e2e8f0;border-radius:14px;padding:8px;background:#fff}.room-create-members .member-role-row{grid-template-columns:1fr 132px}
@media(max-width:780px){.simplified-compose-tools .attach-chat-btn span{display:none}.simplified-compose-tools .complaint-toggle{font-size:0;padding:0 10px}.simplified-compose-tools .complaint-toggle::after{content:'Aduan';font-size:12px}.new-chat-menu{position:static;margin-top:8px}}

/* v23 Mentions update */
.mention-suggest-host{position:relative;z-index:80;display:none;margin:0 18px -2px;max-width:360px;background:#fff;border:1px solid #bfdbfe;border-radius:16px;box-shadow:0 18px 55px rgba(15,23,42,.16);padding:8px}.mention-suggest-host.open{display:grid;gap:4px}.mention-suggestion-title{font-size:11px;font-weight:900;color:#2563eb;text-transform:uppercase;letter-spacing:.04em;padding:4px 8px 6px}.mention-suggest-host button{display:flex;align-items:center;gap:9px;width:100%;text-align:left;border:0;background:transparent;border-radius:12px;padding:8px;color:#0f172a}.mention-suggest-host button:hover,.mention-suggest-host button:focus{background:#eff6ff;outline:none}.mention-suggest-host b{display:block;font-size:13px}.mention-suggest-host small{display:block;color:#64748b;font-size:11px;margin-top:1px}.mention-avatar{width:30px;height:30px;border-radius:999px;background:linear-gradient(135deg,#dbeafe,#e0f2fe);color:#0b6df5;display:grid;place-items:center;font-weight:900;flex:0 0 30px}.mention-empty{font-size:12px;color:#64748b;padding:10px}.chat-mention-token{display:inline-flex;align-items:center;background:#dbeafe;color:#0f4fbf;border:1px solid #bfdbfe;border-radius:999px;padding:0 6px;margin:0 1px;font-weight:900;text-decoration:none}.chat-row.mine .chat-mention-token{background:#eff6ff;color:#073b8e;border-color:#93c5fd}.mention-room-badge{background:#f59e0b!important;color:#fff!important}.list-line.priority-high{border-left:4px solid #f59e0b;background:linear-gradient(90deg,rgba(245,158,11,.10),transparent 42%)}.list-line.priority-high b{color:#92400e}.chat-tabs button:has(b:not(:empty)){position:relative}
@media(max-width:780px){.mention-suggest-host{margin:0 8px -2px;max-width:calc(100% - 16px)}}

/* ===== Hostinger v24: chat UX fixes, search/filter/mentions/template modal ===== */
.chat-tabs button{cursor:pointer;transition:.15s ease}.chat-tabs button.active{background:#eaf3ff!important;color:#0b6df5!important;border-color:#93c5fd!important;box-shadow:0 2px 8px rgba(37,99,235,.10)}.chat-tabs button b{display:inline-grid;place-items:center;min-width:18px;height:18px;border-radius:999px;background:#e2e8f0;color:#334155;font-size:10px;margin-left:4px}.chat-tabs button.active b{background:#0b6df5;color:#fff}.chat-side-search-note{font-size:12px;color:#64748b;padding:8px 14px 2px}.chat-search-box input{width:100%;min-width:0}.new-chat-wrap .new-chat-btn{display:flex!important;align-items:center!important;justify-content:center!important;gap:8px!important;height:42px!important;padding:0 16px!important;border-radius:16px!important}.new-chat-wrap .new-chat-btn .new-chat-plus{font-size:18px;font-weight:900;line-height:1;display:inline-flex;align-items:center}.new-chat-wrap .new-chat-btn .new-chat-label{font-weight:900;letter-spacing:-.01em}.new-chat-wrap .new-chat-btn:after{content:'⌄';font-size:13px;opacity:.85;margin-left:auto}.new-chat-wrap .new-chat-btn .new-chat-label{margin-right:auto}.chat-body a{color:#0b4fd8!important;font-weight:900;text-decoration:underline;text-underline-offset:2px}.chat-row.mine .chat-body a{color:#073b8e!important}.chat-link-card{background:#fff!important;color:#0b4fd8!important;border:1px solid #bfdbfe!important;box-shadow:0 2px 8px rgba(37,99,235,.08);font-weight:800}.chat-row.mentions-me .chat-bubble{border-color:#f59e0b!important;box-shadow:0 0 0 3px rgba(245,158,11,.12),0 8px 24px rgba(15,23,42,.05)!important}.mention-hit{font-style:normal;font-size:10px;color:#b45309;background:#fef3c7;border:1px solid #fde68a;border-radius:999px;padding:2px 7px;margin-left:4px}.mention-focus-flash .chat-bubble{animation:mentionFlash 2.4s ease}@keyframes mentionFlash{0%,100%{box-shadow:0 8px 24px rgba(15,23,42,.05)}20%,70%{box-shadow:0 0 0 5px rgba(245,158,11,.22),0 16px 35px rgba(245,158,11,.12)}}
.template-chat-modal{display:grid;gap:14px;width:min(880px,calc(100vw - 64px))}.template-chat-modal .template-picker-tools{display:grid;grid-template-columns:1fr 220px;gap:10px}.template-picker-grid{display:grid;grid-template-columns:280px minmax(0,1fr);gap:14px;min-height:360px}.template-list-pane{border:1px solid #e2e8f0;border-radius:16px;background:#f8fafc;padding:8px;overflow:auto;max-height:430px}.template-list-item{width:100%;text-align:left;border:0;background:transparent;border-radius:13px;padding:10px;color:#0f172a;display:block}.template-list-item:hover,.template-list-item.active{background:#eaf3ff}.template-list-item b{display:block;font-size:13px}.template-list-item small{display:block;color:#64748b;font-size:11px;margin-top:3px}.template-preview-pane{border:1px solid #dbeafe;border-radius:16px;background:#fff;padding:14px;display:flex;flex-direction:column;min-width:0}.template-preview-head{display:flex;align-items:flex-start;justify-content:space-between;gap:10px;margin-bottom:10px}.template-preview-head b{display:block;font-size:15px}.template-preview-head small{display:block;color:#64748b;font-size:11px;margin-top:2px}.template-preview-pane pre{flex:1;margin:0;padding:14px;border-radius:14px;background:#f8fafc;border:1px solid #e2e8f0;white-space:pre-wrap;font-family:inherit;font-size:13px;line-height:1.5;overflow:auto}.template-modal-actions{display:flex;justify-content:flex-end;gap:10px;margin-top:12px}.template-create-form{width:min(660px,calc(100vw - 64px))}.template-create-form .modal-check{font-weight:800;color:#475569}.modal-body:has(.template-chat-modal),.modal-body:has(.template-create-form){padding:16px!important}.app-modal:has(.template-chat-modal){width:min(960px,calc(100vw - 28px))!important}.app-modal:has(.template-create-form){width:min(720px,calc(100vw - 28px))!important}@media(max-width:820px){.template-chat-modal{width:100%}.template-chat-modal .template-picker-tools,.template-picker-grid{grid-template-columns:1fr}.template-list-pane{max-height:190px}.template-preview-pane{min-height:260px}}


/* ===== Hostinger v25: in-app chat image viewer ===== */
.chat-attachment.image.chat-image-open{border:0;background:transparent;padding:0;text-align:left;cursor:zoom-in;color:inherit;display:inline-flex;flex-direction:column;gap:5px;max-width:100%;}
.chat-attachment.image.chat-image-open img{display:block;max-width:260px;max-height:360px;border-radius:14px;border:1px solid #dbeafe;object-fit:cover;box-shadow:0 8px 22px rgba(15,23,42,.08);transition:transform .15s ease,box-shadow .15s ease;}
.chat-attachment.image.chat-image-open:hover img{transform:translateY(-1px);box-shadow:0 12px 30px rgba(15,23,42,.14);}
.chat-attachment.image.chat-image-open span{font-size:11px;color:#64748b;max-width:260px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.chat-image-viewer-backdrop{position:fixed;inset:0;z-index:100000;background:rgba(15,23,42,.78);backdrop-filter:blur(6px);display:grid;place-items:center;padding:24px;animation:viewerFade .14s ease-out;}
.chat-image-viewer{width:min(1120px,calc(100vw - 34px));height:min(860px,calc(100vh - 34px));display:grid;grid-template-rows:auto 1fr auto;background:#fff;border:1px solid rgba(255,255,255,.18);border-radius:22px;box-shadow:0 30px 90px rgba(0,0,0,.36);overflow:hidden;}
.chat-image-viewer-head{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:14px 16px;border-bottom:1px solid #e2e8f0;background:#f8fbff;}
.chat-image-viewer-head b{display:block;color:#0f172a;font-size:14px;max-width:70vw;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}.chat-image-viewer-head small{display:block;color:#64748b;font-size:11px;margin-top:2px;}.viewer-close{width:38px;height:38px;border:0;border-radius:14px;background:#eaf3ff;color:#0f172a;font-weight:900;font-size:20px;display:grid;place-items:center;cursor:pointer;}.viewer-close:hover{background:#dbeafe;color:#0b6df5;}
.chat-image-stage{position:relative;overflow:auto;display:grid;place-items:center;background:linear-gradient(135deg,#0f172a,#1e293b);padding:28px;}
.chat-image-stage img{max-width:100%;max-height:100%;border-radius:12px;box-shadow:0 20px 55px rgba(0,0,0,.35);transform-origin:center center;transition:transform .12s ease;background:#fff;}
.viewer-nav{position:absolute;top:50%;transform:translateY(-50%);width:44px;height:58px;border:0;border-radius:16px;background:rgba(255,255,255,.92);color:#0f172a;font-size:34px;line-height:1;display:grid;place-items:center;cursor:pointer;box-shadow:0 14px 30px rgba(0,0,0,.2);z-index:2;}.viewer-nav:hover{background:#fff;color:#0b6df5;}.viewer-nav.prev{left:18px}.viewer-nav.next{right:18px}
.chat-image-viewer-actions{display:flex;align-items:center;justify-content:center;gap:10px;padding:12px 16px;border-top:1px solid #e2e8f0;background:#f8fbff;}.chat-image-viewer-actions span{min-width:52px;text-align:center;font-weight:900;color:#475569}.viewer-download{text-decoration:none!important;display:inline-flex;align-items:center;justify-content:center;min-height:38px;border-radius:12px;padding:0 16px;}
@keyframes viewerFade{from{opacity:0}to{opacity:1}}
.dark .chat-image-viewer{background:#0f172a;border-color:#334155}.dark .chat-image-viewer-head,.dark .chat-image-viewer-actions{background:#111827;border-color:#334155}.dark .chat-image-viewer-head b{color:#f8fafc}.dark .viewer-close{background:#1e293b;color:#f8fafc}.dark .viewer-close:hover{background:#334155}.dark .chat-attachment.image.chat-image-open span{color:#cbd5e1}
@media(max-width:720px){.chat-image-viewer-backdrop{padding:10px}.chat-image-viewer{height:calc(100vh - 20px);width:calc(100vw - 20px);border-radius:18px}.chat-image-stage{padding:14px}.viewer-nav{width:38px;height:52px}.viewer-nav.prev{left:8px}.viewer-nav.next{right:8px}.chat-image-viewer-actions{flex-wrap:wrap}.chat-attachment.image.chat-image-open img{max-width:210px;max-height:300px}}

/* v33 Search + Filter Backend */
.search-results .locked-preview p,
.search-results .empty-state p{color:var(--muted)}
.empty-state,.loading-card{padding:24px;border:1px dashed var(--border);border-radius:18px;background:var(--panel-soft);grid-column:1/-1;text-align:center}
.search-grid label{display:flex;gap:8px;align-items:center;font-size:13px;color:var(--muted)}

/* v35 Admin Panel + User Management */
.wide-auth{max-width:1120px;}
.form-grid.two{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;}
.form-grid.two label{display:flex;flex-direction:column;gap:6px;font-weight:700;color:var(--text);}
.form-grid.two input,.form-grid.two select{width:100%;}
.register-ip{align-self:end;min-height:42px;}
.user-admin-grid{grid-template-columns:minmax(320px,420px) 1fr;align-items:start;}
.user-create-card{grid-row:span 2;}
.admin-summary-card .mini-stats{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;}
.mini-stats span{display:flex;justify-content:space-between;align-items:center;border:1px solid var(--border);border-radius:14px;padding:10px 12px;background:var(--surface-2);font-size:12px;color:var(--muted);}
.mini-stats b{font-size:18px;color:var(--text);}
.pending-card{min-height:160px;}
.users-table-card{grid-column:1 / -1;}
.panel-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:12px;}
.admin-filter-grid{display:grid;grid-template-columns:2fr 1fr 1fr;gap:10px;margin:12px 0 14px;}
.user-row-v35{display:grid;grid-template-columns:1fr auto;gap:12px;align-items:center;}
.user-main{min-width:0;}
.user-main b{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.user-actions{display:flex;flex-wrap:wrap;gap:6px;justify-content:flex-end;}
.status-pill{display:inline-flex;align-items:center;border-radius:999px;padding:2px 7px;font-size:10px;font-weight:900;letter-spacing:.02em;background:rgba(100,116,139,.12);color:var(--muted);border:1px solid rgba(100,116,139,.18);}
.status-approved{background:rgba(22,163,74,.12);color:var(--success);border-color:rgba(22,163,74,.18);}
.status-pending{background:rgba(217,119,6,.12);color:var(--warning);border-color:rgba(217,119,6,.18);}
.status-rejected,.status-disabled{background:rgba(220,38,38,.10);color:var(--danger);border-color:rgba(220,38,38,.18);}
@media (max-width:900px){.form-grid.two,.user-admin-grid,.admin-filter-grid{grid-template-columns:1fr}.user-create-card{grid-row:auto}.user-row-v35{grid-template-columns:1fr}.user-actions{justify-content:flex-start}}

/* v36 Dashboard + Activity Center */
.dashboard-wrap{display:flex;flex-direction:column;gap:16px;}
.dashboard-hero{display:flex;align-items:center;justify-content:space-between;gap:16px;background:linear-gradient(135deg,rgba(59,130,246,.08),rgba(16,185,129,.06));}
.dashboard-hero h2{margin:0 0 6px;font-size:24px;}
.dashboard-actions{display:flex;gap:10px;flex-wrap:wrap;justify-content:flex-end;}
.dashboard-stats{display:grid;grid-template-columns:repeat(6,minmax(120px,1fr));gap:12px;}
.dashboard-stat small{display:block;margin-top:4px;color:var(--muted);font-size:11px;}
.dashboard-stat.clickable{cursor:pointer;}
.dashboard-stat.clickable:hover{transform:translateY(-1px);}
.dashboard-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px;align-items:start;}
.dashboard-panel{min-height:180px;}
.dashboard-heading{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:12px;}
.dashboard-heading h2{margin:0;}
button.tiny{padding:6px 10px;font-size:12px;border-radius:10px;}
.note-grid.compact{grid-template-columns:repeat(auto-fill,minmax(210px,1fr));}
.dashboard-task{cursor:pointer;}
.dashboard-task small{display:block;color:var(--muted);font-size:11px;margin-top:2px;}
.activity-filters{display:flex;gap:8px;flex-wrap:wrap;margin-bottom:12px;}
.chip{border:1px solid var(--border);background:var(--card);border-radius:999px;padding:7px 11px;cursor:pointer;color:var(--text);}
.chip.active{background:var(--primary);border-color:var(--primary);color:#fff;}
.activity-list{display:flex;flex-direction:column;gap:10px;max-height:420px;overflow:auto;padding-right:4px;}
.activity-item{display:grid;grid-template-columns:34px 1fr;gap:10px;padding:10px;border:1px solid var(--border);border-radius:14px;background:var(--soft);}
.activity-icon{width:34px;height:34px;border-radius:12px;display:grid;place-items:center;background:var(--card);border:1px solid var(--border);}
.activity-item b{display:block;margin-bottom:3px;}
.activity-item p{margin:0 0 4px;color:var(--muted);font-size:13px;}
.activity-item small{color:var(--muted);font-size:11px;}
.admin-summary-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;}
.admin-summary-grid div{padding:12px;border:1px solid var(--border);border-radius:14px;background:var(--soft);}
.admin-summary-grid b{display:block;font-size:22px;margin-bottom:4px;}
.admin-summary-grid span{color:var(--muted);font-size:12px;}
@media (max-width:1100px){.dashboard-stats{grid-template-columns:repeat(3,minmax(120px,1fr));}.dashboard-grid{grid-template-columns:1fr;}.dashboard-hero{align-items:flex-start;flex-direction:column;}.dashboard-actions{justify-content:flex-start;}}
@media (max-width:680px){.dashboard-stats{grid-template-columns:repeat(2,minmax(0,1fr));}.admin-summary-grid{grid-template-columns:repeat(2,minmax(0,1fr));}}


/* ===== v37 UI/UX Final Cleanup ===== */
:root{
  --v37-sidebar:252px;
  --v37-note-list:336px;
  --v37-topbar:58px;
}
.shell.view-notes{grid-template-columns:var(--v37-sidebar) minmax(0,1fr)!important;background:var(--bg)!important;}
.shell.view-notes.sidebar-collapsed{grid-template-columns:58px minmax(0,1fr)!important;}
.sidebar{border-right:1px solid var(--border)!important;box-shadow:8px 0 30px rgba(15,23,42,.035)!important;}
.sidebar .tools-group .nav-btn[data-view="mail"]{display:none!important;}
.sidebar-title span{display:block;max-width:150px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.view-notes .main{display:grid!important;grid-template-rows:var(--v37-topbar) minmax(0,1fr)!important;height:100vh!important;overflow:hidden!important;}
.view-notes .compact-topbar{min-height:var(--v37-topbar)!important;border-bottom:1px solid var(--border)!important;background:rgba(255,255,255,.82)!important;backdrop-filter:blur(14px)!important;position:sticky!important;top:0!important;z-index:20!important;}
body.dark .view-notes .compact-topbar{background:rgba(15,23,42,.86)!important;}
.view-notes .content{padding:0!important;overflow:hidden!important;}
.notes-workspace-v37{display:grid!important;grid-template-columns:var(--v37-note-list) minmax(0,1fr)!important;gap:0!important;height:calc(100vh - var(--v37-topbar))!important;min-height:0!important;}
.note-list-final{min-width:0!important;width:auto!important;border-radius:0!important;border-width:0 1px 0 0!important;background:var(--panel)!important;display:grid!important;grid-template-rows:auto auto minmax(0,1fr)!important;overflow:hidden!important;}
.note-list-final .panel-head{position:sticky!important;top:0!important;z-index:5!important;margin:0!important;padding:14px!important;border-bottom:1px solid var(--border)!important;background:var(--panel)!important;border-radius:0!important;}
.note-list-final .panel-head h2{font-size:16px!important;line-height:1.2!important;margin:0 0 2px!important;}
.note-list-toolbar{padding:10px 12px;border-bottom:1px solid var(--border);background:var(--soft);}
.note-list-toolbar .primary{min-height:34px!important;}
.note-list-final .notes-list{padding:10px!important;overflow:auto!important;}
.note-row-final{display:grid!important;text-align:left!important;gap:4px!important;border:1px solid transparent!important;background:transparent!important;min-height:74px!important;padding:11px!important;margin-bottom:7px!important;}
.note-row-final:hover{background:var(--soft)!important;border-color:var(--border)!important;transform:translateY(-1px);}
.note-row-final.active{background:rgba(37,99,235,.10)!important;border-color:rgba(37,99,235,.22)!important;box-shadow:0 12px 24px rgba(37,99,235,.08)!important;}
.note-row-final b{font-size:13px!important;color:var(--text)!important;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.note-row-final small{font-size:10px!important;color:var(--muted)!important;}
.note-row-final span{font-size:11px!important;color:var(--muted)!important;line-height:1.4!important;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;}
.editor-final{border-radius:0!important;border:0!important;background:linear-gradient(180deg,var(--panel),var(--bg))!important;min-height:0!important;height:100%!important;overflow:auto!important;padding:18px!important;}
.editor-pane-final{max-width:1120px;margin:0 auto;}
.editor-final .title-input{font-size:28px!important;font-weight:900!important;letter-spacing:-.03em!important;border-bottom:1px solid var(--border)!important;margin-bottom:10px!important;}
.editor-final .meta-grid{background:var(--soft);border:1px solid var(--border);border-radius:16px;padding:10px!important;margin:10px 0 12px!important;}
.editor-final .note-editor{background:var(--panel)!important;border:1px solid var(--border)!important;box-shadow:0 18px 50px rgba(15,23,42,.055)!important;min-height:calc(100vh - 280px)!important;}
.editor-final .note-editor:not(.editing){font-size:14px!important;line-height:1.72!important;}
.editor-final .tabs-panel{max-width:1120px;margin:0 auto 10px;}
.topbar-note-actions .note-actions-left{scrollbar-width:thin!important;}
.topbar-note-actions .note-actions-left button{border-radius:999px!important;}
.empty-state-v37{min-height:240px;display:grid;place-items:center;align-content:center;text-align:center;gap:10px;border:1px dashed var(--border);border-radius:22px;background:linear-gradient(180deg,var(--panel),var(--soft));padding:28px;color:var(--text);}
.empty-icon-v37{width:62px;height:62px;border-radius:22px;display:grid;place-items:center;background:var(--soft);border:1px solid var(--border);font-size:28px;box-shadow:0 12px 30px rgba(15,23,42,.06);}
.empty-state-v37 h2{margin:0;font-size:22px;letter-spacing:-.02em;}
.empty-state-v37 p{margin:0;color:var(--muted);max-width:520px;line-height:1.6;}
.empty-actions-v37{display:flex;gap:10px;justify-content:center;flex-wrap:wrap;margin-top:6px;}
.notes-empty-wrap{padding:18px;}
.locked-final{padding:16px;display:grid;place-items:center;min-height:100%;}
.loading-state-v37{display:flex;align-items:center;gap:12px;border:1px solid var(--border);border-radius:18px;padding:16px;background:var(--panel);}
.loading-state-v37 p{margin:2px 0 0;color:var(--muted);}
.loader-v37{width:26px;height:26px;border-radius:50%;border:3px solid var(--border);border-top-color:var(--primary);animation:v37spin .9s linear infinite;}
@keyframes v37spin{to{transform:rotate(360deg)}}
.notelist-collapsed .notes-workspace-v37{grid-template-columns:70px minmax(0,1fr)!important;}
.notelist-collapsed .note-list-final{width:70px!important;max-width:70px!important;}
.notelist-collapsed .note-list-toolbar,.notelist-collapsed .notes-list{display:none!important;}
.notelist-collapsed .note-list-final .panel-head{height:100%;align-content:start;}
.notelist-collapsed .note-list-final .panel-head h2{writing-mode:vertical-rl;transform:rotate(180deg);max-height:230px;overflow:hidden;}
.notelist-collapsed .note-list-final .panel-head small{display:none!important;}
.notelist-collapsed .notebook-actions{display:grid!important;grid-template-columns:1fr!important;width:100%;}
@media(max-width:980px){
  :root{--v37-sidebar:220px;--v37-note-list:300px;}
  .notes-workspace-v37{grid-template-columns:minmax(260px,34vw) minmax(0,1fr)!important;}
  .editor-final{padding:12px!important;}
}
@media(max-width:760px){
  .view-notes .main{height:auto!important;overflow:visible!important;}
  .view-notes .content{overflow:visible!important;}
  .notes-workspace-v37{display:flex!important;flex-direction:column!important;height:auto!important;min-height:calc(100vh - var(--v37-topbar))!important;}
  .note-list-final{border-width:0 0 1px 0!important;max-height:46vh!important;}
  .editor-final{min-height:60vh!important;}
  .editor-final .title-input{font-size:22px!important;}
  .compact-topbar{grid-template-columns:1fr!important;}
  .topbar-note-actions{overflow:auto!important;}
}

/* v38 Editor Panel Redesign - screenshot matched workspace */
:root{--v38-topbar:72px;--v38-blue:#2563eb;--v38-card-shadow:0 14px 38px rgba(15,23,42,.055)}
.topbar-note-actions{flex:1!important;min-width:520px!important;max-width:none!important;overflow:visible!important;align-self:stretch!important;display:flex!important;align-items:center!important;justify-content:flex-end!important}
.editor-command-bar-v38{width:100%!important;display:flex!important;align-items:center!important;justify-content:space-between!important;gap:12px!important;background:transparent!important;border:0!important;box-shadow:none!important;margin:0!important;padding:0!important;min-width:0!important}
.editor-command-left-v38{display:flex!important;align-items:center!important;gap:8px!important;min-width:max-content!important}
.editor-command-right-v38{display:flex!important;align-items:center!important;gap:8px!important;justify-content:flex-end!important;flex-wrap:nowrap!important;overflow-x:auto!important;scrollbar-width:thin!important;padding:2px 0!important}
.editor-command-right-v38::-webkit-scrollbar{height:5px}.editor-command-right-v38::-webkit-scrollbar-thumb{background:var(--border);border-radius:99px}
.editor-command-right-v38 button{white-space:nowrap!important;min-height:32px!important;border-radius:10px!important;font-size:12px!important;padding:7px 12px!important;box-shadow:none!important}
.editor-status-pill{display:inline-flex;align-items:center;gap:6px;white-space:nowrap;border-radius:999px;padding:7px 10px;font-size:12px;font-weight:900;color:var(--muted);background:var(--soft);border:1px solid var(--border)}
.editor-status-pill.editing-self{color:#166534;background:#dcfce7;border-color:#bbf7d0}.editor-status-pill.locked-other{color:#92400e;background:#fef3c7;border-color:#fde68a}.editor-status-pill.view-mode{color:#1e40af;background:#dbeafe;border-color:#bfdbfe}
.editor-final{background:#f8fbff!important;padding:14px!important;overflow:hidden!important}.editor-shell-v38{padding:0!important;height:100%!important;display:block!important}.editor-layout-v38{height:100%!important;display:grid!important;grid-template-columns:minmax(0,1fr) 300px!important;gap:14px!important;align-items:stretch!important;min-height:0!important}.editor-main-v38{height:100%!important;display:flex!important;flex-direction:column!important;min-width:0!important;background:#fff!important;border:1px solid #dfe8f5!important;border-radius:18px!important;padding:22px!important;box-shadow:var(--v38-card-shadow)!important;overflow:hidden!important}.note-title-block-v38{display:flex;align-items:center;margin-bottom:12px}.title-input-v38{font-size:24px!important;font-weight:900!important;line-height:1.2!important;padding:0 0 8px!important;margin:0!important;border:0!important;background:transparent!important;width:100%!important;color:var(--text)!important}.meta-grid-v38{display:grid!important;grid-template-columns:96px minmax(0,1fr) 170px!important;gap:8px!important;margin:0 0 14px!important;padding:0!important;background:transparent!important;border:0!important}.meta-grid-v38 select,.meta-grid-v38 input{height:42px!important;border-radius:10px!important;background:#fff!important;border:1px solid #dfe8f5!important;font-size:12px!important;font-weight:800!important}.tag-shell-v38{position:relative;display:grid;grid-template-columns:auto minmax(120px,1fr);align-items:center;gap:8px;border:1px solid #dfe8f5;border-radius:10px;background:#fff;min-width:0;padding:0 8px}.tag-shell-v38 input{border:0!important;background:transparent!important;padding:0!important;height:40px!important;min-width:0!important}.tag-placeholder-v38{display:inline-flex;align-items:center;border-radius:999px;background:#f1f5f9;color:#64748b;font-size:12px;font-weight:900;line-height:1;max-width:220px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;padding:7px 9px}.rich-toolbar-v38{position:relative!important;top:auto!important;z-index:2!important;display:flex!important;gap:6px!important;align-items:center!important;max-height:78px!important;overflow:auto!important;background:#f8fbff!important;border:1px solid #dfe8f5!important;border-radius:14px!important;padding:9px!important;margin:0 0 12px!important}.rich-toolbar-v38 button,.rich-toolbar-v38 select,.rich-toolbar-v38 .color-tool{height:31px!important;min-height:31px!important;border-radius:8px!important;background:#fff!important;border:1px solid #e5edf7!important;box-shadow:0 4px 12px rgba(15,23,42,.035)!important;font-size:11px!important;font-weight:900!important;color:#172033!important;padding:5px 8px!important}.rich-toolbar-v38 button:hover{background:#eef3fb!important}.editor-canvas-card-v38{flex:1!important;min-height:0!important;display:flex!important;flex-direction:column!important;border:1px solid #dbe6f4!important;border-radius:16px!important;overflow:hidden!important;background:#fff!important}.note-editor-v38{flex:1!important;min-height:420px!important;height:auto!important;border:0!important;border-radius:0!important;background:#fff!important;box-shadow:none!important;padding:28px!important;line-height:1.68!important;font-size:14px!important;overflow:auto!important;color:#142033!important}.note-editor-v38.editing{outline:0!important;background:#fff!important}.note-editor-v38 h2:first-child{margin-top:0;color:#142033}.editor-footer-v38{display:flex!important;gap:16px!important;align-items:center!important;border-top:1px solid #e5edf7!important;padding:9px 12px!important;font-size:11px!important;font-weight:800!important;color:#64748b!important}.editor-footer-v38 b{margin-left:auto;color:#64748b}.editor-inspector-v38{min-width:0;height:100%;overflow:auto;display:flex;flex-direction:column;gap:10px}.editor-side-tabs-v38{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:4px;padding:6px;background:#fff;border:1px solid #dfe8f5;border-radius:14px;box-shadow:var(--v38-card-shadow)}.editor-side-tabs-v38 button{height:34px;border-radius:10px;font-size:11px;font-weight:900;background:transparent;color:#334155;padding:6px}.editor-side-tabs-v38 button.active,.editor-side-tabs-v38 button:hover{background:#dbeafe;color:#1d4ed8}.side-tab-count{display:inline-flex;align-items:center;justify-content:center;margin-left:3px;min-width:18px;height:18px;border-radius:999px;background:#eef3fb;color:#2563eb;font-size:10px}.editor-side-card-v38{background:#fff;border:1px solid #dfe8f5;border-radius:16px;padding:14px;box-shadow:var(--v38-card-shadow)}.note-summary-head-v38{display:flex;align-items:flex-start;justify-content:space-between;gap:8px;margin-bottom:10px}.note-summary-head-v38 h3,.side-card-head-v38 h3{margin:0;font-size:15px;line-height:1.3}.category-badge{font-size:10px;font-weight:900;border-radius:999px;padding:5px 8px;background:#dbeafe;color:#2563eb}.category-badge.admin{background:#e0e7ff;color:#4338ca}.category-badge.private{background:#fef3c7;color:#92400e}.category-badge.public{background:#dcfce7;color:#166534}.note-summary-grid-v38{display:grid;grid-template-columns:82px 1fr;gap:7px 10px;margin:0;font-size:12px}.note-summary-grid-v38 dt{color:#64748b}.note-summary-grid-v38 dd{margin:0;font-weight:900;color:#1e293b}.status-badge-v38{display:inline-flex;border-radius:999px;background:#dbeafe;color:#2563eb;padding:4px 8px;font-size:11px}.side-card-head-v38{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:9px}.side-card-head-v38 button,.link-btn-v38{background:transparent!important;color:#1e40af!important;padding:0!important;font-size:11px!important;font-weight:900!important}.mini-muted-v38{font-size:12px;margin:5px 0 10px}.compact-line-v38{display:grid;gap:2px;padding:8px 0;border-top:1px solid #eef3fb}.compact-line-v38:first-of-type{border-top:0}.compact-line-v38 b{font-size:12px}.compact-line-v38 span{font-size:11px;color:#64748b;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.compact-task-v38{display:grid;gap:2px;padding:7px 0;border-top:1px solid #eef3fb}.compact-task-v38:first-of-type{border-top:0}.compact-task-v38 label{font-size:12px;font-weight:900}.compact-task-v38 small{font-size:11px;color:#64748b}.compact-task-v38.done label{text-decoration:line-through;color:#64748b}.compact-file-v38{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:7px 0;border-top:1px solid #eef3fb}.compact-file-v38:first-of-type{border-top:0}.compact-file-v38 a{font-size:12px;font-weight:800;color:#1e40af;text-decoration:none;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.compact-form-v38{display:flex;gap:6px;margin-top:9px}.compact-form-v38 input,.compact-form-v38 select{height:36px!important;border-radius:10px!important;font-size:12px!important;min-width:0}.compact-form-v38 button{height:36px!important;border-radius:10px!important;font-size:12px!important;padding:7px 10px!important}.task-compact-form-v38{display:grid;grid-template-columns:minmax(0,1fr) 110px;gap:6px}.task-compact-form-v38 input[type=date],.task-compact-form-v38 select[name=priority]{display:none}.workspace-tabs{display:none!important}.side-by-side-workspace.editor-layout-v38.active{grid-template-columns:minmax(0,1fr) minmax(280px,360px)!important}.side-by-side-workspace.editor-layout-v38.active .editor-inspector-v38{display:none!important}.side-by-side-workspace.editor-layout-v38.active .split-preview{display:block!important;overflow:auto!important}.find-panel{z-index:20}
body.dark .editor-final,body.dark .rich-toolbar-v38{background:#0f172a!important}body.dark .editor-main-v38,body.dark .editor-side-card-v38,body.dark .editor-side-tabs-v38,body.dark .editor-canvas-card-v38,body.dark .note-editor-v38,body.dark .meta-grid-v38 select,body.dark .tag-shell-v38,body.dark .rich-toolbar-v38 button,body.dark .rich-toolbar-v38 select,body.dark .rich-toolbar-v38 .color-tool{background:var(--panel)!important;border-color:var(--border)!important;color:var(--text)!important}body.dark .note-summary-grid-v38 dd,body.dark .note-editor-v38{color:var(--text)!important}body.dark .tag-placeholder-v38{background:var(--soft);color:var(--muted)}
@media(max-width:1280px){.editor-layout-v38{grid-template-columns:minmax(0,1fr) 280px!important}.topbar-note-actions{min-width:420px!important}.editor-command-right-v38 button{font-size:11px!important;padding:6px 9px!important}.meta-grid-v38{grid-template-columns:92px minmax(0,1fr)!important}.meta-grid-v38 #noteTemplate{grid-column:1/-1}}
@media(max-width:980px){.topbar{display:grid!important;grid-template-columns:auto 1fr!important;grid-template-areas:"title actions" "note note"!important}.topbar>div:first-child{grid-area:title}.top-actions{grid-area:actions}.topbar-note-actions{grid-area:note;min-width:0!important;width:100%!important}.editor-layout-v38{display:flex!important;flex-direction:column!important;overflow:auto!important}.editor-inspector-v38{height:auto;overflow:visible}.editor-side-tabs-v38{position:sticky;top:0;z-index:4}.editor-main-v38{overflow:visible!important}.note-editor-v38{min-height:360px!important}.editor-final{overflow:auto!important}}
@media(max-width:640px){.editor-main-v38{padding:14px!important;border-radius:14px!important}.meta-grid-v38{grid-template-columns:1fr!important}.tag-shell-v38{grid-template-columns:1fr}.tag-placeholder-v38{display:none}.rich-toolbar-v38{max-height:130px!important}.editor-side-tabs-v38{grid-template-columns:1fr 1fr}.editor-command-bar-v38{display:grid!important;gap:8px!important}.editor-command-right-v38{justify-content:flex-start!important}.compact-form-v38,.task-compact-form-v38{grid-template-columns:1fr!important;display:grid!important}.note-editor-v38{padding:18px!important}}

/* v38.1 Editor UI polish: responsive professional workspace */
:root{--v381-side:330px;--v381-gap:18px;}
.content:has(.notes-workspace-v37){padding:16px!important;}
.notes-workspace-v37.split{width:100%!important;max-width:none!important;grid-template-columns:minmax(280px,330px) minmax(0,1fr)!important;gap:16px!important;align-items:stretch!important;}
.notelist-collapsed .notes-workspace-v37.split{grid-template-columns:0 minmax(0,1fr)!important;gap:0!important;}
.notelist-collapsed .note-list-final{display:none!important;}
.editor-panel.editor-final{width:100%!important;max-width:none!important;min-width:0!important;padding:16px!important;background:#f8fbff!important;overflow:hidden!important;}
.editor-shell-v38{width:100%!important;max-width:none!important;height:100%!important;min-width:0!important;}
.editor-layout-v38{width:100%!important;max-width:none!important;display:grid!important;grid-template-columns:minmax(560px,1fr) minmax(300px,var(--v381-side))!important;gap:var(--v381-gap)!important;align-items:stretch!important;}
.editor-main-v38{width:100%!important;max-width:none!important;min-width:0!important;margin:0!important;padding:22px 24px!important;}
.editor-inspector-v38{width:100%!important;max-width:var(--v381-side)!important;min-width:0!important;margin:0!important;}
.note-title-block-v38{margin-bottom:18px!important;}
.title-input-v38{font-size:26px!important;padding-bottom:10px!important;}
.meta-grid-v38{grid-template-columns:minmax(120px,150px) minmax(180px,1fr) minmax(160px,220px)!important;gap:10px!important;margin-bottom:18px!important;}
.editor-canvas-card-v38{min-height:calc(100vh - 260px)!important;}
.note-editor-v38{min-height:calc(100vh - 310px)!important;padding:30px 32px!important;}
.editor-command-bar-v38{gap:10px!important;overflow:visible!important;}
.topbar-note-actions{min-width:0!important;max-width:100%!important;overflow:visible!important;}
.editor-command-left-v38{flex:0 0 auto!important;}
.editor-command-right-v38{display:flex!important;align-items:center!important;justify-content:flex-end!important;gap:8px!important;min-width:0!important;flex-wrap:nowrap!important;}
.editor-command-right-v38>button,.note-more-menu-v38>summary{height:34px!important;border-radius:11px!important;padding:8px 12px!important;font-size:12px!important;white-space:nowrap!important;}
.note-more-menu-v38{position:relative!important;display:inline-block!important;}
.note-more-menu-v38>summary{list-style:none!important;display:inline-flex!important;align-items:center!important;gap:6px!important;cursor:pointer!important;}
.note-more-menu-v38>summary::-webkit-details-marker{display:none!important;}
.note-more-menu-v38>summary:after{content:'⋯';font-weight:900;letter-spacing:1px;}
.note-more-dropdown-v38{position:absolute!important;right:0!important;top:calc(100% + 8px)!important;z-index:80!important;width:220px!important;display:grid!important;gap:6px!important;background:var(--panel)!important;border:1px solid var(--border)!important;border-radius:16px!important;padding:10px!important;box-shadow:0 22px 60px rgba(15,23,42,.16)!important;}
.note-more-dropdown-v38 button{width:100%!important;justify-content:flex-start!important;text-align:left!important;border-radius:12px!important;}
.editor-side-tabs-v38{display:flex!important;align-items:center!important;gap:6px!important;padding:6px!important;overflow-x:auto!important;scrollbar-width:thin!important;}
.editor-side-tabs-v38 button{flex:1 0 auto!important;min-width:68px!important;height:38px!important;display:inline-flex!important;align-items:center!important;justify-content:center!important;gap:4px!important;border-radius:11px!important;padding:8px 10px!important;font-size:12px!important;line-height:1!important;}
.side-tab-count{display:inline!important;min-width:auto!important;height:auto!important;margin-left:2px!important;border-radius:0!important;background:transparent!important;color:inherit!important;font-size:11px!important;font-weight:900!important;}
.note-summary-grid-v38{grid-template-columns:74px minmax(0,1fr)!important;gap:8px 10px!important;}
.note-summary-grid-v38 dd{overflow:hidden!important;text-overflow:ellipsis!important;white-space:nowrap!important;}
.status-badge-v38{display:none!important;}
.editor-side-card-v38{border-radius:16px!important;padding:15px!important;}
.side-card-head-v38 h3{font-size:14px!important;}
.compact-form-v38 input,.compact-form-v38 select{min-width:0!important;}
.task-compact-form-v38{grid-template-columns:minmax(0,1fr) minmax(86px,120px)!important;}

@media(min-width:1500px){
  :root{--v381-side:350px;}
  .editor-layout-v38{grid-template-columns:minmax(760px,1fr) minmax(320px,var(--v381-side))!important;}
  .note-editor-v38{padding:34px 40px!important;}
}
@media(max-width:1280px){
  :root{--v381-side:300px;--v381-gap:14px;}
  .notes-workspace-v37.split{grid-template-columns:minmax(250px,300px) minmax(0,1fr)!important;}
  .editor-layout-v38{grid-template-columns:minmax(0,1fr) minmax(280px,var(--v381-side))!important;}
  .editor-command-right-v38{overflow-x:auto!important;padding-bottom:2px!important;}
  .meta-grid-v38{grid-template-columns:minmax(100px,130px) minmax(0,1fr)!important;}
  .meta-grid-v38 #noteTemplate{grid-column:1/-1!important;}
}
@media(max-width:980px){
  .notes-workspace-v37.split{grid-template-columns:1fr!important;}
  .note-list-final{max-height:300px!important;}
  .editor-layout-v38{display:flex!important;flex-direction:column!important;}
  .editor-inspector-v38{max-width:none!important;width:100%!important;}
  .editor-canvas-card-v38{min-height:520px!important;}
  .note-editor-v38{min-height:460px!important;}
  .editor-side-tabs-v38 button{flex:1 0 110px!important;}
  .topbar-note-actions{overflow-x:auto!important;padding-bottom:4px!important;}
}
@media(max-width:640px){
  .content:has(.notes-workspace-v37){padding:10px!important;}
  .editor-panel.editor-final{padding:10px!important;}
  .editor-main-v38{padding:16px!important;}
  .title-input-v38{font-size:22px!important;}
  .meta-grid-v38{grid-template-columns:1fr!important;}
  .editor-canvas-card-v38{min-height:480px!important;}
  .note-editor-v38{min-height:420px!important;padding:20px!important;}
  .editor-command-bar-v38{display:flex!important;align-items:center!important;}
  .editor-command-right-v38{overflow-x:auto!important;justify-content:flex-start!important;width:100%!important;}
  .note-more-dropdown-v38{right:auto!important;left:0!important;}
}

/* v38.2 Hotfix: More menu dropdown portal-like fixed positioning
   Fixes clipping/overflow bug in the top action bar. */
.note-more-menu-v38[open] > summary{
  background:#eaf2ff!important;
  color:#1d4ed8!important;
  border-color:#bfdbfe!important;
  position:relative!important;
  z-index:120!important;
}
.note-more-menu-v38[open] .note-more-dropdown-v38{
  position:fixed!important;
  top:52px!important;
  right:18px!important;
  left:auto!important;
  z-index:9999!important;
  width:min(260px,calc(100vw - 32px))!important;
  max-height:calc(100vh - 76px)!important;
  overflow-y:auto!important;
  overflow-x:hidden!important;
  display:grid!important;
  gap:7px!important;
  padding:10px!important;
  background:var(--panel)!important;
  border:1px solid var(--border)!important;
  border-radius:16px!important;
  box-shadow:0 28px 80px rgba(15,23,42,.24)!important;
}
.note-more-menu-v38[open] .note-more-dropdown-v38 button{
  display:flex!important;
  align-items:center!important;
  width:100%!important;
  min-height:36px!important;
  padding:9px 11px!important;
  justify-content:flex-start!important;
  text-align:left!important;
  white-space:nowrap!important;
  border-radius:12px!important;
}
.editor-command-right-v38,
.topbar-note-actions,
.topbar,
.compact-topbar{
  overflow:visible!important;
}
@media(max-width:640px){
  .note-more-menu-v38[open] .note-more-dropdown-v38{
    top:96px!important;
    right:10px!important;
    width:calc(100vw - 20px)!important;
    max-height:calc(100vh - 120px)!important;
  }
}


/* v38.3 Final Editor UI Fix
   - Save/Cancel action state fix support
   - Mode badge moved to right metadata card
   - Multitab restored in editor topbar
   - Toolbar wrap/height fixed
   - Professional responsive spacing cleanup */
.editor-topbar-v383{
  display:grid!important;
  grid-template-columns:minmax(180px,1fr) auto!important;
  align-items:center!important;
  gap:12px!important;
  padding-left:14px!important;
  overflow:visible!important;
}
.editor-topbar-v383 .topbar-title{display:none!important;}
.editor-tab-strip-v383{
  min-width:0!important;
  display:flex!important;
  align-items:center!important;
  overflow:hidden!important;
}
.workspace-tabs,
.workspace-tabs-v383{
  display:block!important;
  width:100%!important;
  min-width:0!important;
}
.workspace-tabs-v383 .tab-row{
  display:flex!important;
  align-items:center!important;
  gap:6px!important;
  overflow-x:auto!important;
  overflow-y:hidden!important;
  padding:2px 2px 4px!important;
  scrollbar-width:thin!important;
}
.workspace-tabs-v383 .tab-row::-webkit-scrollbar{height:5px;}
.workspace-tabs-v383 .tab-row::-webkit-scrollbar-thumb{background:#cbd5e1;border-radius:999px;}
.note-tab{
  display:inline-flex!important;
  align-items:center!important;
  gap:6px!important;
  max-width:210px!important;
  min-width:88px!important;
  height:34px!important;
  padding:7px 10px!important;
  border:1px solid #dfe8f5!important;
  border-radius:12px!important;
  background:#fff!important;
  color:#334155!important;
  font-size:12px!important;
  font-weight:900!important;
  white-space:nowrap!important;
  box-shadow:0 8px 20px rgba(15,23,42,.04)!important;
}
.note-tab.active{
  background:#dbeafe!important;
  color:#1d4ed8!important;
  border-color:#bfdbfe!important;
}
.note-tab-title{
  min-width:0!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
}
.note-tab-close{
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  flex:0 0 18px!important;
  width:18px!important;
  height:18px!important;
  border-radius:999px!important;
  background:rgba(15,23,42,.08)!important;
  color:#475569!important;
  font-size:13px!important;
  line-height:1!important;
}
.note-tab-close:hover{background:#ef4444!important;color:#fff!important;}
.note-tab.add-tab{
  min-width:34px!important;
  width:34px!important;
  padding:0!important;
  justify-content:center!important;
  font-size:18px!important;
}
.editor-action-strip-v383{
  flex:0 0 auto!important;
  min-width:0!important;
  max-width:min(680px,52vw)!important;
  overflow:visible!important;
  justify-content:flex-end!important;
}
.editor-command-bar-v38{
  justify-content:flex-end!important;
  width:auto!important;
}
.editor-command-left-v38{display:none!important;}
.editor-command-right-v38{
  overflow-x:auto!important;
  overflow-y:visible!important;
  flex-wrap:nowrap!important;
  max-width:100%!important;
  scrollbar-width:thin!important;
}
.editor-command-right-v38>button,
.note-more-menu-v38>summary{
  height:34px!important;
  flex:0 0 auto!important;
}
.status-badge-v38.read{background:#dbeafe!important;color:#1d4ed8!important;}
.status-badge-v38.editing{background:#dcfce7!important;color:#166534!important;}
.status-badge-v38.locked{background:#fef3c7!important;color:#92400e!important;}
.editor-main-v38{
  overflow:visible!important;
}
.rich-toolbar-v38{
  display:flex!important;
  flex-wrap:wrap!important;
  align-items:center!important;
  gap:7px!important;
  max-height:none!important;
  min-height:46px!important;
  overflow:visible!important;
  padding:10px!important;
  margin:0 0 12px!important;
}
.rich-toolbar-v38 button,
.rich-toolbar-v38 select,
.rich-toolbar-v38 .color-tool{
  height:34px!important;
  min-height:34px!important;
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  flex:0 0 auto!important;
}
.rich-toolbar-v38 select{
  min-width:92px!important;
}
.rich-toolbar-v38 .color-tool input[type=color]{
  width:18px!important;
  height:18px!important;
  padding:0!important;
  margin-left:4px!important;
  border:0!important;
  background:transparent!important;
}
.editor-layout-v38{
  grid-template-columns:minmax(0,1fr) minmax(300px,340px)!important;
}
.editor-side-tabs-v38{
  display:flex!important;
  flex-wrap:nowrap!important;
  align-items:center!important;
  gap:6px!important;
  overflow-x:auto!important;
}
.editor-side-tabs-v38 button{
  min-width:max-content!important;
  flex:1 0 auto!important;
  height:36px!important;
  padding:8px 10px!important;
}
.side-tab-count{
  background:transparent!important;
  min-width:0!important;
  height:auto!important;
  margin-left:4px!important;
  color:inherit!important;
  font-size:inherit!important;
}
.note-summary-grid-v38{grid-template-columns:78px minmax(0,1fr)!important;}
.note-more-menu-v38[open] .note-more-dropdown-v38{top:56px!important;}
@media(min-width:1440px){
  .editor-action-strip-v383{max-width:min(760px,50vw)!important;}
  .editor-layout-v38{grid-template-columns:minmax(0,1fr) minmax(320px,360px)!important;}
}
@media(max-width:1100px){
  .editor-topbar-v383{
    grid-template-columns:1fr!important;
    grid-template-rows:auto auto!important;
  }
  .editor-action-strip-v383{
    width:100%!important;
    max-width:none!important;
    justify-content:flex-start!important;
  }
  .editor-command-right-v38{justify-content:flex-start!important;}
}
@media(max-width:640px){
  .editor-topbar-v383{padding-left:10px!important;gap:8px!important;}
  .note-tab{max-width:170px!important;}
  .editor-command-right-v38{width:100%!important;}
  .rich-toolbar-v38{max-height:180px!important;overflow:auto!important;}
  .note-more-menu-v38[open] .note-more-dropdown-v38{top:104px!important;}
}
body.dark .note-tab{background:var(--panel)!important;border-color:var(--border)!important;color:var(--text)!important;}
body.dark .note-tab.active{background:#1e3a8a!important;color:#dbeafe!important;border-color:#2563eb!important;}

/* ===== v38.4.2 SAFE editor layout, multitab, more-menu, collapse fixes ===== */
/* Keep the global topbar simple; editor tools live inside the editor column so clicks on menus/sidebar stay safe. */
.editor-topbar-v384{
  display:flex!important;
  align-items:center!important;
  justify-content:space-between!important;
  padding:10px 16px!important;
  overflow:hidden!important;
}
.editor-topbar-v384 .topbar-title{display:block!important;min-width:0!important;}
.editor-topbar-v384 .topbar-title h1{font-size:16px!important;margin:0!important;}
.editor-topbar-v384 .topbar-title p{font-size:11px!important;margin:2px 0 0!important;color:var(--muted)!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important;}

/* Notes workspace collapse fix */
.notes-workspace-v37.split{grid-template-columns:minmax(280px,330px) minmax(0,1fr)!important;}
.notelist-collapsed .notes-workspace-v37.split{grid-template-columns:46px minmax(0,1fr)!important;gap:0!important;}
.notelist-collapsed .note-list-final{
  display:flex!important;
  width:46px!important;
  min-width:46px!important;
  max-width:46px!important;
  overflow:visible!important;
  background:var(--panel)!important;
  border-right:1px solid var(--border)!important;
}
.note-list-final .collapsed-rail-v384{display:none!important;}
.notelist-collapsed .note-list-final .note-list-expanded-v384{display:none!important;}
.notelist-collapsed .note-list-final .collapsed-rail-v384{
  display:flex!important;
  width:46px!important;
  height:100%!important;
  align-items:flex-start!important;
  justify-content:center!important;
  gap:8px!important;
  padding:14px 6px!important;
  border:0!important;
  border-radius:0!important;
  background:var(--panel)!important;
  color:var(--primary)!important;
  font-weight:900!important;
  box-shadow:none!important;
  writing-mode:vertical-rl!important;
  text-orientation:mixed!important;
}
.notelist-collapsed .note-list-final .collapsed-rail-v384 > span{font-size:12px!important;letter-spacing:.04em!important;}
.note-list-final .note-list-expanded-v384{display:grid!important;grid-template-rows:auto auto minmax(0,1fr)!important;min-height:0!important;height:100%!important;}

/* Editor panel now owns the tab strip and actions. */
.editor-panel.editor-final{
  display:grid!important;
  grid-template-rows:auto minmax(0,1fr)!important;
  overflow:hidden!important;
  padding:0!important;
  background:#f8fbff!important;
}
.editor-panel-topbar-v384{
  display:grid!important;
  grid-template-columns:minmax(220px,1fr) auto!important;
  align-items:center!important;
  gap:14px!important;
  min-height:54px!important;
  padding:9px 14px!important;
  border-bottom:1px solid var(--border)!important;
  background:rgba(255,255,255,.86)!important;
  backdrop-filter:blur(12px)!important;
  overflow:visible!important;
  position:relative!important;
  z-index:30!important;
}
body.dark .editor-panel-topbar-v384{background:rgba(15,23,42,.82)!important;}
.editor-panel-body-v384{min-height:0!important;overflow:hidden!important;padding:16px!important;}
.editor-tab-strip-v384{min-width:0!important;overflow:hidden!important;display:flex!important;align-items:center!important;}
.editor-action-strip-v384{display:flex!important;align-items:center!important;justify-content:flex-end!important;min-width:0!important;overflow:visible!important;}
.editor-action-strip-v384:empty{display:none!important;}
.editor-action-strip-v384 .editor-command-bar-v38{width:auto!important;justify-content:flex-end!important;overflow:visible!important;}
.editor-action-strip-v384 .editor-command-right-v38{
  display:flex!important;
  align-items:center!important;
  justify-content:flex-end!important;
  gap:8px!important;
  overflow:visible!important;
  flex-wrap:nowrap!important;
  max-width:min(720px,52vw)!important;
}
.editor-action-strip-v384 .editor-command-right-v38 > button,
.editor-action-strip-v384 .note-more-menu-v38 > summary{
  height:34px!important;
  flex:0 0 auto!important;
  border-radius:11px!important;
  padding:8px 12px!important;
  font-size:12px!important;
}

/* More dropdown: directly under the More button and aligned left/right safely inside the editor topbar. */
.note-more-menu-v38{position:relative!important;display:inline-flex!important;overflow:visible!important;}
.note-more-menu-v38>summary{list-style:none!important;cursor:pointer!important;display:inline-flex!important;align-items:center!important;gap:6px!important;}
.note-more-menu-v38>summary::-webkit-details-marker{display:none!important;}
.note-more-dropdown-v38{
  position:absolute!important;
  right:0!important;
  left:auto!important;
  top:calc(100% + 8px)!important;
  z-index:1000!important;
  width:220px!important;
  max-height:min(420px,calc(100vh - 120px))!important;
  overflow:auto!important;
  display:grid!important;
  gap:6px!important;
  padding:10px!important;
  background:var(--panel)!important;
  border:1px solid var(--border)!important;
  border-radius:16px!important;
  box-shadow:0 22px 60px rgba(15,23,42,.18)!important;
}
.note-more-menu-v38[open] .note-more-dropdown-v38{top:calc(100% + 8px)!important;right:0!important;width:220px!important;}
.note-more-dropdown-v38 button{width:100%!important;justify-content:flex-start!important;text-align:left!important;}

/* Multitab: sits above the editor, shows actual note names, active state, and dirty state. */
.editor-tab-strip-v384 .workspace-tabs,
.editor-tab-strip-v384 .workspace-tabs-v383{display:block!important;width:100%!important;min-width:0!important;margin:0!important;padding:0!important;border:0!important;background:transparent!important;overflow:hidden!important;}
.editor-tab-strip-v384 .tab-row{display:flex!important;align-items:center!important;gap:7px!important;overflow-x:auto!important;overflow-y:hidden!important;padding:2px 2px 4px!important;scrollbar-width:thin!important;}
.editor-tab-strip-v384 .note-tab{
  max-width:230px!important;
  min-width:132px!important;
  height:34px!important;
  padding:7px 10px!important;
  border:1px solid #dfe8f5!important;
  border-radius:12px!important;
  background:#fff!important;
  display:inline-flex!important;
  align-items:center!important;
  gap:8px!important;
  color:#334155!important;
  font-size:12px!important;
  font-weight:900!important;
  box-shadow:0 8px 20px rgba(15,23,42,.04)!important;
}
.editor-tab-strip-v384 .note-tab-title{min-width:0!important;overflow:hidden!important;text-overflow:ellipsis!important;white-space:nowrap!important;}
.editor-tab-strip-v384 .note-tab.active{background:#dbeafe!important;color:#1d4ed8!important;border-color:#bfdbfe!important;}
.editor-tab-strip-v384 .note-tab.dirty .note-tab-title{color:#b45309!important;}
.editor-tab-strip-v384 .note-tab.add-tab{min-width:34px!important;width:34px!important;max-width:34px!important;padding:0!important;justify-content:center!important;font-size:18px!important;}
.editor-tab-strip-v384 .note-tab-close{margin-left:auto!important;}

/* Status badge must show in metadata panel. */
.status-badge-v38{display:inline-flex!important;align-items:center!important;justify-content:center!important;border-radius:999px!important;padding:4px 8px!important;font-size:11px!important;font-weight:900!important;}
.status-badge-v38.read{background:#dbeafe!important;color:#1d4ed8!important;}
.status-badge-v38.editing{background:#dcfce7!important;color:#166534!important;}
.status-badge-v38.locked{background:#fef3c7!important;color:#92400e!important;}

/* Body sizing after moving topbar into editor panel. */
.editor-panel-body-v384 .editor-shell-v38{height:100%!important;}
.editor-panel-body-v384 .editor-layout-v38{height:100%!important;}
.editor-panel-body-v384 .editor-main-v38{height:100%!important;}
.rich-toolbar-v38{max-height:none!important;overflow:visible!important;flex-wrap:wrap!important;}

@media(max-width:1180px){
  .editor-panel-topbar-v384{grid-template-columns:1fr!important;grid-template-rows:auto auto!important;align-items:start!important;}
  .editor-action-strip-v384{justify-content:flex-start!important;}
  .editor-action-strip-v384 .editor-command-right-v38{justify-content:flex-start!important;max-width:100%!important;overflow-x:auto!important;overflow-y:visible!important;}
}
@media(max-width:760px){
  .notelist-collapsed .notes-workspace-v37.split{grid-template-columns:1fr!important;}
  .notelist-collapsed .note-list-final{display:none!important;}
  .editor-panel-topbar-v384{padding:8px!important;}
  .editor-tab-strip-v384 .note-tab{min-width:116px!important;max-width:180px!important;}
  .editor-panel-body-v384{padding:10px!important;overflow:auto!important;}
}

/* v38.4.3 Editor Properties Relocation
   Moves category/tags/templates out of the main editor column so the editor canvas gets more vertical space. */
.editor-main-v38 .meta-grid-v38{display:none!important;}
.editor-properties-card-v3843{order:2;}
.editor-properties-card-v3843 .side-card-head-v38 .muted{font-size:11px;font-weight:800;color:#64748b;}
.editor-properties-grid-v3843{display:grid;grid-template-columns:78px minmax(0,1fr);gap:9px 10px;align-items:center;}
.editor-properties-grid-v3843 label{font-size:11px;font-weight:900;color:#64748b;text-transform:uppercase;letter-spacing:.02em;}
.editor-properties-grid-v3843 select,.editor-properties-grid-v3843 input{height:38px!important;min-width:0!important;border-radius:10px!important;background:#fff!important;border:1px solid #dfe8f5!important;font-size:12px!important;font-weight:800!important;color:#172033!important;}
.property-tag-shell-v3843{height:38px;grid-template-columns:auto minmax(0,1fr)!important;padding:0 8px!important;}
.property-tag-shell-v3843 .tag-placeholder-v38{max-width:92px;padding:6px 8px;font-size:10px;}
.property-tag-shell-v3843 input{height:36px!important;}
.editor-main-v38{padding-top:18px!important;}
.note-title-block-v38{margin-bottom:12px!important;}
.editor-canvas-card-v38{min-height:calc(100vh - 210px)!important;}
.note-editor-v38{min-height:calc(100vh - 260px)!important;}
.status-badge-v38{display:inline-flex!important;align-items:center!important;border-radius:999px!important;padding:4px 8px!important;font-size:11px!important;font-weight:900!important;}
@media(max-width:980px){
  .editor-properties-grid-v3843{grid-template-columns:1fr!important;gap:6px;}
  .editor-canvas-card-v38{min-height:560px!important;}
  .note-editor-v38{min-height:500px!important;}
}
@media(max-width:640px){
  .editor-canvas-card-v38{min-height:520px!important;}
  .note-editor-v38{min-height:460px!important;}
}
body.dark .editor-properties-grid-v3843 select,
body.dark .editor-properties-grid-v3843 input,
body.dark .property-tag-shell-v3843{background:var(--panel)!important;border-color:var(--border)!important;color:var(--text)!important;}


/* ===== v38.4.5 Notes blank hotfix + safe UI polish ===== */
.view-notes .main{display:grid!important;grid-template-rows:minmax(0,1fr)!important;height:100vh!important;min-height:0!important;overflow:hidden!important;}
.view-notes .compact-topbar,.view-notes .topbar.compact-topbar.editor-topbar-v384{display:none!important;}
.view-notes .content{padding:0!important;height:100%!important;min-height:0!important;overflow:hidden!important;}
.view-notes .content:has(.notes-workspace-v37){padding:0!important;}
.notes-workspace-v37.split{height:100%!important;min-height:0!important;width:100%!important;max-width:none!important;grid-template-columns:minmax(280px,330px) minmax(0,1fr)!important;gap:0!important;align-items:stretch!important;}
.notelist-collapsed .notes-workspace-v37.split{grid-template-columns:46px minmax(0,1fr)!important;}
.editor-layout-v38{min-height:0!important;overflow:hidden!important;}
.editor-inspector-v38{min-height:0!important;height:100%!important;max-height:100%!important;overflow-y:auto!important;overflow-x:hidden!important;padding-right:4px!important;scrollbar-width:thin!important;overscroll-behavior:contain!important;}
.editor-inspector-v38::-webkit-scrollbar{width:7px!important;}
.editor-inspector-v38::-webkit-scrollbar-thumb{background:#cbd5e1!important;border-radius:999px!important;}
.editor-inspector-v38::-webkit-scrollbar-track{background:transparent!important;}
.editor-side-tabs-v38{position:sticky!important;top:0!important;z-index:5!important;background:rgba(248,251,255,.94)!important;backdrop-filter:blur(10px)!important;margin-bottom:8px!important;}
body.dark .editor-side-tabs-v38{background:rgba(15,23,42,.94)!important;}
.note-summary-card-v38{order:0!important;}
.editor-properties-card-v3843{order:1!important;}
.editor-inspector-v38>.editor-side-card-v38:not(.note-summary-card-v38):not(.editor-properties-card-v3843){order:3!important;}
.editor-tab-strip-v384 .tab-row{gap:8px!important;}
.editor-tab-strip-v384 .note-tab{width:clamp(150px,18vw,240px)!important;min-width:150px!important;max-width:240px!important;justify-content:flex-start!important;}
.editor-tab-strip-v384 .note-tab-title{display:block!important;flex:1 1 auto!important;min-width:0!important;overflow:hidden!important;text-overflow:ellipsis!important;white-space:nowrap!important;text-align:left!important;}
.editor-tab-strip-v384 .note-tab.add-tab{width:36px!important;min-width:36px!important;max-width:36px!important;flex:0 0 36px!important;}
.note-list-final{background:#fff!important;border-right:1px solid #dce6f3!important;min-height:0!important;overflow:hidden!important;}
.note-list-head-v3845{padding:16px 14px 12px!important;align-items:flex-start!important;gap:10px!important;background:linear-gradient(180deg,#fff 0%,#f8fbff 100%)!important;}
.note-list-head-main-v3845{min-width:0!important;display:grid!important;gap:3px!important;}
.note-list-title-row-v3845{display:flex!important;align-items:center!important;gap:8px!important;min-width:0!important;}
.note-list-title-row-v3845 h2{margin:0!important;font-size:16px!important;line-height:1.2!important;letter-spacing:-.02em!important;min-width:0!important;overflow:hidden!important;text-overflow:ellipsis!important;white-space:nowrap!important;}
.note-list-icon-v3845{width:28px!important;height:28px!important;flex:0 0 28px!important;display:grid!important;place-items:center!important;border-radius:10px!important;background:#eff6ff!important;color:#1d4ed8!important;border:1px solid #dbeafe!important;}
.note-list-actions-v3845{display:flex!important;align-items:center!important;justify-content:flex-end!important;gap:5px!important;flex-wrap:wrap!important;max-width:112px!important;}
.note-list-actions-v3845 .icon,.note-list-actions-v3845 .danger{width:30px!important;height:30px!important;min-width:30px!important;padding:0!important;display:inline-grid!important;place-items:center!important;border-radius:10px!important;font-size:13px!important;}
.note-list-toolbar-v3845{padding:12px 12px!important;background:#f8fbff!important;}
.note-list-toolbar-v3845 .primary{height:38px!important;border-radius:12px!important;box-shadow:0 10px 22px rgba(37,99,235,.14)!important;}
.notes-list-v3845{padding:10px 10px 14px!important;background:#fff!important;overflow:auto!important;min-height:0!important;}
.note-row-v3845{min-height:86px!important;border:1px solid transparent!important;border-radius:16px!important;padding:12px!important;margin:0 0 8px!important;background:#fff!important;box-shadow:none!important;transition:background .15s ease,border-color .15s ease,box-shadow .15s ease,transform .15s ease!important;}
.note-row-v3845:hover{background:#f8fbff!important;border-color:#dbeafe!important;box-shadow:0 12px 26px rgba(15,23,42,.055)!important;transform:translateY(-1px)!important;}
.note-row-v3845.active{background:linear-gradient(180deg,#eff6ff,#f8fbff)!important;border-color:#93c5fd!important;box-shadow:0 14px 30px rgba(37,99,235,.13)!important;}
.note-row-v3845.dirty{border-color:#fbbf24!important;background:#fffbeb!important;}
.note-row-top-v3845{display:flex!important;align-items:center!important;justify-content:space-between!important;gap:8px!important;min-width:0!important;}
.note-row-top-v3845 b{display:block!important;min-width:0!important;overflow:hidden!important;text-overflow:ellipsis!important;white-space:nowrap!important;font-size:13px!important;line-height:1.25!important;color:#172033!important;}
.note-row-top-v3845 em{flex:0 0 auto!important;font-style:normal!important;border-radius:999px!important;padding:3px 7px!important;background:#eef2ff!important;color:#1d4ed8!important;font-size:9px!important;font-weight:900!important;letter-spacing:.03em!important;}
.note-row-v3845 small{display:block!important;margin-top:5px!important;font-size:10px!important;color:#64748b!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important;}
.note-preview-v3845{display:-webkit-box!important;-webkit-line-clamp:2!important;-webkit-box-orient:vertical!important;overflow:hidden!important;margin-top:7px!important;color:#64748b!important;line-height:1.45!important;font-size:11px!important;}
.notelist-collapsed .note-list-final{display:flex!important;width:46px!important;min-width:46px!important;max-width:46px!important;overflow:visible!important;background:#fff!important;border-right:1px solid #dce6f3!important;}
.notelist-collapsed .note-list-final .note-list-expanded-v384{display:none!important;}
.notelist-collapsed .note-list-final .collapsed-rail-v384{display:flex!important;width:46px!important;height:100%!important;align-items:flex-start!important;justify-content:center!important;gap:8px!important;padding:14px 6px!important;border:0!important;border-radius:0!important;background:#fff!important;color:var(--primary)!important;font-weight:900!important;box-shadow:none!important;writing-mode:vertical-rl!important;text-orientation:mixed!important;}
@media(max-width:980px){.view-notes .main{height:auto!important;overflow:visible!important}.view-notes .content{height:auto!important;overflow:visible!important}.notes-workspace-v37.split{height:auto!important;min-height:100vh!important;grid-template-columns:minmax(250px,300px) minmax(0,1fr)!important}.editor-inspector-v38{max-height:70vh!important}.editor-tab-strip-v384 .note-tab{min-width:132px!important;width:180px!important}}
@media(max-width:760px){.notes-workspace-v37.split{grid-template-columns:1fr!important}.note-list-final{max-height:300px!important}.notelist-collapsed .note-list-final{display:none!important}.editor-tab-strip-v384 .note-tab{min-width:124px!important;width:160px!important}}
body.dark .note-list-final,body.dark .notes-list-v3845,body.dark .note-row-v3845,body.dark .note-list-head-v3845,body.dark .note-list-toolbar-v3845{background:var(--panel)!important;}
body.dark .note-row-v3845.active{background:#1e293b!important;border-color:#2563eb!important;}
body.dark .note-row-top-v3845 b{color:var(--text)!important;}

/* ===== v38.4.6 Global UI polish + safer compact density ===== */
:root{
  --ui-density: .67;
  --compact-font: 11px;
  --compact-radius: 12px;
  --compact-gap: 8px;
}

/* Compact 67% density without using browser zoom/transform, to avoid click-offset bugs. */
html{font-size:11px!important;}
body{font-size:var(--compact-font)!important;}
button,input,select,textarea{font-size:11px!important;}
.primary,.secondary,.danger,.icon{border-radius:10px!important;padding:7px 10px!important;font-size:11px!important;}
input,select,textarea{border-radius:10px!important;padding:7px 9px!important;}
.shell{grid-template-columns:210px minmax(0,1fr)!important;}
.sidebar{padding:10px!important;gap:8px!important;}
.sidebar-head{gap:8px!important;padding-bottom:8px!important;}
.brand-logo.small{width:30px!important;height:30px!important;border-radius:10px!important;font-size:15px!important;}
.sidebar-title b{font-size:11px!important;line-height:1.15!important;}
.sidebar-title span{font-size:9px!important;}
.nav{gap:3px!important;}
.nav-btn{gap:7px!important;padding:7px 8px!important;border-radius:9px!important;font-size:11px!important;}
.side-title{font-size:9px!important;margin:9px 0 5px!important;}
.notebook-item{padding:7px 8px!important;border-radius:9px!important;font-size:11px!important;}
.content{padding:14px!important;}
.view-notes .content{padding:0!important;}
.card,.panel,.form-card{border-radius:14px!important;padding:14px!important;}
.topbar{padding:12px 16px!important;}
.topbar h1{font-size:18px!important;}
.home-grid{gap:10px!important;}
.stat-card{padding:12px!important;border-radius:14px!important;}
.stat-card strong{font-size:22px!important;}
.sidebar-collapsed{grid-template-columns:56px minmax(0,1fr)!important;}
.sidebar-collapsed .sidebar{padding:8px!important;}

/* Notes workspace density and roomier editor after top header removal. */
.notes-workspace-v37.split{grid-template-columns:minmax(220px,280px) minmax(0,1fr)!important;}
.notelist-collapsed .notes-workspace-v37.split{grid-template-columns:40px minmax(0,1fr)!important;}
.list-panel,.editor-panel{border-radius:14px!important;}
.editor-panel-topbar-v384{min-height:40px!important;padding:6px 10px!important;gap:10px!important;border-bottom:1px solid var(--border)!important;}
.editor-panel-body-v384{min-height:0!important;}
.editor-shell-v38{padding:10px!important;}
.editor-layout-v38{gap:10px!important;}
.editor-main-v38{padding:12px!important;border-radius:14px!important;}
.note-title-block-v38{margin-bottom:8px!important;}
.title-input-v38{font-size:20px!important;padding:4px 2px 8px!important;}
.editor-canvas-card-v38{border:1px solid var(--border)!important;border-radius:14px!important;overflow:hidden!important;background:var(--panel)!important;display:flex!important;flex-direction:column!important;min-height:calc(100vh - 150px)!important;}
.note-editor-v38{border:0!important;border-bottom:1px solid var(--border)!important;border-radius:0!important;min-height:calc(100vh - 200px)!important;padding:20px 22px!important;flex:1 1 auto!important;}
.note-editor-v38.editing{border-bottom:1px solid var(--border)!important;outline:0!important;box-shadow:inset 0 0 0 2px rgba(37,99,235,.13)!important;}
.editor-footer-v38{min-height:26px!important;display:flex!important;align-items:center!important;gap:12px!important;padding:6px 10px!important;border-top:0!important;background:var(--panel)!important;color:var(--muted)!important;font-size:10px!important;}
.editor-footer-v38 b{margin-left:auto!important;font-size:10px!important;}
.rich-toolbar-v38{max-height:none!important;min-height:0!important;height:auto!important;overflow:visible!important;padding:6px!important;gap:5px!important;border-radius:12px!important;margin-bottom:8px!important;}
.rich-toolbar-v38 button,.rich-toolbar-v38 select,.rich-toolbar-v38 .color-tool{height:28px!important;min-height:28px!important;padding:5px 7px!important;font-size:10px!important;border-radius:8px!important;}

/* Multi-tab: bigger readable titles, professional spacing, still scrolls horizontally. */
.editor-tab-strip-v384 .workspace-tabs,
.editor-tab-strip-v384 .workspace-tabs-v383{display:block!important;width:100%!important;min-width:0!important;}
.editor-tab-strip-v384 .tab-row{gap:8px!important;align-items:center!important;overflow-x:auto!important;overflow-y:hidden!important;padding:2px 0!important;scrollbar-width:thin!important;}
.editor-tab-strip-v384 .note-tab{
  width:clamp(190px,18vw,280px)!important;
  min-width:190px!important;
  max-width:280px!important;
  height:30px!important;
  border-radius:12px!important;
  padding:0 8px 0 12px!important;
  font-size:12px!important;
  font-weight:900!important;
  display:inline-flex!important;
  align-items:center!important;
  gap:8px!important;
  border:1px solid #d9e5f4!important;
  background:#fff!important;
  color:#172033!important;
}
.editor-tab-strip-v384 .note-tab-title{font-size:12px!important;line-height:1!important;letter-spacing:-.01em!important;}
.editor-tab-strip-v384 .note-tab.active{background:#dbeafe!important;border-color:#93c5fd!important;color:#1d4ed8!important;box-shadow:0 8px 18px rgba(37,99,235,.12)!important;}
.editor-tab-strip-v384 .note-tab-close{width:18px!important;height:18px!important;min-width:18px!important;border-radius:999px!important;font-size:12px!important;display:grid!important;place-items:center!important;background:#eef2f7!important;color:#64748b!important;}
.editor-tab-strip-v384 .note-tab.add-tab{width:32px!important;min-width:32px!important;max-width:32px!important;height:30px!important;font-size:16px!important;padding:0!important;justify-content:center!important;}

/* Right inspector: internal scroll and proper order. */
.editor-inspector-v38{max-width:250px!important;min-width:220px!important;height:100%!important;max-height:100%!important;overflow-y:auto!important;overflow-x:hidden!important;padding-right:4px!important;}
.note-summary-card-v38{order:0!important;}
.editor-properties-card-v3843{order:1!important;}
.editor-inspector-v38>.editor-side-card-v38:not(.note-summary-card-v38):not(.editor-properties-card-v3843){order:3!important;}
.editor-side-card-v38{border-radius:14px!important;padding:12px!important;}
.editor-side-tabs-v38{border-radius:14px!important;padding:5px!important;}
.editor-side-tabs-v38 button{min-height:28px!important;font-size:10px!important;border-radius:9px!important;}
.note-summary-grid-v38{grid-template-columns:58px minmax(0,1fr)!important;gap:5px 8px!important;font-size:10px!important;}
.status-badge-v38{font-size:10px!important;padding:3px 7px!important;}

/* Notebook header redesign: spacious card concept, professional actions, light/dark ready. */
.notebook-card-head-v3846{
  padding:10px!important;
  background:linear-gradient(180deg,#f8fbff 0%,#fff 100%)!important;
  border-bottom:1px solid #dbe5f2!important;
  display:block!important;
}
.notebook-card-main-v3846{
  display:grid!important;
  gap:12px!important;
  width:100%!important;
  padding:12px!important;
  border:1px solid #dbe7f6!important;
  border-radius:16px!important;
  background:#fff!important;
  box-shadow:0 12px 28px rgba(15,23,42,.06)!important;
}
.notebook-card-title-line-v3846{display:flex!important;align-items:flex-start!important;gap:10px!important;min-width:0!important;}
.notebook-card-icon-v3846{
  width:34px!important;height:34px!important;flex:0 0 34px!important;
  display:grid!important;place-items:center!important;border-radius:12px!important;
  background:linear-gradient(135deg,#eff6ff,#dbeafe)!important;border:1px solid #bfdbfe!important;color:#1d4ed8!important;font-size:16px!important;
}
.notebook-card-title-v3846{min-width:0!important;display:grid!important;gap:2px!important;flex:1 1 auto!important;}
.notebook-card-title-v3846 h2{margin:0!important;font-size:14px!important;line-height:1.25!important;letter-spacing:-.02em!important;overflow:hidden!important;text-overflow:ellipsis!important;white-space:nowrap!important;}
.notebook-card-title-v3846 small{color:#64748b!important;font-size:10px!important;font-weight:800!important;}
.notebook-category-badge-v3846{flex:0 0 auto!important;border-radius:999px!important;padding:5px 8px!important;font-size:9px!important;font-weight:950!important;letter-spacing:.05em!important;background:#e0e7ff!important;color:#3730a3!important;}
.notebook-category-badge-v3846.private,.notebook-category-badge-v3846.pribadi{background:#fef3c7!important;color:#92400e!important;}
.notebook-category-badge-v3846.public,.notebook-category-badge-v3846.publik{background:#dcfce7!important;color:#166534!important;}
.notebook-category-badge-v3846.admin{background:#e0e7ff!important;color:#3730a3!important;}
.notebook-card-actions-v3846{display:grid!important;grid-template-columns:repeat(4,minmax(0,1fr))!important;gap:6px!important;}
.notebook-action-btn-v3846{
  min-width:0!important;height:34px!important;border-radius:11px!important;border:1px solid #dbe7f6!important;
  background:#f8fbff!important;color:#334155!important;display:flex!important;align-items:center!important;justify-content:center!important;gap:4px!important;
  font-size:11px!important;font-weight:900!important;padding:0 6px!important;
}
.notebook-action-btn-v3846 span{font-size:9px!important;font-weight:900!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important;}
.notebook-action-btn-v3846:hover{background:#eff6ff!important;border-color:#bfdbfe!important;color:#1d4ed8!important;}
.notebook-action-btn-v3846.danger-action-v3846{color:#991b1b!important;background:#fff7f7!important;border-color:#fecaca!important;}
.notebook-action-btn-v3846.danger-action-v3846:hover{background:#ef4444!important;color:#fff!important;border-color:#ef4444!important;}
.note-list-toolbar-v3845{padding:10px!important;background:#f8fbff!important;}
.notes-list-v3845{padding:10px!important;}

/* Note list refined cards, compact but readable. */
.note-row-v3845{min-height:74px!important;border-radius:14px!important;padding:10px!important;margin-bottom:7px!important;}
.note-row-top-v3845 b{font-size:12px!important;}
.note-preview-v3845{font-size:10px!important;}

/* Dark mode support for new notebook card and editor border. */
body.dark .notebook-card-head-v3846{background:linear-gradient(180deg,#101827,#0f172a)!important;border-color:var(--border)!important;}
body.dark .notebook-card-main-v3846{background:var(--panel)!important;border-color:var(--border)!important;box-shadow:0 16px 34px rgba(0,0,0,.24)!important;}
body.dark .notebook-card-icon-v3846{background:#1e293b!important;border-color:#334155!important;color:#93c5fd!important;}
body.dark .notebook-action-btn-v3846{background:#172033!important;border-color:#263244!important;color:#e5e7eb!important;}
body.dark .notebook-action-btn-v3846:hover{background:#1e3a8a!important;border-color:#2563eb!important;color:#dbeafe!important;}
body.dark .notebook-action-btn-v3846.danger-action-v3846{background:#2a1114!important;border-color:#7f1d1d!important;color:#fca5a5!important;}
body.dark .note-editor-v38{border-bottom-color:var(--border)!important;}
body.dark .editor-footer-v38{background:var(--panel)!important;}
body.dark .editor-tab-strip-v384 .note-tab{background:var(--panel)!important;border-color:var(--border)!important;color:var(--text)!important;}
body.dark .editor-tab-strip-v384 .note-tab-close{background:#1f2937!important;color:#cbd5e1!important;}

@media(max-width:1200px){
  .shell{grid-template-columns:190px minmax(0,1fr)!important;}
  .notes-workspace-v37.split{grid-template-columns:minmax(210px,260px) minmax(0,1fr)!important;}
  .editor-tab-strip-v384 .note-tab{min-width:170px!important;width:200px!important;}
  .editor-inspector-v38{max-width:230px!important;min-width:210px!important;}
}
@media(max-width:980px){
  html{font-size:12px!important;} body{font-size:12px!important;}
  .shell{display:block!important;height:auto!important;}
  .notes-workspace-v37.split{grid-template-columns:1fr!important;}
  .editor-inspector-v38{max-width:none!important;width:100%!important;max-height:70vh!important;}
  .editor-canvas-card-v38{min-height:520px!important;}
  .note-editor-v38{min-height:460px!important;}
  .notebook-card-actions-v3846{grid-template-columns:repeat(2,minmax(0,1fr))!important;}
}

/* ===== v38.4.7 Global layout + professional UI correction =====
   Focus: sidebar/main overlap, compact density, notebook card, editor frame, right panel alignment, readable auto tabs. */
:root{
  --shell-sidebar-w:176px;
  --shell-sidebar-w-collapsed:54px;
  --page-gap:10px;
  --ui-font:10px;
  --ui-font-sm:9px;
  --ui-radius:10px;
  --ui-border:#d9e3f1;
}
html{font-size:10px!important;}
body{font-size:var(--ui-font)!important;overflow:hidden!important;}
button,input,select,textarea{font-size:10px!important;}
.primary,.secondary,.danger,.icon{padding:6px 8px!important;border-radius:9px!important;font-size:10px!important;min-height:28px!important;}
input,select,textarea{padding:6px 8px!important;border-radius:9px!important;min-height:28px!important;}

/* Hard global app shell fix: never allow any page to slide under the sidebar. */
.shell{
  width:100vw!important;
  height:100vh!important;
  display:grid!important;
  grid-template-columns:var(--shell-sidebar-w) minmax(0,1fr)!important;
  overflow:hidden!important;
  background:var(--bg)!important;
}
.shell.sidebar-collapsed{grid-template-columns:var(--shell-sidebar-w-collapsed) minmax(0,1fr)!important;}
.sidebar{grid-column:1!important;grid-row:1!important;width:auto!important;min-width:0!important;height:100vh!important;overflow:hidden!important;padding:8px!important;gap:7px!important;z-index:30!important;}
.main{grid-column:2!important;grid-row:1!important;min-width:0!important;width:100%!important;height:100vh!important;overflow:auto!important;position:relative!important;margin:0!important;padding:0!important;}
.content{padding:10px!important;min-width:0!important;width:100%!important;max-width:none!important;}
.topbar{padding:9px 12px!important;min-height:44px!important;}
.topbar h1{font-size:16px!important;line-height:1.1!important;}
.topbar p{font-size:10px!important;margin-top:2px!important;}

.sidebar-head{gap:7px!important;padding-bottom:7px!important;}
.brand-logo.small{width:28px!important;height:28px!important;border-radius:9px!important;font-size:14px!important;}
.sidebar-title b{font-size:10px!important;}
.sidebar-title span{font-size:8.5px!important;}
.nav{gap:2px!important;}
.nav-btn{padding:6px 7px!important;gap:7px!important;border-radius:8px!important;font-size:10px!important;min-height:28px!important;}
.side-title{font-size:8.5px!important;margin:8px 0 4px!important;letter-spacing:.11em!important;}
.notebook-item{padding:6px 7px!important;border-radius:8px!important;font-size:10px!important;min-height:27px!important;}
.notebook-item small{padding:2px 6px!important;font-size:9px!important;}
.sidebar .primary.full,.sidebar .secondary.full{height:28px!important;padding:5px 8px!important;font-size:10px!important;border-radius:9px!important;}

/* Dashboard/global pages compact and no overlap. */
.dashboard-wrap{gap:10px!important;min-width:0!important;}
.dashboard-hero{padding:12px 14px!important;border-radius:14px!important;min-width:0!important;}
.dashboard-hero h2{font-size:18px!important;margin-bottom:4px!important;}
.dashboard-hero p,.dashboard-wrap p{font-size:10px!important;}
.dashboard-stats{grid-template-columns:repeat(6,minmax(110px,1fr))!important;gap:8px!important;min-width:0!important;}
.dashboard-stat,.stat-card,.card,.panel,.form-card{padding:10px!important;border-radius:12px!important;min-width:0!important;}
.dashboard-stat h3,.dashboard-stat span{font-size:10px!important;}
.stat-card strong,.dashboard-stat strong{font-size:20px!important;line-height:1.1!important;}
.dashboard-grid{gap:10px!important;min-width:0!important;}
.note-grid{grid-template-columns:repeat(auto-fill,minmax(170px,1fr))!important;gap:8px!important;}
.note-card{min-height:100px!important;padding:10px!important;border-radius:12px!important;}
.note-card h3{font-size:13px!important;margin-bottom:5px!important;}
.note-card p{font-size:10px!important;line-height:1.35!important;}
.note-card span{font-size:9px!important;margin-top:6px!important;}
.home-grid{gap:8px!important;}

/* Notes workspace: consume full main area but never overlap sidebar. */
.view-notes .topbar,.view-notes .compact-topbar,.view-notes .topbar.compact-topbar.editor-topbar-v384{display:none!important;}
.view-notes .main{display:block!important;height:100vh!important;overflow:hidden!important;}
.view-notes .content{height:100vh!important;overflow:hidden!important;padding:0!important;}
.notes-workspace-v37.split{
  display:grid!important;
  grid-template-columns:minmax(215px,245px) minmax(0,1fr)!important;
  gap:0!important;
  width:100%!important;
  height:100vh!important;
  min-height:0!important;
  max-width:none!important;
  align-items:stretch!important;
}
.notelist-collapsed .notes-workspace-v37.split{grid-template-columns:38px minmax(0,1fr)!important;}
.note-list-final{height:100%!important;min-height:0!important;overflow:hidden!important;border-radius:0!important;border-top:0!important;border-bottom:0!important;border-left:0!important;}
.editor-panel.editor-final{height:100%!important;min-height:0!important;border-radius:0!important;border-top:0!important;border-bottom:0!important;border-right:0!important;padding:8px!important;background:#f6f9fd!important;}
.editor-panel-topbar-v384{display:grid!important;grid-template-columns:minmax(0,1fr) auto!important;align-items:center!important;gap:10px!important;padding:0 0 8px!important;min-width:0!important;}
.editor-panel-body-v384{height:calc(100% - 38px)!important;min-height:0!important;overflow:hidden!important;}
.editor-shell-v38{height:100%!important;min-height:0!important;padding:0!important;width:100%!important;max-width:none!important;}
.editor-layout-v38{
  width:100%!important;
  height:100%!important;
  min-height:0!important;
  max-width:none!important;
  display:grid!important;
  grid-template-columns:minmax(0,1fr) clamp(250px,18vw,315px)!important;
  gap:10px!important;
  align-items:stretch!important;
  overflow:hidden!important;
}
.editor-main-v38{height:100%!important;min-height:0!important;min-width:0!important;padding:10px!important;border-radius:12px!important;overflow:hidden!important;display:flex!important;flex-direction:column!important;}
.editor-inspector-v38{justify-self:stretch!important;align-self:stretch!important;width:100%!important;max-width:none!important;min-width:0!important;height:100%!important;max-height:100%!important;overflow-y:auto!important;overflow-x:hidden!important;padding:0 4px 0 0!important;display:flex!important;flex-direction:column!important;gap:8px!important;}
.editor-inspector-v38::-webkit-scrollbar{width:6px!important;}
.editor-inspector-v38::-webkit-scrollbar-thumb{background:#c5cfdb!important;border-radius:999px!important;}
.editor-side-card-v38{padding:10px!important;border-radius:12px!important;box-shadow:0 8px 20px rgba(15,23,42,.05)!important;}
.editor-side-tabs-v38{border-radius:12px!important;gap:4px!important;padding:4px!important;}
.editor-side-tabs-v38 button{min-height:26px!important;height:26px!important;font-size:9px!important;border-radius:8px!important;padding:4px 6px!important;}

/* Multi-tabs: auto width from title, readable text. */
.editor-tab-strip-v384{min-width:0!important;overflow:hidden!important;}
.editor-tab-strip-v384 .workspace-tabs,
.editor-tab-strip-v384 .workspace-tabs-v383{display:block!important;width:100%!important;min-width:0!important;}
.editor-tab-strip-v384 .tab-row{display:flex!important;align-items:center!important;gap:6px!important;overflow-x:auto!important;overflow-y:hidden!important;padding:1px 0 3px!important;scrollbar-width:thin!important;}
.editor-tab-strip-v384 .note-tab{
  flex:0 0 auto!important;
  width:auto!important;
  min-width:92px!important;
  max-width:260px!important;
  height:30px!important;
  padding:0 7px 0 10px!important;
  border-radius:12px!important;
  font-size:12px!important;
  font-weight:900!important;
  gap:8px!important;
  background:#fff!important;
  border:1px solid #dbe6f4!important;
  color:#142033!important;
}
.editor-tab-strip-v384 .note-tab-title{display:block!important;flex:0 1 auto!important;min-width:0!important;max-width:210px!important;font-size:12px!important;line-height:1!important;overflow:hidden!important;text-overflow:ellipsis!important;white-space:nowrap!important;text-align:left!important;}
.editor-tab-strip-v384 .note-tab.active{background:#dcecff!important;border-color:#8bbcff!important;color:#174ea6!important;box-shadow:0 6px 16px rgba(37,99,235,.12)!important;}
.editor-tab-strip-v384 .note-tab-close{flex:0 0 18px!important;width:18px!important;height:18px!important;min-width:18px!important;border-radius:999px!important;background:#eef2f7!important;color:#64748b!important;font-size:12px!important;padding:0!important;}
.editor-tab-strip-v384 .note-tab.add-tab{width:30px!important;min-width:30px!important;max-width:30px!important;height:30px!important;padding:0!important;font-size:16px!important;justify-content:center!important;}

/* Action buttons remain on top right and More is anchored to its button. */
.editor-action-strip-v384{justify-self:end!important;min-width:0!important;}
.editor-command-bar-v38{display:flex!important;align-items:center!important;justify-content:flex-end!important;gap:6px!important;margin:0!important;overflow:visible!important;}
.editor-command-right-v38{display:flex!important;justify-content:flex-end!important;align-items:center!important;gap:6px!important;overflow:visible!important;}
.editor-command-right-v38>button,.note-more-menu-v38>summary{height:30px!important;min-height:30px!important;padding:0 10px!important;border-radius:10px!important;font-size:10px!important;}
.note-more-menu-v38{position:relative!important;}
.note-more-menu-v38[open] .note-more-dropdown-v38,.note-more-dropdown-v38{position:absolute!important;top:calc(100% + 6px)!important;right:0!important;left:auto!important;width:210px!important;z-index:9999!important;max-height:min(360px,calc(100vh - 72px))!important;overflow:auto!important;background:var(--panel)!important;border:1px solid var(--border)!important;border-radius:12px!important;box-shadow:0 18px 42px rgba(15,23,42,.18)!important;padding:8px!important;}
.note-more-dropdown-v38 button{height:28px!important;border-radius:9px!important;font-size:10px!important;}

/* Editor field: same complete frame in read and edit mode. */
.editor-canvas-card-v38{border:1px solid var(--border)!important;border-radius:12px!important;background:var(--panel)!important;overflow:hidden!important;display:flex!important;flex-direction:column!important;min-height:0!important;flex:1 1 auto!important;}
.note-editor-v38{flex:1 1 auto!important;min-height:0!important;height:auto!important;border:0!important;border-bottom:1px solid var(--border)!important;border-radius:0!important;background:var(--panel)!important;padding:18px 20px!important;overflow:auto!important;font-size:12px!important;line-height:1.6!important;}
.note-editor-v38.editing{border-bottom:1px solid var(--border)!important;box-shadow:inset 0 0 0 1px rgba(37,99,235,.20)!important;outline:0!important;}
.editor-footer-v38{flex:0 0 auto!important;min-height:25px!important;border-top:0!important;background:var(--panel)!important;padding:6px 9px!important;display:flex!important;align-items:center!important;gap:10px!important;font-size:9px!important;color:var(--muted)!important;}
.editor-footer-v38 b{margin-left:auto!important;font-size:9px!important;}
.title-input-v38{font-size:18px!important;padding-bottom:7px!important;}
.rich-toolbar-v38{padding:5px!important;gap:4px!important;max-height:none!important;overflow:visible!important;border-radius:10px!important;margin-bottom:6px!important;}
.rich-toolbar-v38 button,.rich-toolbar-v38 select,.rich-toolbar-v38 .color-tool{height:25px!important;min-height:25px!important;padding:4px 6px!important;font-size:9px!important;border-radius:7px!important;}

/* Notebook header: professional card, neutral icon theme, readable actions. */
.notebook-card-head-v3846{padding:8px!important;background:linear-gradient(180deg,#f8fbff 0%,#fff 100%)!important;border-bottom:1px solid #dbe5f2!important;display:block!important;}
.notebook-card-main-v3846{display:grid!important;gap:10px!important;padding:12px!important;border:1px solid #dbe6f4!important;border-radius:14px!important;background:#fff!important;box-shadow:0 8px 20px rgba(15,23,42,.055)!important;}
.notebook-card-title-line-v3846{display:flex!important;align-items:flex-start!important;gap:9px!important;}
.notebook-card-icon-v3846{width:30px!important;height:30px!important;flex:0 0 30px!important;border-radius:10px!important;background:#f4f7fb!important;border:1px solid #dbe6f4!important;color:#334155!important;font-size:15px!important;font-weight:900!important;display:grid!important;place-items:center!important;}
.notebook-card-title-v3846 h2{font-size:13px!important;line-height:1.2!important;margin:0!important;color:#142033!important;}
.notebook-card-title-v3846 small{font-size:9.5px!important;color:#64748b!important;font-weight:800!important;}
.notebook-category-badge-v3846{padding:4px 8px!important;border-radius:999px!important;background:#eef2ff!important;color:#334155!important;border:1px solid #dbe2f1!important;font-size:8.5px!important;letter-spacing:.05em!important;}
.notebook-category-badge-v3846.private,.notebook-category-badge-v3846.pribadi,.notebook-category-badge-v3846.public,.notebook-category-badge-v3846.publik,.notebook-category-badge-v3846.admin{background:#eef2ff!important;color:#334155!important;border-color:#dbe2f1!important;}
.notebook-card-actions-v3846{display:grid!important;grid-template-columns:repeat(4,minmax(0,1fr))!important;gap:6px!important;}
.notebook-action-btn-v3846{height:31px!important;min-width:0!important;border-radius:10px!important;border:1px solid #dbe6f4!important;background:#f8fbff!important;color:#334155!important;display:flex!important;align-items:center!important;justify-content:center!important;gap:5px!important;padding:0 6px!important;font-size:10px!important;font-weight:850!important;}
.notebook-action-btn-v3846 .nb-action-symbol{font-size:12px!important;font-weight:900!important;line-height:1!important;color:currentColor!important;}
.notebook-action-btn-v3846 span:not(.nb-action-symbol){font-size:9px!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important;}
.notebook-action-btn-v3846:hover{background:#eef5ff!important;border-color:#b9d3f8!important;color:#1e40af!important;}
.notebook-action-btn-v3846.danger-action-v3846{background:#fff!important;color:#7f1d1d!important;border-color:#e5d4d4!important;}
.notebook-action-btn-v3846.danger-action-v3846:hover{background:#fee2e2!important;color:#991b1b!important;border-color:#fecaca!important;}

/* Note list remains compact. */
.note-list-toolbar-v3845{padding:8px!important;}
.notes-list-v3845{padding:8px!important;}
.note-row-v3845{min-height:66px!important;padding:9px!important;margin-bottom:6px!important;border-radius:12px!important;}
.note-row-top-v3845 b{font-size:11px!important;}
.note-row-v3845 small,.note-preview-v3845{font-size:9px!important;}

body.dark .editor-panel.editor-final{background:#0f172a!important;}
body.dark .notebook-card-main-v3846,body.dark .editor-main-v38,body.dark .editor-canvas-card-v38,body.dark .note-editor-v38,body.dark .editor-footer-v38,body.dark .editor-side-card-v38,body.dark .editor-side-tabs-v38,body.dark .editor-tab-strip-v384 .note-tab{background:var(--panel)!important;border-color:var(--border)!important;color:var(--text)!important;}
body.dark .notebook-card-icon-v3846{background:#172033!important;border-color:#263244!important;color:#cbd5e1!important;}
body.dark .notebook-category-badge-v3846{background:#172033!important;border-color:#263244!important;color:#d1d5db!important;}
body.dark .notebook-action-btn-v3846{background:#172033!important;border-color:#263244!important;color:#d1d5db!important;}
body.dark .notebook-action-btn-v3846:hover{background:#1e293b!important;color:#bfdbfe!important;}
body.dark .notebook-action-btn-v3846.danger-action-v3846{background:#1f1517!important;border-color:#3f2226!important;color:#fca5a5!important;}

@media(max-width:1280px){
  :root{--shell-sidebar-w:165px;--shell-sidebar-w-collapsed:52px;}
  .dashboard-stats{grid-template-columns:repeat(3,minmax(120px,1fr))!important;}
  .dashboard-grid{grid-template-columns:1fr!important;}
  .notes-workspace-v37.split{grid-template-columns:minmax(200px,230px) minmax(0,1fr)!important;}
  .editor-layout-v38{grid-template-columns:minmax(0,1fr) 245px!important;}
  .editor-tab-strip-v384 .note-tab{max-width:220px!important;}
  .editor-tab-strip-v384 .note-tab-title{max-width:170px!important;}
}
@media(max-width:980px){
  body{overflow:auto!important;}
  .shell{display:block!important;height:auto!important;overflow:visible!important;}
  .sidebar{height:auto!important;max-height:none!important;}
  .main{height:auto!important;overflow:visible!important;}
  .content{padding:10px!important;}
  .view-notes .main,.view-notes .content{height:auto!important;overflow:visible!important;}
  .notes-workspace-v37.split{height:auto!important;min-height:100vh!important;grid-template-columns:1fr!important;}
  .editor-panel-topbar-v384{grid-template-columns:1fr!important;}
  .editor-action-strip-v384{justify-self:start!important;}
  .editor-layout-v38{display:flex!important;flex-direction:column!important;overflow:visible!important;}
  .editor-inspector-v38{max-height:70vh!important;width:100%!important;}
  .dashboard-stats{grid-template-columns:repeat(2,minmax(120px,1fr))!important;}
}

/* ===== v38.4.8 Final density + editor workspace polish =====
   Scope: make global UI ~15% tighter, use remaining vertical space, icon-only notebook actions,
   and make note tabs size naturally from their titles. CSS-only/safe layout overrides. */
:root{
  --shell-sidebar-w:150px!important;
  --shell-sidebar-w-collapsed:48px!important;
  --ui-font:8.6px!important;
  --ui-font-sm:8px!important;
  --ui-radius:8px!important;
  --v3848-row:24px;
}
html{font-size:8.6px!important;}
body{font-size:var(--ui-font)!important;}
button,input,select,textarea{font-size:8.6px!important;}
.primary,.secondary,.danger,.icon{padding:4px 7px!important;border-radius:8px!important;font-size:8.6px!important;min-height:24px!important;line-height:1.15!important;}
input,select,textarea{padding:4px 7px!important;border-radius:8px!important;min-height:24px!important;}
.card,.panel,.form-card,.stat-card,.dashboard-stat{border-radius:10px!important;padding:8px!important;}
.topbar{padding:7px 10px!important;min-height:38px!important;}
.topbar h1{font-size:14px!important;}
.topbar p{font-size:8.5px!important;}
.content{padding:8px!important;}
.sidebar{padding:7px!important;gap:5px!important;}
.sidebar-head{gap:6px!important;padding-bottom:6px!important;}
.brand-logo.small{width:24px!important;height:24px!important;border-radius:8px!important;font-size:12px!important;}
.sidebar-title b{font-size:9px!important;}
.sidebar-title span{font-size:7.5px!important;}
.nav-btn{padding:5px 6px!important;gap:6px!important;min-height:25px!important;border-radius:7px!important;font-size:8.8px!important;}
.side-title{font-size:7.5px!important;margin:6px 0 3px!important;}
.notebook-item{padding:5px 6px!important;min-height:24px!important;border-radius:7px!important;font-size:8.6px!important;}
.notebook-item small{font-size:7.6px!important;padding:1px 5px!important;}
.sidebar .primary.full,.sidebar .secondary.full{height:25px!important;min-height:25px!important;font-size:8.8px!important;border-radius:8px!important;}
.dashboard-hero{padding:10px 12px!important;border-radius:12px!important;}
.dashboard-hero h2{font-size:16px!important;}
.dashboard-hero p,.dashboard-wrap p{font-size:8.6px!important;}
.dashboard-stats{gap:7px!important;grid-template-columns:repeat(6,minmax(92px,1fr))!important;}
.stat-card strong,.dashboard-stat strong{font-size:17px!important;}
.note-grid{grid-template-columns:repeat(auto-fill,minmax(145px,1fr))!important;gap:7px!important;}
.note-card{min-height:84px!important;padding:8px!important;border-radius:10px!important;}
.note-card h3{font-size:11px!important;}
.note-card p{font-size:8.5px!important;}
.note-card span{font-size:7.6px!important;}

/* Notes workspace: no wasted bottom space; editor and right panel use the full viewport height. */
.view-notes .main,.view-notes .content{height:100vh!important;max-height:100vh!important;overflow:hidden!important;}
.notes-workspace-v37.split{height:100vh!important;max-height:100vh!important;grid-template-columns:minmax(185px,220px) minmax(0,1fr)!important;}
.notelist-collapsed .notes-workspace-v37.split{grid-template-columns:34px minmax(0,1fr)!important;}
.editor-panel.editor-final{height:100vh!important;max-height:100vh!important;padding:6px!important;overflow:hidden!important;}
.editor-panel-topbar-v384{min-height:30px!important;height:30px!important;padding:0 0 5px!important;gap:7px!important;}
.editor-panel-body-v384{height:calc(100vh - 36px)!important;min-height:0!important;overflow:hidden!important;}
.editor-shell-v38,.editor-layout-v38{height:100%!important;max-height:100%!important;min-height:0!important;overflow:hidden!important;}
.editor-layout-v38{grid-template-columns:minmax(0,1fr) clamp(220px,17vw,285px)!important;gap:8px!important;}
.editor-main-v38{height:100%!important;min-height:0!important;padding:8px!important;border-radius:10px!important;display:flex!important;flex-direction:column!important;overflow:hidden!important;}
.note-title-block-v38{flex:0 0 auto!important;}
.title-input-v38{font-size:15.5px!important;padding:2px 2px 5px!important;min-height:26px!important;}
.rich-toolbar-v38{flex:0 0 auto!important;padding:4px!important;gap:3px!important;margin-bottom:5px!important;border-radius:8px!important;}
.rich-toolbar-v38 button,.rich-toolbar-v38 select,.rich-toolbar-v38 .color-tool{height:22px!important;min-height:22px!important;padding:3px 5px!important;font-size:7.8px!important;border-radius:6px!important;}
.editor-canvas-card-v38{flex:1 1 auto!important;min-height:0!important;height:auto!important;border:1px solid var(--border)!important;border-radius:10px!important;overflow:hidden!important;display:flex!important;flex-direction:column!important;background:var(--panel)!important;}
.note-editor-v38{flex:1 1 auto!important;min-height:0!important;height:auto!important;border:0!important;border-bottom:1px solid var(--border)!important;border-radius:0!important;padding:13px 15px!important;font-size:10.5px!important;line-height:1.55!important;overflow:auto!important;}
.note-editor-v38.editing{border-bottom:1px solid var(--border)!important;box-shadow:inset 0 0 0 1px rgba(37,99,235,.18)!important;outline:0!important;}
.editor-footer-v38{flex:0 0 22px!important;min-height:22px!important;height:22px!important;padding:4px 7px!important;font-size:7.8px!important;border-top:0!important;display:flex!important;align-items:center!important;gap:8px!important;background:var(--panel)!important;}
.editor-footer-v38 b{margin-left:auto!important;font-size:7.8px!important;}
.editor-inspector-v38{height:100%!important;max-height:100%!important;align-self:stretch!important;overflow-y:auto!important;overflow-x:hidden!important;padding:0 3px 0 0!important;gap:6px!important;}
.editor-side-card-v38{padding:8px!important;border-radius:10px!important;}
.editor-side-tabs-v38{padding:3px!important;border-radius:10px!important;gap:3px!important;}
.editor-side-tabs-v38 button{height:23px!important;min-height:23px!important;font-size:7.8px!important;padding:3px 5px!important;border-radius:7px!important;}
.side-card-head-v38 h3,.editor-side-card-v38 h3{font-size:10px!important;}
.note-summary-grid-v38,.editor-properties-grid-v3843{font-size:8.3px!important;gap:6px!important;}
.editor-properties-grid-v3843 select,.editor-properties-grid-v3843 input,.compact-form-v38 input,.compact-form-v38 select{height:24px!important;min-height:24px!important;font-size:8px!important;}

/* Notebook header: use icon-only actions, neutral/professional style. */
.notebook-card-head-v3846{padding:6px!important;}
.notebook-card-main-v3846{gap:8px!important;padding:10px!important;border-radius:12px!important;}
.notebook-card-title-line-v3846{gap:8px!important;align-items:flex-start!important;}
.notebook-card-icon-v3846{width:25px!important;height:25px!important;flex-basis:25px!important;border-radius:8px!important;font-size:12px!important;background:#f8fafc!important;color:#334155!important;border-color:#dbe6f4!important;}
.notebook-card-title-v3846 h2{font-size:11px!important;}
.notebook-card-title-v3846 small{font-size:8px!important;}
.notebook-category-badge-v3846{font-size:7.5px!important;padding:3px 7px!important;}
.notebook-card-actions-v3846{display:flex!important;align-items:center!important;justify-content:flex-start!important;gap:6px!important;}
.notebook-action-btn-v3846{width:28px!important;height:28px!important;min-width:28px!important;max-width:28px!important;padding:0!important;border-radius:9px!important;display:inline-grid!important;place-items:center!important;background:#fff!important;border:1px solid #dbe6f4!important;color:#334155!important;}
.notebook-action-btn-v3846 .nb-action-symbol{font-size:12px!important;line-height:1!important;color:currentColor!important;}
.notebook-action-btn-v3846 span:not(.nb-action-symbol){display:none!important;}
.notebook-action-btn-v3846:hover{background:#f1f5f9!important;border-color:#cbd5e1!important;color:#0f172a!important;}
.notebook-action-btn-v3846.danger-action-v3846{background:#fff!important;color:#991b1b!important;border-color:#ead4d4!important;}
.notebook-action-btn-v3846.danger-action-v3846:hover{background:#fee2e2!important;color:#7f1d1d!important;border-color:#fecaca!important;}
body.dark .notebook-action-btn-v3846{background:#111827!important;border-color:#263244!important;color:#d1d5db!important;}
body.dark .notebook-action-btn-v3846:hover{background:#1f2937!important;color:#f8fafc!important;}
body.dark .notebook-action-btn-v3846.danger-action-v3846{background:#1f1517!important;border-color:#3f2226!important;color:#fca5a5!important;}

/* Multi-tab: tab width follows title length; title must not collapse to U... / c... */
.editor-tab-strip-v384{min-width:0!important;overflow:hidden!important;}
.editor-tab-strip-v384 .tab-row{display:flex!important;align-items:center!important;gap:5px!important;overflow-x:auto!important;overflow-y:hidden!important;padding:0 0 2px!important;}
.editor-tab-strip-v384 .note-tab:not(.add-tab){
  flex:0 0 auto!important;
  display:inline-flex!important;
  align-items:center!important;
  justify-content:flex-start!important;
  width:auto!important;
  min-width:fit-content!important;
  max-width:230px!important;
  height:27px!important;
  padding:0 6px 0 9px!important;
  border-radius:10px!important;
  gap:7px!important;
  font-size:10.5px!important;
  line-height:1!important;
}
.editor-tab-strip-v384 .note-tab-title{
  flex:0 1 auto!important;
  display:inline-block!important;
  width:auto!important;
  min-width:0!important;
  max-width:185px!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
  white-space:nowrap!important;
  font-size:10.5px!important;
  line-height:1!important;
  font-weight:900!important;
}
.editor-tab-strip-v384 .note-tab-close{flex:0 0 16px!important;width:16px!important;height:16px!important;min-width:16px!important;font-size:10px!important;}
.editor-tab-strip-v384 .note-tab.add-tab{width:27px!important;min-width:27px!important;max-width:27px!important;height:27px!important;border-radius:10px!important;font-size:14px!important;padding:0!important;}

/* Compact note list after global density. */
.note-list-toolbar-v3845{padding:6px!important;}
.notes-list-v3845{padding:6px!important;}
.note-row-v3845{min-height:56px!important;padding:7px!important;margin-bottom:5px!important;border-radius:10px!important;}
.note-row-top-v3845 b{font-size:9.5px!important;}
.note-row-v3845 small,.note-preview-v3845{font-size:7.8px!important;}

@media(max-width:1280px){
  :root{--shell-sidebar-w:142px!important;--shell-sidebar-w-collapsed:46px!important;}
  .dashboard-stats{grid-template-columns:repeat(3,minmax(100px,1fr))!important;}
  .notes-workspace-v37.split{grid-template-columns:minmax(175px,205px) minmax(0,1fr)!important;}
  .editor-layout-v38{grid-template-columns:minmax(0,1fr) 220px!important;}
  .editor-tab-strip-v384 .note-tab-title{max-width:160px!important;}
}
@media(max-width:980px){
  html{font-size:9px!important;} body,button,input,select,textarea{font-size:9px!important;}
  .notes-workspace-v37.split{height:auto!important;max-height:none!important;grid-template-columns:1fr!important;}
  .editor-panel.editor-final,.editor-panel-body-v384,.editor-shell-v38,.editor-layout-v38{height:auto!important;max-height:none!important;}
  .editor-layout-v38{display:flex!important;flex-direction:column!important;overflow:visible!important;}
  .editor-inspector-v38{max-height:68vh!important;width:100%!important;}
  .editor-canvas-card-v38{min-height:520px!important;}
}


/* ===== v38.4.9: extra compact density (-25%) =====
   Safe CSS-only polish. No JS/layout logic changed.
   Goal: make 100% browser view feel substantially smaller while keeping clicks/dropdowns stable. */
:root{
  --shell-sidebar-w:120px!important;
  --shell-sidebar-w-collapsed:36px!important;
  --radius:9px!important;
  --shadow:0 8px 22px rgba(15,23,42,.055)!important;
}
html{font-size:7.5px!important;}
body,button,input,select,textarea{font-size:7.5px!important;}
.shell{grid-template-columns:var(--shell-sidebar-w) minmax(0,1fr)!important;}
.shell.sidebar-collapsed,.sidebar-collapsed{grid-template-columns:var(--shell-sidebar-w-collapsed) minmax(0,1fr)!important;}
.sidebar{padding:6px!important;gap:5px!important;}
.sidebar-head{gap:6px!important;padding-bottom:6px!important;}
.brand-logo.small,.brand-logo{width:22px!important;height:22px!important;border-radius:7px!important;font-size:11px!important;}
.sidebar-title b{font-size:8px!important;line-height:1.1!important;}
.sidebar-title span{font-size:6.8px!important;line-height:1.1!important;}
.nav{gap:2px!important;}
.nav-btn{min-height:21px!important;padding:4px 5px!important;border-radius:6px!important;gap:5px!important;font-size:7.5px!important;}
.nav-btn span{font-size:9px!important;}
.side-scroll{padding-right:1px!important;}
.side-title{font-size:6.2px!important;margin:4px 0 2px!important;letter-spacing:.07em!important;}
.notebook-item{min-height:20px!important;padding:4px 5px!important;border-radius:6px!important;font-size:7.1px!important;}
.notebook-item small{font-size:6.2px!important;padding:1px 4px!important;}
.sidebar .primary.full,.sidebar .secondary.full{height:21px!important;min-height:21px!important;font-size:7.1px!important;border-radius:6px!important;padding:0 6px!important;}
.sidebar-bottom-toggle{padding-top:5px!important;}
.sidebar-toggle-modern{width:25px!important;height:25px!important;font-size:13px!important;border-radius:9px!important;}
.main{min-width:0!important;}
.content{padding:8px!important;}
.topbar,.compact-topbar{padding:7px 9px!important;min-height:30px!important;gap:6px!important;}
.topbar h1,.compact-topbar h1{font-size:13px!important;}
.topbar p,.compact-topbar p{font-size:7px!important;}
.primary,.secondary,.danger,.icon,button{border-radius:7px!important;font-size:7.5px!important;}
.primary,.secondary,.danger{padding:5px 7px!important;}
.icon{padding:4px 5px!important;}
input,select,textarea{min-height:22px!important;padding:4px 6px!important;border-radius:7px!important;font-size:7.5px!important;}
.card,.panel,.form-card,.stat-card{padding:9px!important;border-radius:10px!important;}
.home-grid,.dashboard-stats{gap:6px!important;}
.dashboard-hero{padding:8px 10px!important;border-radius:10px!important;}
.dashboard-hero h2{font-size:13px!important;}
.dashboard-hero p,.dashboard-wrap p{font-size:7px!important;}
.dashboard-stats{grid-template-columns:repeat(6,minmax(72px,1fr))!important;}
.stat-card,.dashboard-stat{padding:8px!important;border-radius:10px!important;min-height:54px!important;}
.stat-card span,.dashboard-stat span{font-size:7px!important;}
.stat-card strong,.dashboard-stat strong{font-size:14px!important;margin-top:2px!important;}
.note-grid{grid-template-columns:repeat(auto-fill,minmax(120px,1fr))!important;gap:6px!important;}
.note-card{min-height:68px!important;padding:7px!important;border-radius:9px!important;}
.note-card h3{font-size:9px!important;margin-bottom:3px!important;}
.note-card p{font-size:6.8px!important;line-height:1.35!important;}
.note-card span{font-size:6.2px!important;margin-top:5px!important;}
/* Notes workspace density */
.notes-workspace-v37.split{grid-template-columns:minmax(150px,178px) minmax(0,1fr)!important;gap:6px!important;height:100vh!important;max-height:100vh!important;}
.notelist-collapsed .notes-workspace-v37.split{grid-template-columns:28px minmax(0,1fr)!important;}
.list-panel,.editor-panel{border-radius:9px!important;}
.editor-panel.editor-final{padding:5px!important;height:100vh!important;max-height:100vh!important;}
.editor-panel-topbar-v384{height:25px!important;min-height:25px!important;padding:0 0 4px!important;gap:5px!important;}
.editor-panel-body-v384{height:calc(100vh - 29px)!important;}
.editor-layout-v38{grid-template-columns:minmax(0,1fr) clamp(185px,15vw,235px)!important;gap:6px!important;}
.editor-main-v38{padding:6px!important;border-radius:8px!important;}
.title-input-v38{font-size:12.5px!important;min-height:22px!important;padding:1px 2px 4px!important;}
.rich-toolbar-v38{padding:3px!important;gap:2px!important;margin-bottom:4px!important;border-radius:7px!important;}
.rich-toolbar-v38 button,.rich-toolbar-v38 select,.rich-toolbar-v38 .color-tool{height:19px!important;min-height:19px!important;padding:2px 4px!important;font-size:6.8px!important;border-radius:5px!important;}
.editor-canvas-card-v38{border-radius:8px!important;}
.note-editor-v38{padding:10px 12px!important;font-size:8.5px!important;line-height:1.5!important;}
.editor-footer-v38{height:18px!important;min-height:18px!important;flex-basis:18px!important;padding:3px 6px!important;font-size:6.5px!important;gap:6px!important;}
.editor-footer-v38 b{font-size:6.5px!important;}
.editor-inspector-v38{gap:5px!important;padding-right:2px!important;}
.editor-side-card-v38{padding:6px!important;border-radius:8px!important;}
.editor-side-card-v38 h3,.side-card-head-v38 h3{font-size:8px!important;}
.editor-side-tabs-v38{padding:2px!important;border-radius:8px!important;gap:2px!important;}
.editor-side-tabs-v38 button{height:19px!important;min-height:19px!important;font-size:6.5px!important;padding:2px 4px!important;border-radius:6px!important;}
.note-summary-grid-v38,.editor-properties-grid-v3843{font-size:6.8px!important;gap:4px!important;}
.editor-properties-grid-v3843 select,.editor-properties-grid-v3843 input,.compact-form-v38 input,.compact-form-v38 select{height:20px!important;min-height:20px!important;font-size:6.8px!important;}
/* Multi tab still readable after density */
.editor-tab-strip-v384 .tab-row{gap:4px!important;padding-bottom:1px!important;}
.editor-tab-strip-v384 .note-tab:not(.add-tab){height:23px!important;min-height:23px!important;min-width:fit-content!important;max-width:190px!important;padding:0 5px 0 7px!important;border-radius:8px!important;gap:5px!important;font-size:8.4px!important;}
.editor-tab-strip-v384 .note-tab-title{max-width:150px!important;font-size:8.4px!important;line-height:1!important;}
.editor-tab-strip-v384 .note-tab-close{width:13px!important;height:13px!important;min-width:13px!important;font-size:8px!important;}
.editor-tab-strip-v384 .note-tab.add-tab{width:23px!important;min-width:23px!important;max-width:23px!important;height:23px!important;font-size:12px!important;border-radius:8px!important;}
.editor-command-bar-v38,.editor-command-right-v38{gap:4px!important;}
.editor-command-right-v38>button,.note-more-menu-v38>summary{height:23px!important;min-height:23px!important;padding:0 7px!important;border-radius:7px!important;font-size:7.2px!important;}
.note-more-dropdown-v38{width:165px!important;max-height:min(300px,calc(100vh - 48px))!important;border-radius:9px!important;padding:5px!important;}
.note-more-dropdown-v38 button{height:22px!important;font-size:7px!important;border-radius:6px!important;}
/* Note list and notebook header */
.notebook-card-head-v3846{padding:5px!important;}
.notebook-card-main-v3846{padding:8px!important;gap:6px!important;border-radius:10px!important;}
.notebook-card-title-line-v3846{gap:6px!important;}
.notebook-card-icon-v3846{width:20px!important;height:20px!important;flex-basis:20px!important;border-radius:6px!important;font-size:10px!important;}
.notebook-card-title-v3846 h2{font-size:9px!important;}
.notebook-card-title-v3846 small{font-size:6.5px!important;}
.notebook-category-badge-v3846{font-size:6px!important;padding:2px 5px!important;}
.notebook-card-actions-v3846{gap:4px!important;}
.notebook-action-btn-v3846{width:22px!important;height:22px!important;min-width:22px!important;max-width:22px!important;border-radius:7px!important;}
.notebook-action-btn-v3846 .nb-action-symbol{font-size:10px!important;}
.note-list-toolbar-v3845{padding:5px!important;}
.notes-list-v3845{padding:5px!important;}
.note-row-v3845{min-height:44px!important;padding:5px!important;margin-bottom:4px!important;border-radius:8px!important;}
.note-row-top-v3845 b{font-size:7.8px!important;}
.note-row-v3845 small,.note-preview-v3845{font-size:6.3px!important;line-height:1.3!important;}
/* Generic rows / admin / chat pages */
.list-line,.user-row,.history-row,.task-row,.attach-row,.audit-row,.mail-card,.comment,.chat-msg{padding:7px!important;border-radius:8px!important;margin:5px 0!important;gap:6px!important;}
.admin-grid,.mail-grid,.chat-layout{grid-template-columns:220px minmax(0,1fr)!important;gap:8px!important;}
.chat-list{height:58vh!important;border-radius:9px!important;padding:6px!important;}
@media(max-width:1280px){
  :root{--shell-sidebar-w:108px!important;--shell-sidebar-w-collapsed:34px!important;}
  .dashboard-stats{grid-template-columns:repeat(3,minmax(76px,1fr))!important;}
  .notes-workspace-v37.split{grid-template-columns:minmax(135px,165px) minmax(0,1fr)!important;}
  .editor-layout-v38{grid-template-columns:minmax(0,1fr) 185px!important;}
  .editor-tab-strip-v384 .note-tab-title{max-width:125px!important;}
}
@media(max-width:980px){
  html{font-size:7px!important;} body,button,input,select,textarea{font-size:7px!important;}
  .editor-inspector-v38{max-height:68vh!important;width:100%!important;}
  .editor-canvas-card-v38{min-height:440px!important;}
}


/* ===== v38.4.10: balanced compact density (+13% from v38.4.9) =====
   Safe CSS-only polish. No JS/layout logic changed.
   Goal: make 100% browser view feel substantially smaller while keeping clicks/dropdowns stable. */
:root{
  --shell-sidebar-w:135.6px!important;
  --shell-sidebar-w-collapsed:40.68px!important;
  --radius:10.17px!important;
  --shadow:0 9px 24.86px rgba(15,23,42,.055)!important;
}
html{font-size:8.47px!important;}
body,button,input,select,textarea{font-size:8.47px!important;}
.shell{grid-template-columns:var(--shell-sidebar-w) minmax(0,1fr)!important;}
.shell.sidebar-collapsed,.sidebar-collapsed{grid-template-columns:var(--shell-sidebar-w-collapsed) minmax(0,1fr)!important;}
.sidebar{padding:6.78px!important;gap:5.65px!important;}
.sidebar-head{gap:6.78px!important;padding-bottom:6.78px!important;}
.brand-logo.small,.brand-logo{width:24.86px!important;height:24.86px!important;border-radius:7.91px!important;font-size:12.43px!important;}
.sidebar-title b{font-size:9px!important;line-height:1.1!important;}
.sidebar-title span{font-size:7.68px!important;line-height:1.1!important;}
.nav{gap:2.26px!important;}
.nav-btn{min-height:23.73px!important;padding:4.52px 5.65px!important;border-radius:6.78px!important;gap:5.65px!important;font-size:8.47px!important;}
.nav-btn span{font-size:10.17px!important;}
.side-scroll{padding-right:1.13px!important;}
.side-title{font-size:7px!important;margin:4.52px 0 2.26px!important;letter-spacing:.07em!important;}
.notebook-item{min-height:22.6px!important;padding:4.52px 5.65px!important;border-radius:6.78px!important;font-size:8px!important;}
.notebook-item small{font-size:7px!important;padding:1.13px 4.52px!important;}
.sidebar .primary.full,.sidebar .secondary.full{height:23.73px!important;min-height:23.73px!important;font-size:8px!important;border-radius:6.78px!important;padding:0 6.78px!important;}
.sidebar-bottom-toggle{padding-top:5.65px!important;}
.sidebar-toggle-modern{width:28.25px!important;height:28.25px!important;font-size:14.69px!important;border-radius:10.17px!important;}
.main{min-width:0!important;}
.content{padding:9px!important;}
.topbar,.compact-topbar{padding:7.91px 10.17px!important;min-height:33.9px!important;gap:6.78px!important;}
.topbar h1,.compact-topbar h1{font-size:14.69px!important;}
.topbar p,.compact-topbar p{font-size:7.91px!important;}
.primary,.secondary,.danger,.icon,button{border-radius:7.91px!important;font-size:8.47px!important;}
.primary,.secondary,.danger{padding:5.65px 7.91px!important;}
.icon{padding:4.52px 5.65px!important;}
input,select,textarea{min-height:24.86px!important;padding:4.52px 6.78px!important;border-radius:7.91px!important;font-size:8.47px!important;}
.card,.panel,.form-card,.stat-card{padding:10.17px!important;border-radius:11.3px!important;}
.home-grid,.dashboard-stats{gap:6.78px!important;}
.dashboard-hero{padding:9px 11.3px!important;border-radius:11.3px!important;}
.dashboard-hero h2{font-size:14.69px!important;}
.dashboard-hero p,.dashboard-wrap p{font-size:7.91px!important;}
.dashboard-stats{grid-template-columns:repeat(6,minmax(81.36px,1fr))!important;}
.stat-card,.dashboard-stat{padding:9px!important;border-radius:11.3px!important;min-height:61px!important;}
.stat-card span,.dashboard-stat span{font-size:7.91px!important;}
.stat-card strong,.dashboard-stat strong{font-size:15.82px!important;margin-top:2.26px!important;}
.note-grid{grid-template-columns:repeat(auto-fill,minmax(135.6px,1fr))!important;gap:6.78px!important;}
.note-card{min-height:76.84px!important;padding:7.91px!important;border-radius:10.17px!important;}
.note-card h3{font-size:10.17px!important;margin-bottom:3.39px!important;}
.note-card p{font-size:7.68px!important;line-height:1.35!important;}
.note-card span{font-size:7px!important;margin-top:5.65px!important;}
/* Notes workspace density */
.notes-workspace-v37.split{grid-template-columns:minmax(169.5px,201.14px) minmax(0,1fr)!important;gap:6.78px!important;height:100vh!important;max-height:100vh!important;}
.notelist-collapsed .notes-workspace-v37.split{grid-template-columns:31.64px minmax(0,1fr)!important;}
.list-panel,.editor-panel{border-radius:10.17px!important;}
.editor-panel.editor-final{padding:5.65px!important;height:100vh!important;max-height:100vh!important;}
.editor-panel-topbar-v384{height:28.25px!important;min-height:28.25px!important;padding:0 0 4.52px!important;gap:5.65px!important;}
.editor-panel-body-v384{height:calc(100vh - 32.77px)!important;}
.editor-layout-v38{grid-template-columns:minmax(0,1fr) clamp(209px,15vw,265.55px)!important;gap:6.78px!important;}
.editor-main-v38{padding:6.78px!important;border-radius:9px!important;}
.title-input-v38{font-size:14.12px!important;min-height:24.86px!important;padding:1.13px 2.26px 4.52px!important;}
.rich-toolbar-v38{padding:3.39px!important;gap:2.26px!important;margin-bottom:4.52px!important;border-radius:7.91px!important;}
.rich-toolbar-v38 button,.rich-toolbar-v38 select,.rich-toolbar-v38 .color-tool{height:21.47px!important;min-height:21.47px!important;padding:2.26px 4.52px!important;font-size:7.68px!important;border-radius:5.65px!important;}
.editor-canvas-card-v38{border-radius:9px!important;}
.note-editor-v38{padding:11.3px 13.56px!important;font-size:9.6px!important;line-height:1.5!important;}
.editor-footer-v38{height:20.34px!important;min-height:20.34px!important;flex-basis:20.34px!important;padding:3.39px 6.78px!important;font-size:7.34px!important;gap:6.78px!important;}
.editor-footer-v38 b{font-size:7.34px!important;}
.editor-inspector-v38{gap:5.65px!important;padding-right:2.26px!important;}
.editor-side-card-v38{padding:6.78px!important;border-radius:9px!important;}
.editor-side-card-v38 h3,.side-card-head-v38 h3{font-size:9px!important;}
.editor-side-tabs-v38{padding:2.26px!important;border-radius:9px!important;gap:2.26px!important;}
.editor-side-tabs-v38 button{height:21.47px!important;min-height:21.47px!important;font-size:7.34px!important;padding:2.26px 4.52px!important;border-radius:6.78px!important;}
.note-summary-grid-v38,.editor-properties-grid-v3843{font-size:7.68px!important;gap:4.52px!important;}
.editor-properties-grid-v3843 select,.editor-properties-grid-v3843 input,.compact-form-v38 input,.compact-form-v38 select{height:22.6px!important;min-height:22.6px!important;font-size:7.68px!important;}
/* Multi tab still readable after density */
.editor-tab-strip-v384 .tab-row{gap:4.52px!important;padding-bottom:1.13px!important;}
.editor-tab-strip-v384 .note-tab:not(.add-tab){height:26px!important;min-height:26px!important;min-width:fit-content!important;max-width:214.7px!important;padding:0 5.65px 0 7.91px!important;border-radius:9px!important;gap:5.65px!important;font-size:9.49px!important;}
.editor-tab-strip-v384 .note-tab-title{max-width:169.5px!important;font-size:9.49px!important;line-height:1!important;}
.editor-tab-strip-v384 .note-tab-close{width:14.69px!important;height:14.69px!important;min-width:14.69px!important;font-size:9px!important;}
.editor-tab-strip-v384 .note-tab.add-tab{width:26px!important;min-width:26px!important;max-width:26px!important;height:26px!important;font-size:13.56px!important;border-radius:9px!important;}
.editor-command-bar-v38,.editor-command-right-v38{gap:4.52px!important;}
.editor-command-right-v38>button,.note-more-menu-v38>summary{height:26px!important;min-height:26px!important;padding:0 7.91px!important;border-radius:7.91px!important;font-size:8.14px!important;}
.note-more-dropdown-v38{width:186.45px!important;max-height:min(339px,calc(100vh - 54.24px))!important;border-radius:10.17px!important;padding:5.65px!important;}
.note-more-dropdown-v38 button{height:24.86px!important;font-size:7.91px!important;border-radius:6.78px!important;}
/* Note list and notebook header */
.notebook-card-head-v3846{padding:5.65px!important;}
.notebook-card-main-v3846{padding:9px!important;gap:6.78px!important;border-radius:11.3px!important;}
.notebook-card-title-line-v3846{gap:6.78px!important;}
.notebook-card-icon-v3846{width:22.6px!important;height:22.6px!important;flex-basis:22.6px!important;border-radius:6.78px!important;font-size:11.3px!important;}
.notebook-card-title-v3846 h2{font-size:10.17px!important;}
.notebook-card-title-v3846 small{font-size:7.34px!important;}
.notebook-category-badge-v3846{font-size:6.78px!important;padding:2.26px 5.65px!important;}
.notebook-card-actions-v3846{gap:4.52px!important;}
.notebook-action-btn-v3846{width:24.86px!important;height:24.86px!important;min-width:24.86px!important;max-width:24.86px!important;border-radius:7.91px!important;}
.notebook-action-btn-v3846 .nb-action-symbol{font-size:11.3px!important;}
.note-list-toolbar-v3845{padding:5.65px!important;}
.notes-list-v3845{padding:5.65px!important;}
.note-row-v3845{min-height:49.72px!important;padding:5.65px!important;margin-bottom:4.52px!important;border-radius:9px!important;}
.note-row-top-v3845 b{font-size:8.81px!important;}
.note-row-v3845 small,.note-preview-v3845{font-size:7.12px!important;line-height:1.3!important;}
/* Generic rows / admin / chat pages */
.list-line,.user-row,.history-row,.task-row,.attach-row,.audit-row,.mail-card,.comment,.chat-msg{padding:7.91px!important;border-radius:9px!important;margin:5.65px 0!important;gap:6.78px!important;}
.admin-grid,.mail-grid,.chat-layout{grid-template-columns:248.6px minmax(0,1fr)!important;gap:9px!important;}
.chat-list{height:58vh!important;border-radius:10.17px!important;padding:6.78px!important;}
@media(max-width:1446.4px){
  :root{--shell-sidebar-w:122px!important;--shell-sidebar-w-collapsed:38.42px!important;}
  .dashboard-stats{grid-template-columns:repeat(3,minmax(85.88px,1fr))!important;}
  .notes-workspace-v37.split{grid-template-columns:minmax(152.55px,186.45px) minmax(0,1fr)!important;}
  .editor-layout-v38{grid-template-columns:minmax(0,1fr) 209px!important;}
  .editor-tab-strip-v384 .note-tab-title{max-width:141.25px!important;}
}
@media(max-width:1107.4px){
  html{font-size:7.91px!important;} body,button,input,select,textarea{font-size:7.91px!important;}
  .editor-inspector-v38{max-height:68vh!important;width:100%!important;}
  .editor-canvas-card-v38{min-height:497.2px!important;}
}

/* ===== v39.0 Safe Redesign: Sidebar + Top Header + Dashboard ===== */
:root{
  --v39-bg:#f6f8fc;
  --v39-surface:#ffffff;
  --v39-surface-soft:#f3f7ff;
  --v39-line:#dfe7f3;
  --v39-text:#12213a;
  --v39-muted:#64748b;
  --v39-primary:#2563eb;
  --v39-primary-2:#1d4ed8;
  --v39-primary-soft:#eaf2ff;
  --v39-radius:14px;
  --v39-shadow:0 10px 30px rgba(15,23,42,.055);
}
body.dark{
  --v39-bg:#0f172a;
  --v39-surface:#111827;
  --v39-surface-soft:#172033;
  --v39-line:#263244;
  --v39-text:#e5e7eb;
  --v39-muted:#94a3b8;
  --v39-primary:#3b82f6;
  --v39-primary-2:#2563eb;
  --v39-primary-soft:rgba(59,130,246,.16);
  --v39-shadow:0 18px 38px rgba(0,0,0,.28);
}
.ui-icon{width:1.08em;height:1.08em;display:inline-block;vertical-align:-.18em;flex:0 0 auto;}
.shell{grid-template-columns:250px minmax(0,1fr)!important;background:var(--v39-bg)!important;}
.shell.sidebar-collapsed{grid-template-columns:64px minmax(0,1fr)!important;}
.main{background:var(--v39-bg)!important;}
.content{padding:12px 18px 16px!important;}
.v39-sidebar.sidebar{width:250px!important;background:linear-gradient(180deg,rgba(255,255,255,.98),rgba(248,251,255,.98))!important;border-right:1px solid var(--v39-line)!important;padding:14px!important;gap:10px!important;box-shadow:10px 0 28px rgba(15,23,42,.035)!important;}
body.dark .v39-sidebar.sidebar{background:linear-gradient(180deg,rgba(17,24,39,.98),rgba(15,23,42,.98))!important;box-shadow:none!important;}
.v39-brand-row{display:flex;align-items:center;gap:10px;min-height:38px;margin-bottom:4px;}
.v39-brand-mark{width:32px;height:32px;border-radius:10px;display:grid;place-items:center;background:linear-gradient(135deg,#2563eb,#06b6d4);color:#fff;font-size:16px;font-weight:950;box-shadow:0 8px 20px rgba(37,99,235,.20);}
.v39-brand-text{min-width:0;flex:1;display:block!important;}
.v39-brand-text b{display:block;font-weight:900;color:var(--v39-text);font-size:13.5px;letter-spacing:-.02em;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.v39-sidebar-collapse{width:28px;height:28px;border-radius:10px;background:transparent;color:var(--v39-muted);font-size:16px;font-weight:900;display:grid;place-items:center;}
.v39-sidebar-collapse:hover{background:var(--v39-primary-soft);color:var(--v39-primary);}
.v39-user-card{width:100%;display:flex;align-items:center;gap:10px;background:var(--v39-surface)!important;color:var(--v39-text)!important;border:1px solid var(--v39-line)!important;border-radius:14px!important;padding:10px!important;box-shadow:var(--v39-shadow)!important;text-align:left!important;margin:2px 0 6px!important;}
.v39-avatar{width:34px;height:34px;border-radius:50%;background:linear-gradient(135deg,#2563eb,#6d5dfc);color:#fff;font-weight:900;display:grid;place-items:center;flex:0 0 auto;}
.v39-user-info{min-width:0;display:block;flex:1;}
.v39-user-info b{display:block;font-size:12px;font-weight:900;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.v39-user-info small{display:inline-flex;margin-top:2px;font-size:9.5px;font-weight:900;color:var(--v39-primary);text-transform:uppercase;line-height:1;background:var(--v39-primary-soft);border-radius:999px;padding:3px 6px;}
.v39-chevron{color:var(--v39-muted);font-weight:900;}
.v39-nav{display:block!important;overflow:visible!important;}
.v39-section-title{font-size:9.5px;font-weight:900;letter-spacing:.08em;color:var(--v39-muted);text-transform:uppercase;margin:11px 8px 5px;}
.v39-divider{height:1px;background:var(--v39-line);margin:8px 4px;}
.v39-nav-item.nav-btn{width:100%;min-height:31px!important;display:flex!important;align-items:center!important;gap:9px!important;border-radius:10px!important;background:transparent!important;color:var(--v39-text)!important;padding:7px 9px!important;margin:1px 0!important;font-size:11.5px!important;font-weight:800!important;position:relative;}
.v39-nav-item.nav-btn .ui-icon{font-size:15px;color:var(--v39-muted);}
.v39-nav-item.nav-btn b{font-size:11.5px!important;font-weight:850!important;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.v39-nav-item.nav-btn small{margin-left:auto;min-width:19px;height:19px;border-radius:999px;background:var(--v39-primary-soft);color:var(--v39-primary);display:grid;place-items:center;font-size:10px;font-weight:900;}
.v39-nav-item.nav-btn:hover{background:rgba(37,99,235,.06)!important;}
.v39-nav-item.nav-btn.active{background:var(--v39-primary-soft)!important;color:var(--v39-primary)!important;}
.v39-nav-item.nav-btn.active:before{content:'';position:absolute;left:0;top:7px;bottom:7px;width:3px;border-radius:999px;background:var(--v39-primary);}
.v39-nav-item.nav-btn.active .ui-icon{color:var(--v39-primary);}
.v39-notebooks-block{border-top:1px solid var(--v39-line);padding-top:10px;margin-top:6px;min-height:0;display:flex;flex-direction:column;}
.v39-notebooks-head{display:flex;align-items:center;justify-content:space-between;gap:8px;margin:0 4px 7px;}
.v39-notebooks-head span{font-size:10px;font-weight:900;letter-spacing:.08em;color:var(--v39-muted);}
.v39-notebooks-head button{background:transparent;color:var(--v39-primary);font-size:10.5px!important;font-weight:900;padding:3px 4px!important;border-radius:7px;white-space:nowrap;}
.v39-notebooks-head button:hover{background:var(--v39-primary-soft);}
.v39-notebook-list{display:grid;gap:2px;overflow:auto;min-height:0;max-height:26vh;padding-right:2px;}
.v39-notebook-item.notebook-item{height:29px!important;display:grid!important;grid-template-columns:17px minmax(0,1fr) auto!important;align-items:center!important;gap:7px!important;padding:5px 7px!important;border-radius:9px!important;background:transparent!important;color:var(--v39-text)!important;font-size:11.5px!important;}
.v39-notebook-item .ui-icon{font-size:14px;color:var(--v39-muted);}
.v39-notebook-item span{font-weight:800!important;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.v39-notebook-item small{font-size:10px!important;min-width:20px;height:20px;display:grid;place-items:center;background:#eef4ff!important;color:var(--v39-muted)!important;border-radius:999px;padding:0!important;}
.v39-notebook-item:hover,.v39-notebook-item.active{background:var(--v39-primary-soft)!important;color:var(--v39-primary)!important;}
.v39-notebook-item.active .ui-icon{color:var(--v39-primary);}
.v39-sidebar-actions{margin-top:auto;display:grid;gap:7px;padding-top:10px;border-top:1px solid var(--v39-line);}
.v39-sidebar-actions button{height:34px!important;border-radius:10px!important;display:flex;align-items:center;justify-content:center;gap:8px!important;font-size:11.5px!important;font-weight:900!important;}
.v39-new-note{box-shadow:0 10px 22px rgba(37,99,235,.18)!important;}
.v39-import-note{background:var(--v39-surface)!important;border:1px solid var(--v39-line)!important;color:var(--v39-text)!important;}
.sidebar-collapsed .v39-sidebar.sidebar{width:64px!important;padding:10px 8px!important;align-items:center;}
.sidebar-collapsed .v39-brand-row{justify-content:center;width:100%;}
.sidebar-collapsed .v39-brand-text,.sidebar-collapsed .v39-sidebar-collapse,.sidebar-collapsed .v39-user-info,.sidebar-collapsed .v39-chevron,.sidebar-collapsed .v39-section-title,.sidebar-collapsed .v39-divider,.sidebar-collapsed .v39-notebooks-head,.sidebar-collapsed .v39-notebook-item span,.sidebar-collapsed .v39-notebook-item small,.sidebar-collapsed .v39-sidebar-actions span{display:none!important;}
.sidebar-collapsed .v39-user-card{padding:7px!important;justify-content:center;}
.sidebar-collapsed .v39-nav-item.nav-btn{width:38px!important;height:38px!important;padding:0!important;justify-content:center!important;}
.sidebar-collapsed .v39-nav-item.nav-btn b,.sidebar-collapsed .v39-nav-item.nav-btn small{display:none!important;}
.sidebar-collapsed .v39-notebooks-block{border-top:0;padding-top:0;}
.sidebar-collapsed .v39-notebook-list{max-height:none;gap:6px;}
.sidebar-collapsed .v39-notebook-item.notebook-item{width:38px!important;height:38px!important;display:flex!important;justify-content:center!important;padding:0!important;}
.sidebar-collapsed .v39-sidebar-actions button{width:38px!important;height:38px!important;padding:0!important;}
.v39-topbar.topbar{position:sticky!important;top:0!important;z-index:6!important;display:grid!important;grid-template-columns:minmax(150px,1fr) auto!important;gap:14px!important;align-items:center!important;background:rgba(246,248,252,.88)!important;border-bottom:1px solid var(--v39-line)!important;padding:12px 18px!important;min-height:58px!important;backdrop-filter:blur(20px)!important;}
body.dark .v39-topbar.topbar{background:rgba(15,23,42,.88)!important;}
.v39-topbar .topbar-title h1{font-size:20px!important;line-height:1!important;margin:0 0 5px!important;color:var(--v39-text)!important;font-weight:950;letter-spacing:-.035em;}
.v39-topbar .topbar-title p{font-size:11px!important;margin:0!important;color:var(--v39-muted)!important;}
.v39-top-tools{display:flex;align-items:center;justify-content:flex-end;gap:8px;min-width:0;}
.v39-searchbox{height:34px;min-width:250px;display:flex;align-items:center;gap:9px;background:var(--v39-surface);border:1px solid var(--v39-line);color:var(--v39-muted);border-radius:10px;padding:0 10px!important;box-shadow:0 4px 14px rgba(15,23,42,.035);font-size:11.5px!important;font-weight:800;}
.v39-searchbox .ui-icon{font-size:16px;color:var(--v39-muted);}.v39-searchbox span{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}.v39-searchbox kbd{margin-left:auto;background:#f1f5f9;color:var(--v39-muted);border:1px solid var(--v39-line);border-radius:6px;padding:1px 5px;font-size:10px;font-weight:900;}
body.dark .v39-searchbox kbd{background:#1e293b;}
.v39-head-icon{width:34px;height:34px;border-radius:10px;background:var(--v39-surface);border:1px solid transparent;color:var(--v39-text);display:grid;place-items:center;position:relative;padding:0!important;}
.v39-head-icon:hover{border-color:var(--v39-line);background:var(--v39-primary-soft);color:var(--v39-primary);}
.v39-head-icon i{position:absolute;right:2px;top:1px;min-width:15px;height:15px;border-radius:999px;background:#2563eb;color:#fff;font-size:9px;font-style:normal;font-weight:900;display:grid;place-items:center;border:2px solid var(--v39-bg);}
.v39-dashboard-wrap.dashboard-wrap{display:grid!important;gap:12px!important;}
.v39-dashboard-hero.dashboard-hero{min-height:104px!important;display:flex!important;align-items:center!important;justify-content:space-between!important;gap:18px!important;padding:22px 28px!important;background:linear-gradient(135deg,#eff6ff 0%,#f8fbff 64%,#e8f2ff 100%)!important;border:1px solid #cfe0fa!important;border-radius:16px!important;box-shadow:none!important;overflow:hidden!important;position:relative;}
.v39-dashboard-hero:after{content:'';position:absolute;inset:-20% -8% auto auto;width:46%;height:160%;background:linear-gradient(135deg,transparent 0 40%,rgba(37,99,235,.08) 41% 42%,transparent 43% 60%,rgba(37,99,235,.07) 61% 62%,transparent 63%);transform:rotate(-8deg);pointer-events:none;}
body.dark .v39-dashboard-hero{background:linear-gradient(135deg,#13233d,#0f172a)!important;border-color:#24324a!important;}
.v39-hero-copy{position:relative;z-index:1;}.v39-hero-copy h2{font-size:22px!important;margin:0 0 7px!important;letter-spacing:-.035em;}.v39-hero-copy p{margin:0 0 6px;color:var(--v39-muted);font-weight:700;font-size:12px;}.v39-hero-copy small{color:var(--v39-muted);font-size:11px;font-weight:750;}
.v39-dashboard-hero .dashboard-actions{position:relative;z-index:1;display:flex;gap:10px;align-items:center;}
.v39-dashboard-hero .dashboard-actions button{height:34px!important;display:flex;align-items:center;gap:8px!important;border-radius:10px!important;font-size:11.5px!important;padding:0 12px!important;white-space:nowrap;}
.v39-dashboard-stats.dashboard-stats{display:grid!important;grid-template-columns:repeat(6,minmax(0,1fr))!important;gap:12px!important;}
.v39-stat.dashboard-stat{min-height:80px!important;padding:14px!important;border-radius:14px!important;display:flex!important;align-items:center!important;gap:12px!important;background:var(--v39-surface)!important;border:1px solid var(--v39-line)!important;box-shadow:0 8px 22px rgba(15,23,42,.04)!important;}
.v39-stat-icon{width:38px;height:38px;border-radius:13px;background:var(--v39-primary-soft);color:var(--v39-primary);display:grid;place-items:center;flex:0 0 auto;}
.v39-stat:nth-child(2) .v39-stat-icon{background:rgba(34,197,94,.13);color:#16a34a}.v39-stat:nth-child(3) .v39-stat-icon{background:rgba(245,158,11,.13);color:#d97706}.v39-stat:nth-child(4) .v39-stat-icon{background:rgba(239,68,68,.13);color:#dc2626}.v39-stat:nth-child(5) .v39-stat-icon{background:rgba(124,58,237,.12);color:#7c3aed}.v39-stat:nth-child(6) .v39-stat-icon{background:rgba(20,184,166,.13);color:#0d9488}
.v39-stat-copy{display:block;min-width:0;}.v39-stat-copy em{display:block;font-style:normal;color:var(--v39-muted);font-size:11px;font-weight:900;margin-bottom:2px;}.v39-stat-copy strong{font-size:22px!important;line-height:1;margin:0!important;}.v39-stat-copy small{display:block;color:var(--v39-muted);font-size:10.5px;margin-top:3px;font-weight:700;}
.v39-dashboard-grid.dashboard-grid{display:grid!important;grid-template-columns:minmax(0,1.1fr) minmax(330px,.9fr)!important;gap:12px!important;align-items:stretch!important;}
.v39-dashboard-panel.dashboard-panel{padding:14px!important;border-radius:15px!important;background:var(--v39-surface)!important;border:1px solid var(--v39-line)!important;box-shadow:0 8px 22px rgba(15,23,42,.035)!important;min-height:0!important;}
.v39-dashboard-grid .v39-dashboard-panel:nth-child(2){min-height:330px;}.v39-dashboard-grid .v39-dashboard-panel:nth-child(3),.v39-dashboard-grid .v39-dashboard-panel:nth-child(4){min-height:94px;}
.dashboard-heading{margin-bottom:10px!important;}.dashboard-heading h2{font-size:15px!important;margin:0!important;}.dashboard-heading .tiny{height:28px!important;padding:0 10px!important;border-radius:9px!important;font-size:10.5px!important;}
.v39-note-grid.note-grid{grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:9px!important;}
.v39-note-grid .note-card{background:linear-gradient(180deg,#fff,#f8fbff)!important;border:1px solid var(--v39-line)!important;border-radius:12px!important;box-shadow:none!important;min-height:102px!important;padding:11px!important;}
body.dark .v39-note-grid .note-card{background:#111827!important;}
.v39-note-grid .note-card h3{font-size:12.5px!important;margin-bottom:5px!important;}.v39-note-grid .note-card p{font-size:10.8px!important;line-height:1.45!important;}.v39-note-grid .note-card span{font-size:9.8px!important;margin-top:7px!important;}
.v39-view-all{display:block;margin:9px 4px 0 auto;background:transparent;color:var(--v39-primary);font-weight:900;font-size:11.5px!important;padding:5px 2px!important;}
.v39-empty-state{height:100%;min-height:260px;display:grid;place-content:center;text-align:center;color:var(--v39-muted);}.v39-empty-state span{width:62px;height:62px;margin:0 auto 12px;border-radius:50%;background:var(--v39-primary-soft);color:var(--v39-primary);display:grid;place-items:center;font-size:24px}.v39-empty-state b{color:var(--v39-text);font-size:13px;margin-bottom:4px}.v39-empty-state p{font-size:11.5px;margin:0;}
.v39-list-empty{display:flex;align-items:center;gap:12px;padding:9px;border-radius:12px;background:transparent;}.v39-list-empty>span{width:36px;height:36px;border-radius:12px;background:var(--v39-primary-soft);color:var(--v39-primary);display:grid;place-items:center}.v39-list-empty b{font-size:12px;display:block}.v39-list-empty small{color:var(--v39-muted);font-size:10.5px;}
.v39-activity-item.activity-item{display:grid!important;grid-template-columns:34px 1fr!important;gap:10px!important;align-items:center!important;margin:0!important;padding:8px!important;border-radius:12px!important;}.v39-activity-item .activity-icon{width:34px;height:34px;border-radius:50%;background:var(--v39-primary-soft);color:var(--v39-primary);display:grid;place-items:center;}.v39-activity-item b{font-size:12px;}.v39-activity-item p{margin:2px 0;color:var(--v39-muted);font-size:10.5px}.v39-activity-item small{font-size:10px;color:var(--v39-muted);}
@media(max-width:1320px){.v39-dashboard-stats.dashboard-stats{grid-template-columns:repeat(3,minmax(0,1fr))!important}.v39-dashboard-grid.dashboard-grid{grid-template-columns:1fr!important}.v39-note-grid.note-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}.v39-searchbox{min-width:220px;}}
@media(max-width:880px){.shell,.shell.sidebar-collapsed{grid-template-columns:1fr!important}.v39-sidebar.sidebar{width:auto!important;border-right:0!important;border-bottom:1px solid var(--v39-line)!important;max-height:none!important}.v39-topbar.topbar{grid-template-columns:1fr!important}.v39-top-tools{justify-content:flex-start;overflow:auto}.v39-searchbox{min-width:180px}.v39-dashboard-stats.dashboard-stats{grid-template-columns:repeat(2,minmax(0,1fr))!important}.v39-note-grid.note-grid{grid-template-columns:1fr!important}.content{padding:10px!important}}

/* =========================================================
   v39.1 Notes Workspace Redesign
   Safe CSS-only redesign for Notes page / editor / note list / inspector.
   Keeps all existing JS actions intact.
   ========================================================= */
.view-notes .content{
  padding:10px 14px 12px!important;
  background:var(--v39-bg)!important;
  overflow:hidden!important;
}
.view-notes .main{min-width:0!important;overflow:hidden!important;}
.view-notes .topbar{display:none!important;}

/* Main notes workspace: precise three-zone app layout */
.notes-workspace-v37.split{
  width:100%!important;
  max-width:none!important;
  height:calc(100vh - 22px)!important;
  min-height:620px!important;
  display:grid!important;
  grid-template-columns:252px minmax(0,1fr)!important;
  gap:12px!important;
  align-items:stretch!important;
  background:transparent!important;
  overflow:hidden!important;
}
.notelist-collapsed .notes-workspace-v37.split{grid-template-columns:44px minmax(0,1fr)!important;}

/* Note list column */
.note-list-final.list-panel{
  min-width:0!important;
  height:100%!important;
  min-height:0!important;
  display:flex!important;
  flex-direction:column!important;
  overflow:hidden!important;
  background:var(--v39-surface)!important;
  border:1px solid var(--v39-line)!important;
  border-radius:16px!important;
  box-shadow:0 12px 30px rgba(15,23,42,.055)!important;
}
.note-list-expanded-v384{height:100%!important;min-height:0!important;display:flex!important;flex-direction:column!important;overflow:hidden!important;}
.collapsed-rail-v384{
  display:none!important;
  height:100%!important;
  width:44px!important;
  border-radius:14px!important;
  border:1px solid var(--v39-line)!important;
  background:var(--v39-surface)!important;
  color:var(--v39-muted)!important;
  align-items:center!important;
  justify-content:flex-start!important;
  flex-direction:column!important;
  padding:10px 0!important;
  gap:8px!important;
  font-weight:900!important;
}
.notelist-collapsed .note-list-final{background:transparent!important;border:0!important;box-shadow:none!important;}
.notelist-collapsed .note-list-expanded-v384{display:none!important;}
.notelist-collapsed .collapsed-rail-v384{display:flex!important;}
.collapsed-rail-v384 span{writing-mode:vertical-rl;text-orientation:mixed;font-size:10px;letter-spacing:.08em;text-transform:uppercase;color:var(--v39-muted);}

/* Notebook header card: professional, neutral, icon-only actions */
.notebook-card-head-v3846{
  padding:10px!important;
  background:linear-gradient(180deg,rgba(248,251,255,.92),rgba(255,255,255,.96))!important;
  border-bottom:1px solid var(--v39-line)!important;
  flex:0 0 auto!important;
}
.notebook-card-main-v3846{
  display:grid!important;
  gap:11px!important;
  padding:13px!important;
  border:1px solid var(--v39-line)!important;
  border-radius:15px!important;
  background:var(--v39-surface)!important;
  box-shadow:0 8px 22px rgba(15,23,42,.045)!important;
}
.notebook-card-title-line-v3846{display:grid!important;grid-template-columns:34px minmax(0,1fr) auto!important;align-items:start!important;gap:9px!important;}
.notebook-card-icon-v3846{
  width:34px!important;height:34px!important;border-radius:12px!important;
  background:var(--v39-primary-soft)!important;border:1px solid rgba(37,99,235,.16)!important;color:var(--v39-primary)!important;
  display:grid!important;place-items:center!important;font-size:0!important;position:relative!important;
}
.notebook-card-icon-v3846:before{content:'▣';font-size:14px;font-weight:900;line-height:1;}
.notebook-card-title-v3846{min-width:0!important;display:grid!important;gap:2px!important;}
.notebook-card-title-v3846 h2{font-size:14px!important;line-height:1.15!important;font-weight:950!important;letter-spacing:-.025em!important;margin:0!important;color:var(--v39-text)!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important;}
.notebook-card-title-v3846 small{font-size:10.5px!important;font-weight:850!important;color:var(--v39-muted)!important;}
.notebook-category-badge-v3846{
  font-size:8.8px!important;font-weight:950!important;letter-spacing:.06em!important;text-transform:uppercase!important;
  border-radius:999px!important;padding:4px 8px!important;
  color:var(--v39-primary)!important;background:var(--v39-primary-soft)!important;border:1px solid rgba(37,99,235,.16)!important;
}
.notebook-category-badge-v3846.private,.notebook-category-badge-v3846.pribadi,.notebook-category-badge-v3846.public,.notebook-category-badge-v3846.publik,.notebook-category-badge-v3846.admin{color:var(--v39-primary)!important;background:var(--v39-primary-soft)!important;border-color:rgba(37,99,235,.16)!important;}
.notebook-card-actions-v3846{display:flex!important;align-items:center!important;justify-content:space-between!important;gap:7px!important;}
.notebook-action-btn-v3846{
  width:34px!important;height:32px!important;min-width:34px!important;padding:0!important;border-radius:10px!important;
  background:var(--v39-surface)!important;border:1px solid var(--v39-line)!important;color:var(--v39-muted)!important;
  display:grid!important;place-items:center!important;box-shadow:none!important;
}
.notebook-action-btn-v3846:hover{background:var(--v39-primary-soft)!important;border-color:rgba(37,99,235,.20)!important;color:var(--v39-primary)!important;}
.notebook-action-btn-v3846 .nb-action-symbol{font-size:13px!important;color:currentColor!important;line-height:1!important;}
.notebook-action-btn-v3846 span:not(.nb-action-symbol){display:none!important;}
.notebook-action-btn-v3846.danger-action-v3846{background:var(--v39-surface)!important;border-color:var(--v39-line)!important;color:#9f1239!important;}
.notebook-action-btn-v3846.danger-action-v3846:hover{background:var(--danger-soft,#fee2e2)!important;border-color:#fecaca!important;color:#b91c1c!important;}

/* New note and note list */
.note-list-toolbar-v3845{padding:9px 10px 8px!important;background:var(--v39-surface)!important;border-bottom:1px solid var(--v39-line)!important;flex:0 0 auto!important;}
.note-list-toolbar-v3845 .primary{height:33px!important;border-radius:11px!important;font-size:11.5px!important;font-weight:950!important;box-shadow:0 8px 18px rgba(37,99,235,.14)!important;}
.notes-list-v3845{flex:1 1 auto!important;min-height:0!important;overflow:auto!important;padding:10px!important;background:linear-gradient(180deg,var(--v39-surface),rgba(248,251,255,.86))!important;}
.notes-list-v3845::-webkit-scrollbar{width:6px}.notes-list-v3845::-webkit-scrollbar-thumb{background:#c9d4e4;border-radius:999px}
.note-row-v3845.note-row-final{
  width:100%!important;display:grid!important;gap:4px!important;min-height:78px!important;margin:0 0 8px!important;padding:10px!important;
  border-radius:13px!important;background:var(--v39-surface)!important;border:1px solid var(--v39-line)!important;color:var(--v39-text)!important;
  text-align:left!important;box-shadow:0 5px 16px rgba(15,23,42,.025)!important;
}
.note-row-v3845:hover{border-color:#b9d3f8!important;box-shadow:0 10px 22px rgba(15,23,42,.06)!important;transform:translateY(-1px);}
.note-row-v3845.active{background:#eef6ff!important;border-color:#9cc7ff!important;box-shadow:0 10px 22px rgba(37,99,235,.12)!important;}
.note-row-top-v3845{display:flex!important;align-items:center!important;justify-content:space-between!important;gap:8px!important;min-width:0!important;}
.note-row-top-v3845 b{font-size:12.2px!important;font-weight:950!important;line-height:1.2!important;color:var(--v39-text)!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important;}
.note-row-top-v3845 em{font-style:normal!important;font-size:8.5px!important;font-weight:950!important;letter-spacing:.05em;color:var(--v39-primary)!important;background:var(--v39-primary-soft)!important;border-radius:999px!important;padding:3px 6px!important;flex:0 0 auto!important;}
.note-row-v3845 small{font-size:9.5px!important;color:var(--v39-muted)!important;font-weight:800!important;}
.note-preview-v3845{font-size:10.2px!important;line-height:1.45!important;color:var(--v39-muted)!important;display:-webkit-box!important;-webkit-line-clamp:2!important;-webkit-box-orient:vertical!important;overflow:hidden!important;}

/* Editor workspace header: tabs left, actions right */
.editor-final.editor-panel{
  height:100%!important;min-height:0!important;background:transparent!important;padding:0!important;display:flex!important;flex-direction:column!important;overflow:hidden!important;
}
.editor-panel-topbar-v384{
  flex:0 0 auto!important;min-height:42px!important;display:grid!important;grid-template-columns:minmax(0,1fr) auto!important;gap:12px!important;align-items:center!important;
  padding:0 0 9px!important;background:transparent!important;
}
.editor-panel-body-v384{flex:1 1 auto!important;height:auto!important;min-height:0!important;overflow:hidden!important;}
.editor-tab-strip-v384{min-width:0!important;overflow:hidden!important;}
.editor-tab-strip-v384 .workspace-tabs,.editor-tab-strip-v384 .workspace-tabs-v383{display:block!important;width:100%!important;min-width:0!important;}
.editor-tab-strip-v384 .tab-row{display:flex!important;align-items:center!important;gap:7px!important;overflow-x:auto!important;overflow-y:hidden!important;padding:2px 0 3px!important;scrollbar-width:thin!important;}
.editor-tab-strip-v384 .note-tab{
  flex:0 0 auto!important;width:auto!important;min-width:72px!important;max-width:260px!important;height:31px!important;padding:0 8px 0 11px!important;border-radius:12px!important;
  display:inline-flex!important;align-items:center!important;gap:8px!important;background:var(--v39-surface)!important;border:1px solid var(--v39-line)!important;color:var(--v39-text)!important;
  font-size:11.5px!important;font-weight:900!important;box-shadow:0 4px 12px rgba(15,23,42,.025)!important;
}
.editor-tab-strip-v384 .note-tab-title{display:block!important;flex:0 1 auto!important;min-width:0!important;max-width:210px!important;overflow:hidden!important;text-overflow:ellipsis!important;white-space:nowrap!important;font-size:11.5px!important;line-height:1!important;text-align:left!important;}
.editor-tab-strip-v384 .note-tab.active{background:#eaf3ff!important;border-color:#93c5fd!important;color:#1d4ed8!important;box-shadow:0 8px 18px rgba(37,99,235,.12)!important;}
.editor-tab-strip-v384 .note-tab.dirty .note-tab-title:before{content:'• ';font-weight:950;color:var(--v39-primary);}
.editor-tab-strip-v384 .note-tab-close{width:18px!important;height:18px!important;min-width:18px!important;flex:0 0 18px!important;border-radius:999px!important;background:#eef2f7!important;color:#64748b!important;font-size:12px!important;display:grid!important;place-items:center!important;}
.editor-tab-strip-v384 .note-tab.add-tab{width:31px!important;min-width:31px!important;max-width:31px!important;height:31px!important;border-radius:12px!important;padding:0!important;justify-content:center!important;font-size:16px!important;}
.editor-action-strip-v384{justify-self:end!important;min-width:0!important;max-width:100%!important;}
.editor-command-bar-v38{display:flex!important;justify-content:flex-end!important;overflow:visible!important;}
.editor-command-right-v38{display:flex!important;align-items:center!important;justify-content:flex-end!important;gap:6px!important;overflow:visible!important;flex-wrap:nowrap!important;}
.editor-command-right-v38>button,.note-more-menu-v38>summary{height:31px!important;min-height:31px!important;border-radius:10px!important;padding:0 10px!important;font-size:10.5px!important;font-weight:900!important;}
.note-more-menu-v38{position:relative!important;}
.note-more-menu-v38[open] .note-more-dropdown-v38,.note-more-dropdown-v38{position:absolute!important;top:calc(100% + 7px)!important;right:0!important;left:auto!important;width:210px!important;z-index:9999!important;max-height:min(360px,calc(100vh - 80px))!important;overflow:auto!important;background:var(--v39-surface)!important;border:1px solid var(--v39-line)!important;border-radius:13px!important;box-shadow:0 20px 48px rgba(15,23,42,.18)!important;padding:8px!important;}
.note-more-dropdown-v38 button{width:100%!important;height:30px!important;border-radius:9px!important;font-size:10.5px!important;text-align:left!important;justify-content:flex-start!important;}

/* Editor pane + right inspector */
.editor-shell-v38{height:100%!important;min-height:0!important;display:block!important;padding:0!important;}
.editor-layout-v38{height:100%!important;min-height:0!important;display:grid!important;grid-template-columns:minmax(0,1fr) 288px!important;gap:12px!important;align-items:stretch!important;}
.editor-main-v38{
  height:100%!important;min-height:0!important;display:flex!important;flex-direction:column!important;overflow:hidden!important;min-width:0!important;
  background:var(--v39-surface)!important;border:1px solid var(--v39-line)!important;border-radius:16px!important;box-shadow:0 12px 30px rgba(15,23,42,.055)!important;padding:16px!important;
}
.note-title-block-v38{flex:0 0 auto!important;margin:0 0 10px!important;display:block!important;}
.title-input-v38{font-size:20px!important;font-weight:950!important;letter-spacing:-.035em!important;line-height:1.18!important;padding:0 0 8px!important;margin:0!important;border:0!important;border-bottom:1px solid var(--v39-line)!important;background:transparent!important;color:var(--v39-text)!important;width:100%!important;}
.title-input-v38:disabled{opacity:1!important;color:var(--v39-text)!important;-webkit-text-fill-color:var(--v39-text)!important;}
.rich-toolbar-v38{flex:0 0 auto!important;max-height:74px!important;overflow:auto!important;display:flex!important;flex-wrap:wrap!important;gap:5px!important;padding:6px!important;margin:0 0 9px!important;border-radius:12px!important;background:#f8fbff!important;border:1px solid var(--v39-line)!important;}
.rich-toolbar-v38 button,.rich-toolbar-v38 select,.rich-toolbar-v38 .color-tool{height:27px!important;min-height:27px!important;border-radius:8px!important;background:var(--v39-surface)!important;border:1px solid var(--v39-line)!important;color:var(--v39-text)!important;font-size:9.5px!important;font-weight:900!important;padding:4px 7px!important;box-shadow:none!important;}
.editor-canvas-card-v38{flex:1 1 auto!important;min-height:0!important;display:flex!important;flex-direction:column!important;overflow:hidden!important;background:var(--v39-surface)!important;border:1px solid var(--v39-line)!important;border-radius:14px!important;}
.note-editor-v38{flex:1 1 auto!important;min-height:0!important;height:auto!important;overflow:auto!important;border:0!important;border-bottom:1px solid var(--v39-line)!important;border-radius:0!important;background:var(--v39-surface)!important;color:var(--v39-text)!important;padding:22px 24px!important;font-size:12.5px!important;line-height:1.65!important;box-shadow:none!important;}
.note-editor-v38.editing{outline:0!important;box-shadow:inset 0 0 0 1px rgba(37,99,235,.16)!important;}
.editor-footer-v38{flex:0 0 auto!important;height:27px!important;min-height:27px!important;display:flex!important;align-items:center!important;gap:11px!important;background:var(--v39-surface)!important;border-top:0!important;padding:0 10px!important;font-size:9.5px!important;font-weight:850!important;color:var(--v39-muted)!important;}
.editor-footer-v38 b{margin-left:auto!important;color:var(--v39-muted)!important;font-size:9.5px!important;}

.editor-inspector-v38{
  width:100%!important;min-width:0!important;max-width:none!important;height:100%!important;max-height:100%!important;min-height:0!important;
  overflow-y:auto!important;overflow-x:hidden!important;padding:0 4px 0 0!important;display:flex!important;flex-direction:column!important;gap:9px!important;
}
.editor-inspector-v38::-webkit-scrollbar{width:6px}.editor-inspector-v38::-webkit-scrollbar-thumb{background:#c9d4e4;border-radius:999px}
.editor-side-tabs-v38{flex:0 0 auto!important;display:grid!important;grid-template-columns:repeat(4,minmax(0,1fr))!important;gap:4px!important;padding:5px!important;background:var(--v39-surface)!important;border:1px solid var(--v39-line)!important;border-radius:13px!important;box-shadow:0 8px 20px rgba(15,23,42,.04)!important;}
.editor-side-tabs-v38 button{height:28px!important;border-radius:9px!important;font-size:9.5px!important;font-weight:950!important;padding:0 5px!important;color:var(--v39-text)!important;background:transparent!important;}
.editor-side-tabs-v38 button.active,.editor-side-tabs-v38 button:hover{background:var(--v39-primary-soft)!important;color:var(--v39-primary)!important;}
.side-tab-count{height:auto!important;min-width:auto!important;background:transparent!important;color:inherit!important;margin-left:2px!important;font-size:9px!important;}
.editor-side-card-v38{background:var(--v39-surface)!important;border:1px solid var(--v39-line)!important;border-radius:14px!important;padding:12px!important;box-shadow:0 8px 20px rgba(15,23,42,.045)!important;}
.note-summary-card-v38{order:0!important;}.editor-properties-card-v3843{order:1!important;}.editor-inspector-v38>.editor-side-card-v38:not(.note-summary-card-v38):not(.editor-properties-card-v3843){order:3!important;}
.note-summary-head-v38 h3,.side-card-head-v38 h3{font-size:13px!important;font-weight:950!important;color:var(--v39-text)!important;margin:0!important;}
.category-badge{font-size:8.5px!important;padding:4px 7px!important;border-radius:999px!important;background:var(--v39-primary-soft)!important;color:var(--v39-primary)!important;}
.note-summary-grid-v38{display:grid!important;grid-template-columns:68px minmax(0,1fr)!important;gap:6px 9px!important;font-size:10.5px!important;margin:0!important;}
.note-summary-grid-v38 dt{color:var(--v39-muted)!important;font-weight:750!important;}.note-summary-grid-v38 dd{font-weight:900!important;color:var(--v39-text)!important;margin:0!important;min-width:0!important;}
.status-badge-v38{font-size:9.5px!important;padding:4px 7px!important;border-radius:999px!important;background:var(--v39-primary-soft)!important;color:var(--v39-primary)!important;}
.editor-properties-grid-v3843{display:grid!important;grid-template-columns:64px minmax(0,1fr)!important;gap:8px!important;align-items:center!important;}
.editor-properties-grid-v3843 label{font-size:9.5px!important;font-weight:950!important;color:var(--v39-muted)!important;text-transform:uppercase!important;letter-spacing:.04em!important;}
.editor-properties-grid-v3843 select,.editor-properties-grid-v3843 input{height:31px!important;border-radius:10px!important;font-size:10.5px!important;font-weight:850!important;}
.property-tag-shell-v3843{min-height:31px!important;border-radius:10px!important;padding:0 6px!important;}
.tag-placeholder-v38{font-size:9.5px!important;padding:4px 7px!important;max-width:90px!important;}
.side-card-head-v38{margin-bottom:8px!important;}.side-card-head-v38 button,.link-btn-v38{font-size:10px!important;color:var(--v39-primary)!important;}
.mini-muted-v38,.compact-line-v38 span,.compact-task-v38 small{font-size:10.5px!important;color:var(--v39-muted)!important;}.compact-line-v38 b,.compact-task-v38 label{font-size:11px!important;}
.compact-form-v38{gap:6px!important;margin-top:8px!important;}.compact-form-v38 input,.compact-form-v38 select,.compact-form-v38 button{height:31px!important;border-radius:10px!important;font-size:10.5px!important;}
.task-compact-form-v38{grid-template-columns:minmax(0,1fr) 92px!important;}

body.dark .view-notes .content{background:var(--bg)!important;}
body.dark .note-list-final,body.dark .notebook-card-main-v3846,body.dark .notes-list-v3845,body.dark .note-row-v3845,body.dark .editor-main-v38,body.dark .editor-canvas-card-v38,body.dark .note-editor-v38,body.dark .editor-footer-v38,body.dark .editor-side-card-v38,body.dark .editor-side-tabs-v38,body.dark .editor-tab-strip-v384 .note-tab{background:var(--panel)!important;border-color:var(--border)!important;color:var(--text)!important;}
body.dark .notebook-card-head-v3846,body.dark .note-list-toolbar-v3845,body.dark .rich-toolbar-v38{background:var(--panel)!important;border-color:var(--border)!important;}
body.dark .title-input-v38{color:var(--text)!important;-webkit-text-fill-color:var(--text)!important;border-color:var(--border)!important;}
body.dark .note-row-v3845.active,body.dark .editor-tab-strip-v384 .note-tab.active{background:rgba(59,130,246,.16)!important;border-color:#2563eb!important;color:#bfdbfe!important;}
body.dark .notebook-card-icon-v3846{background:rgba(59,130,246,.16)!important;border-color:#1d4ed8!important;color:#93c5fd!important;}
body.dark .rich-toolbar-v38 button,body.dark .rich-toolbar-v38 select,body.dark .rich-toolbar-v38 .color-tool{background:var(--panel)!important;color:var(--text)!important;border-color:var(--border)!important;}

@media(max-width:1320px){
  .notes-workspace-v37.split{grid-template-columns:232px minmax(0,1fr)!important;}
  .editor-layout-v38{grid-template-columns:minmax(0,1fr) 260px!important;}
  .editor-command-right-v38>button,.note-more-menu-v38>summary{padding:0 8px!important;font-size:10px!important;}
}
@media(max-width:980px){
  .view-notes .content{padding:8px!important;overflow:auto!important;}
  .notes-workspace-v37.split{height:auto!important;min-height:calc(100vh - 16px)!important;display:flex!important;flex-direction:column!important;}
  .editor-panel-topbar-v384{grid-template-columns:1fr!important;gap:7px!important;}
  .editor-action-strip-v384{justify-self:stretch!important;}
  .editor-command-right-v38{justify-content:flex-start!important;overflow-x:auto!important;}
  .editor-layout-v38{height:auto!important;display:flex!important;flex-direction:column!important;}
  .editor-main-v38{min-height:560px!important;}
  .editor-inspector-v38{height:auto!important;max-height:70vh!important;overflow:auto!important;}
}

/* =========================================================
   v39.2 Secondary Pages Redesign
   Search, Archive, Trash, Tasks, Notifications, Templates, Settings, Audit.
   CSS-only visual system plus safe markup classes.
   ========================================================= */
.v39-secondary-page{display:grid;gap:12px;min-width:0;}
.v39-page-head{display:flex;align-items:flex-end;justify-content:space-between;gap:12px;padding:2px 1px 0;}
.v39-page-head h1{margin:0;font-size:18px;line-height:1.1;letter-spacing:-.035em;color:var(--v39-text);font-weight:950;}
.v39-page-head p{margin:4px 0 0;color:var(--v39-muted);font-size:11.5px;font-weight:700;}
.v39-page-head .primary,.v39-page-head .secondary{height:32px;border-radius:10px;font-size:11px;font-weight:900;}
.v39-panel-card{background:var(--v39-surface);border:1px solid var(--v39-line);border-radius:16px;box-shadow:0 10px 26px rgba(15,23,42,.045);padding:13px;min-width:0;}
.v39-section-head{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:10px;}
.v39-section-head h2{margin:0;font-size:14px;color:var(--v39-text);font-weight:950;letter-spacing:-.02em;}
.v39-section-head p,.v39-section-head small{margin:3px 0 0;color:var(--v39-muted);font-size:10.5px;font-weight:700;}
.v39-filter-card{display:grid;grid-template-columns:1.4fr .8fr .85fr .9fr .75fr auto auto;gap:8px;align-items:end;background:var(--v39-surface);border:1px solid var(--v39-line);border-radius:16px;box-shadow:0 10px 26px rgba(15,23,42,.04);padding:12px;}
.v39-filter-card label{display:grid;gap:4px;min-width:0;color:var(--v39-muted);font-size:9.5px;font-weight:950;text-transform:uppercase;letter-spacing:.05em;}
.v39-filter-card label span{white-space:nowrap;}
.v39-filter-card input,.v39-filter-card select{height:31px;border-radius:10px;border:1px solid var(--v39-line);background:var(--v39-surface);color:var(--v39-text);font-size:11px;font-weight:800;padding:0 9px;min-width:0;}
.v39-filter-card .v39-check{height:31px;display:flex;align-items:center;gap:6px;text-transform:none;letter-spacing:0;font-size:10.5px;color:var(--v39-text);background:var(--v39-bg);border:1px solid var(--v39-line);border-radius:10px;padding:0 9px;white-space:nowrap;}
.v39-filter-card .v39-check input{height:auto;width:auto;}
.v39-secondary-note-grid.note-grid{grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;}
.v39-secondary-note-grid .note-card,.v39-action-card{border:1px solid var(--v39-line)!important;border-radius:14px!important;background:linear-gradient(180deg,#fff,#f8fbff)!important;box-shadow:none!important;padding:12px!important;min-height:112px!important;display:flex!important;flex-direction:column!important;gap:7px!important;}
.v39-secondary-note-grid .note-card h3,.v39-action-card h3{margin:0!important;font-size:13px!important;font-weight:950!important;color:var(--v39-text)!important;line-height:1.2!important;}
.v39-secondary-note-grid .note-card p,.v39-action-card p{margin:0!important;color:var(--v39-muted)!important;font-size:10.8px!important;line-height:1.45!important;}
.v39-secondary-note-grid .note-card span,.v39-action-card span{margin-top:auto!important;color:var(--v39-muted)!important;font-size:9.8px!important;font-weight:800!important;}
.v39-card-actions{display:flex;align-items:center;gap:6px;justify-content:flex-end;flex-wrap:wrap;margin-top:6px;}
.v39-card-actions button{height:28px!important;border-radius:9px!important;font-size:10px!important;font-weight:900!important;padding:0 9px!important;}
.v39-empty-block{grid-column:1/-1;min-height:170px;display:grid;place-content:center;text-align:center;gap:6px;color:var(--v39-muted);border:1px dashed var(--v39-line);border-radius:15px;background:linear-gradient(180deg,rgba(248,251,255,.7),rgba(255,255,255,.65));}
.v39-empty-block span{width:48px;height:48px;border-radius:16px;background:var(--v39-primary-soft);color:var(--v39-primary);display:grid;place-items:center;margin:0 auto 3px;}
.v39-empty-block b{font-size:13px;color:var(--v39-text);font-weight:950;}
.v39-empty-block small{font-size:10.5px;font-weight:700;color:var(--v39-muted);}
.v39-two-col{display:grid;grid-template-columns:1fr 1fr;gap:12px;align-items:start;}
.v39-list-stack{display:grid;gap:8px;}
.v39-list-card{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:10px;align-items:center;padding:10px;border:1px solid var(--v39-line);border-radius:13px;background:linear-gradient(180deg,#fff,#f8fbff);}
.v39-list-card b{display:block;font-size:12.5px;color:var(--v39-text);font-weight:950;margin-bottom:2px;}
.v39-list-card small{display:block;color:var(--v39-muted);font-size:10.5px;font-weight:700;line-height:1.4;}
.v39-list-card.danger-soft{background:linear-gradient(180deg,#fff,#fff8f8);}
.v39-list-card.notification{grid-template-columns:10px minmax(0,1fr) auto;}
.v39-list-card.notification.unread{border-color:rgba(37,99,235,.24);background:linear-gradient(180deg,#f8fbff,#fff);}
.v39-dot{width:7px;height:7px;border-radius:50%;background:#cbd5e1;display:block;align-self:start;margin-top:7px;}
.v39-list-card.unread .v39-dot{background:var(--v39-primary);box-shadow:0 0 0 4px var(--v39-primary-soft);}
.v39-mini-stats{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;}
.v39-mini-stats>div{background:var(--v39-surface);border:1px solid var(--v39-line);border-radius:14px;padding:11px 12px;box-shadow:0 8px 22px rgba(15,23,42,.035);}
.v39-mini-stats b{font-size:20px;line-height:1;color:var(--v39-text);display:block;}
.v39-mini-stats span{font-size:10.5px;color:var(--v39-muted);font-weight:850;}
.v39-task-board{display:grid;gap:8px;}
.v39-task-card{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px;align-items:center;padding:10px;border:1px solid var(--v39-line);border-radius:13px;background:linear-gradient(180deg,#fff,#f8fbff);}
.v39-task-card.done{opacity:.7;}.v39-task-card.priority-high{border-color:rgba(245,158,11,.32);}
.v39-task-card label{display:flex;align-items:center;gap:8px;font-size:12px;font-weight:950;color:var(--v39-text);min-width:0;}
.v39-task-card label span{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.v39-task-meta{grid-column:1/-1;display:flex;align-items:center;gap:6px;flex-wrap:wrap;color:var(--v39-muted);font-size:10px;font-weight:750;}
.v39-pill{height:21px;padding:0 7px;border-radius:999px;background:var(--v39-primary-soft);color:var(--v39-primary);display:inline-flex;align-items:center;font-size:9px;font-weight:950;text-transform:uppercase;}
.v39-pill.priority-high{background:rgba(245,158,11,.14);color:#d97706}.v39-pill.priority-low{background:rgba(100,116,139,.12);color:#64748b}
.v39-template-layout{display:grid;grid-template-columns:310px minmax(0,1fr);gap:12px;align-items:start;}
.v39-template-form{display:grid;gap:7px;position:sticky;top:10px;}
.v39-template-form label{font-size:10px;font-weight:950;color:var(--v39-muted);text-transform:uppercase;letter-spacing:.045em;}
.v39-template-form input,.v39-template-form select,.v39-template-form textarea{border:1px solid var(--v39-line);background:var(--v39-surface);color:var(--v39-text);border-radius:10px;font-size:11px;font-weight:800;padding:8px;}
.v39-template-form textarea{min-height:120px;resize:vertical;line-height:1.5;}
.v39-settings-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;}
.v39-settings-grid .settings-row{display:flex!important;align-items:center!important;justify-content:space-between!important;gap:12px!important;margin:0!important;}
.v39-settings-grid .settings-row.wide{grid-column:1/-1;}
.v39-settings-grid .settings-row b{font-size:12.5px;color:var(--v39-text);}.v39-settings-grid .settings-row small{display:block;margin-top:3px;font-size:10.5px;}
.v39-secondary-page .audit details{max-width:360px;}.v39-secondary-page .audit pre{max-height:180px;overflow:auto;font-size:10px;background:var(--v39-bg);border-radius:10px;padding:8px;border:1px solid var(--v39-line);}
body.dark .v39-panel-card,body.dark .v39-filter-card,body.dark .v39-mini-stats>div,body.dark .v39-list-card,body.dark .v39-task-card,body.dark .v39-secondary-note-grid .note-card,body.dark .v39-action-card,body.dark .v39-template-form input,body.dark .v39-template-form select,body.dark .v39-template-form textarea{background:var(--panel)!important;border-color:var(--border)!important;color:var(--text)!important;}
body.dark .v39-empty-block{background:rgba(15,23,42,.36);border-color:var(--border);}body.dark .v39-filter-card .v39-check{background:rgba(15,23,42,.3);border-color:var(--border);}
body.dark .v39-filter-card input,body.dark .v39-filter-card select{background:var(--panel);border-color:var(--border);color:var(--text);}body.dark .v39-list-card small,body.dark .v39-task-meta,body.dark .v39-page-head p,body.dark .v39-section-head p,body.dark .v39-section-head small{color:var(--muted)!important;}
@media(max-width:1320px){.v39-filter-card{grid-template-columns:repeat(3,minmax(0,1fr));}.v39-secondary-note-grid.note-grid{grid-template-columns:repeat(2,minmax(0,1fr));}.v39-template-layout{grid-template-columns:1fr}.v39-template-form{position:static}.v39-two-col{grid-template-columns:1fr}}
@media(max-width:760px){.v39-page-head{align-items:flex-start;flex-direction:column}.v39-filter-card{grid-template-columns:1fr}.v39-secondary-note-grid.note-grid{grid-template-columns:1fr}.v39-mini-stats{grid-template-columns:1fr}.v39-list-card,.v39-task-card{grid-template-columns:1fr}.v39-list-card.notification{grid-template-columns:10px minmax(0,1fr)}.v39-settings-grid{grid-template-columns:1fr}}


/* =========================================================
   v39.3.1 Chat UI Safe Hotfix
   Scope chat polish ONLY to chat markup. Do not touch .content, .topbar,
   dashboard, or global panel/card sizing so Beranda remains stable.
   ========================================================= */
.chat-layout.chat-layout-pro.chat-layout-preview-match{
  display:grid!important;
  grid-template-columns:260px minmax(480px,1fr) 270px!important;
  gap:10px!important;
  height:calc(100vh - 92px)!important;
  min-height:560px!important;
  overflow:hidden!important;
  align-items:stretch!important;
}
.chat-layout.chat-layout-pro.chat-layout-preview-match>*{min-width:0!important;min-height:0!important;}
.chat-layout-preview-match .chat-channels.chat-channels-pro,
.chat-layout-preview-match .chat-box.chat-box-pro,
.chat-layout-preview-match .chat-insights.chat-room-info-panel{
  height:100%!important;
  min-height:0!important;
  border-radius:16px!important;
  background:var(--v39-surface,#fff)!important;
  border:1px solid var(--v39-line,#dbe5f3)!important;
  box-shadow:0 8px 22px rgba(15,23,42,.04)!important;
  overflow:hidden!important;
}
.chat-layout-preview-match .chat-channels.chat-channels-pro{display:flex!important;flex-direction:column!important;padding:10px!important;}
.chat-layout-preview-match .chat-search-row{display:grid!important;grid-template-columns:minmax(0,1fr) 34px!important;gap:7px!important;margin:0 0 8px!important;padding:0!important;}
.chat-layout-preview-match .chat-search-box{height:34px!important;border-radius:999px!important;background:#f8fbff!important;border:1px solid var(--v39-line,#dbe5f3)!important;display:flex!important;align-items:center!important;gap:7px!important;padding:0 10px!important;color:var(--v39-muted,#64748b)!important;}
.chat-layout-preview-match .chat-search-box input{height:30px!important;border:0!important;background:transparent!important;padding:0!important;font-size:10.5px!important;min-width:0!important;}
.chat-layout-preview-match .new-chat-wrap{margin:0 0 8px!important;}
.chat-layout-preview-match .new-chat-btn{height:38px!important;border-radius:14px!important;font-size:11px!important;justify-content:center!important;}
.chat-layout-preview-match .chat-tabs{display:grid!important;grid-template-columns:repeat(4,minmax(0,1fr))!important;gap:5px!important;padding:0 0 9px!important;border-bottom:1px solid var(--v39-line,#dbe5f3)!important;}
.chat-layout-preview-match .chat-tabs button{height:34px!important;border-radius:11px!important;background:#f3f7ff!important;color:var(--v39-muted,#64748b)!important;font-size:9.6px!important;line-height:1.05!important;font-weight:900!important;padding:0 3px!important;display:grid!important;place-items:center!important;text-align:center!important;border:1px solid transparent!important;}
.chat-layout-preview-match .chat-tabs button.active{background:var(--v39-primary-soft,#eaf2ff)!important;color:var(--v39-primary,#2563eb)!important;border-color:rgba(37,99,235,.22)!important;}
.chat-layout-preview-match .chat-side-scroll{padding:8px 2px!important;overflow:auto!important;min-height:0!important;flex:1!important;}
.chat-layout-preview-match .chat-side-section h4{font-size:10.5px!important;margin:8px 4px 5px!important;text-transform:uppercase!important;letter-spacing:.06em!important;color:var(--v39-muted,#64748b)!important;}
.chat-layout-preview-match .chat-room-card{grid-template-columns:38px minmax(0,1fr) auto!important;gap:8px!important;padding:8px!important;margin:4px 0!important;border-radius:14px!important;border:1px solid transparent!important;}
.chat-layout-preview-match .chat-room-card:hover,
.chat-layout-preview-match .chat-room-card.active{background:var(--v39-primary-soft,#eaf2ff)!important;border-color:rgba(37,99,235,.18)!important;}
.chat-layout-preview-match .room-card-icon{width:34px!important;height:34px!important;border-radius:12px!important;font-size:15px!important;}
.chat-layout-preview-match .room-card-main b{font-size:11.5px!important;line-height:1.15!important;}
.chat-layout-preview-match .room-card-main small{font-size:9.6px!important;line-height:1.2!important;}
.chat-layout-preview-match .chat-template-card{display:none!important;}
.chat-layout-preview-match .chat-box.chat-box-pro{display:grid!important;grid-template-rows:auto minmax(0,1fr) auto!important;}
.chat-layout-preview-match .chat-room-head.chat-room-head-pro{padding:12px 14px!important;min-height:58px!important;border-bottom:1px solid var(--v39-line,#dbe5f3)!important;background:linear-gradient(180deg,#fff,#f8fbff)!important;}
.chat-layout-preview-match .room-title-icon{width:38px!important;height:38px!important;border-radius:13px!important;font-size:17px!important;}
.chat-layout-preview-match .room-title-block h2{font-size:14.5px!important;line-height:1.15!important;margin:0!important;}
.chat-layout-preview-match .room-title-block small{font-size:9.8px!important;}
.chat-layout-preview-match .room-icon-action{width:32px!important;height:32px!important;border-radius:11px!important;display:grid!important;place-items:center!important;font-size:12px!important;padding:0!important;}
.chat-layout-preview-match .messenger-list{height:auto!important;min-height:0!important;overflow:auto!important;padding:10px 16px!important;background:linear-gradient(180deg,#fbfdff,#fff)!important;border:0!important;border-radius:0!important;}
.chat-layout-preview-match .chat-row.mine{justify-content:flex-end!important;}
.chat-layout-preview-match .chat-message-stack{max-width:min(74%,620px)!important;min-width:0!important;}
.chat-layout-preview-match .chat-row.mine .chat-message-stack{align-items:flex-end!important;}
.chat-layout-preview-match .chat-sender-line{font-size:10px!important;color:var(--v39-muted,#64748b)!important;margin:0 4px 3px!important;display:flex!important;align-items:center!important;gap:6px!important;}
.chat-layout-preview-match .chat-bubble{border-radius:16px!important;padding:9px 11px!important;font-size:11px!important;line-height:1.45!important;border:1px solid var(--v39-line,#dbe5f3)!important;}
.chat-layout-preview-match .chat-row.mine .chat-bubble{background:#dbeafe!important;border-color:#bfdbfe!important;color:#0f172a!important;}
.chat-layout-preview-match .chat-foot{font-size:9px!important;gap:6px!important;margin-top:5px!important;opacity:.82!important;}
.chat-layout-preview-match .smart-compose-shell{padding:10px 12px 12px!important;border-top:1px solid var(--v39-line,#dbe5f3)!important;background:#fff!important;min-height:0!important;}
.chat-layout-preview-match .smart-composer-pro{border-radius:17px!important;box-shadow:none!important;border:1px solid #cbd5e1!important;padding:8px!important;}
.chat-layout-preview-match .smart-composer-pro textarea{min-height:54px!important;max-height:110px!important;height:54px!important;font-size:11px!important;line-height:1.35!important;padding:8px!important;}
.chat-layout-preview-match .smart-composer-pro .chat-compose-tools{padding-top:7px!important;display:flex!important;align-items:center!important;gap:6px!important;}
.chat-layout-preview-match .simplified-compose-tools .attach-chat-btn,
.chat-layout-preview-match .simplified-compose-tools .complaint-toggle{height:30px!important;border-radius:10px!important;font-size:10px!important;padding:0 9px!important;}
.chat-layout-preview-match .simplified-compose-tools .send-chat-btn{width:36px!important;height:36px!important;font-size:13px!important;}
.chat-layout-preview-match .chat-insights.chat-room-info-panel{overflow:auto!important;display:block!important;}
.chat-layout-preview-match .room-info-header{padding:12px!important;gap:9px!important;}
.chat-layout-preview-match .room-info-icon{width:38px!important;height:38px!important;border-radius:13px!important;font-size:16px!important;}
.chat-layout-preview-match .room-info-header h2{font-size:14px!important;margin:0!important;}
.chat-layout-preview-match .room-info-header small{font-size:10px!important;}
.chat-layout-preview-match .room-online-summary{padding:10px 12px!important;font-size:11px!important;}
.chat-layout-preview-match .room-panel-block,
.chat-layout-preview-match .complaint-summary{margin:10px 12px!important;padding:0 0 10px!important;background:transparent!important;}
.chat-layout-preview-match .room-panel-block h3,
.chat-layout-preview-match .complaint-summary h3{font-size:12px!important;margin:0 0 7px!important;}
body.dark .chat-layout-preview-match .chat-channels.chat-channels-pro,
body.dark .chat-layout-preview-match .chat-box.chat-box-pro,
body.dark .chat-layout-preview-match .chat-insights.chat-room-info-panel,
body.dark .chat-layout-preview-match .smart-compose-shell,
body.dark .chat-layout-preview-match .smart-composer-pro{background:var(--panel)!important;border-color:var(--border)!important;}
body.dark .chat-layout-preview-match .chat-search-box,
body.dark .chat-layout-preview-match .chat-tabs button{background:rgba(255,255,255,.04)!important;border-color:var(--border)!important;}
body.dark .chat-layout-preview-match .messenger-list{background:var(--panel)!important;}
body.dark .chat-layout-preview-match .chat-row.mine .chat-bubble{background:rgba(59,130,246,.18)!important;color:var(--text)!important;border-color:rgba(59,130,246,.28)!important;}
@media(max-width:1360px){.chat-layout.chat-layout-pro.chat-layout-preview-match{grid-template-columns:240px minmax(420px,1fr)!important}.chat-layout-preview-match .chat-insights.chat-room-info-panel{display:none!important;}}
@media(max-width:980px){.chat-layout.chat-layout-pro.chat-layout-preview-match{grid-template-columns:1fr!important;height:auto!important;min-height:0!important;overflow:visible!important}.chat-layout-preview-match .chat-channels.chat-channels-pro{height:auto!important;max-height:360px!important}.chat-layout-preview-match .chat-box.chat-box-pro{min-height:620px!important;height:calc(100vh - 120px)!important}}

/* =========================================================
   v39.3.2 Dashboard Layout Repair
   Fixes Beranda/Dashboard grid corruption caused by the old .wide grid-column
   class interacting with v39 dashboard wrapper. CSS-only and scoped.
   ========================================================= */
.view-home .v39-dashboard-wrap.dashboard-wrap,
.v39-dashboard-wrap.dashboard-wrap{
  display:flex!important;
  flex-direction:column!important;
  width:100%!important;
  max-width:none!important;
  min-width:0!important;
  gap:12px!important;
  align-items:stretch!important;
  grid-template-columns:none!important;
}
.view-home .v39-dashboard-wrap.dashboard-wrap > *,
.v39-dashboard-wrap.dashboard-wrap > *{
  grid-column:auto!important;
  width:100%!important;
  max-width:none!important;
  min-width:0!important;
}
.view-home .v39-dashboard-hero.dashboard-hero,
.v39-dashboard-hero.dashboard-hero{
  width:100%!important;
  max-width:none!important;
  grid-column:auto!important;
  flex:0 0 auto!important;
}
.view-home .v39-dashboard-stats.dashboard-stats,
.v39-dashboard-stats.dashboard-stats{
  display:grid!important;
  grid-template-columns:repeat(6,minmax(0,1fr))!important;
  gap:12px!important;
  width:100%!important;
  max-width:none!important;
  min-width:0!important;
  align-items:stretch!important;
}
.view-home .v39-stat.dashboard-stat,
.v39-stat.dashboard-stat{
  min-height:74px!important;
  height:auto!important;
  display:flex!important;
  flex-direction:row!important;
  align-items:center!important;
  justify-content:flex-start!important;
  gap:12px!important;
  width:auto!important;
}
.view-home .v39-stat-icon,
.v39-stat-icon{
  flex:0 0 38px!important;
  width:38px!important;
  height:38px!important;
}
.view-home .v39-stat-copy,
.v39-stat-copy{
  display:block!important;
  min-width:0!important;
  flex:1 1 auto!important;
}
.view-home .v39-dashboard-grid.dashboard-grid,
.v39-dashboard-grid.dashboard-grid{
  display:grid!important;
  grid-template-columns:minmax(0,1.08fr) minmax(320px,.92fr)!important;
  gap:12px!important;
  width:100%!important;
  max-width:none!important;
  min-width:0!important;
  align-items:stretch!important;
}
.view-home .v39-dashboard-panel.dashboard-panel,
.v39-dashboard-panel.dashboard-panel{
  width:100%!important;
  max-width:none!important;
  min-width:0!important;
}
.view-home .v39-dashboard-grid .v39-dashboard-panel:nth-child(1),
.v39-dashboard-grid .v39-dashboard-panel:nth-child(1){grid-column:1!important;grid-row:1!important;}
.view-home .v39-dashboard-grid .v39-dashboard-panel:nth-child(2),
.v39-dashboard-grid .v39-dashboard-panel:nth-child(2){grid-column:2!important;grid-row:1!important;}
.view-home .v39-dashboard-grid .v39-dashboard-panel:nth-child(3),
.v39-dashboard-grid .v39-dashboard-panel:nth-child(3){grid-column:1!important;grid-row:2!important;}
.view-home .v39-dashboard-grid .v39-dashboard-panel:nth-child(4),
.v39-dashboard-grid .v39-dashboard-panel:nth-child(4){grid-column:2!important;grid-row:2!important;}
.view-home .v39-note-grid.note-grid,
.v39-note-grid.note-grid{
  display:grid!important;
  grid-template-columns:repeat(3,minmax(0,1fr))!important;
  gap:9px!important;
}
@media(max-width:1320px){
  .view-home .v39-dashboard-stats.dashboard-stats,
  .v39-dashboard-stats.dashboard-stats{grid-template-columns:repeat(3,minmax(0,1fr))!important;}
  .view-home .v39-dashboard-grid.dashboard-grid,
  .v39-dashboard-grid.dashboard-grid{grid-template-columns:1fr!important;}
  .view-home .v39-dashboard-grid .v39-dashboard-panel,
  .v39-dashboard-grid .v39-dashboard-panel{grid-column:1!important;grid-row:auto!important;}
  .view-home .v39-note-grid.note-grid,
  .v39-note-grid.note-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important;}
}
@media(max-width:780px){
  .view-home .v39-dashboard-stats.dashboard-stats,
  .v39-dashboard-stats.dashboard-stats{grid-template-columns:repeat(2,minmax(0,1fr))!important;}
  .view-home .v39-note-grid.note-grid,
  .v39-note-grid.note-grid{grid-template-columns:1fr!important;}
}

/* v39.3.3 Notes notebook visibility hotfix */
.v39-notebook-picker-wrap{padding:24px;}
.v39-notebook-picker-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(180px,1fr));gap:12px;margin-top:18px;max-width:900px;margin-left:auto;margin-right:auto;}
.v39-notebook-picker-card{border:1px solid var(--border);background:var(--surface);border-radius:var(--radius-md);padding:14px;text-align:left;display:grid;gap:7px;cursor:pointer;box-shadow:var(--shadow-soft);color:var(--text);transition:.16s ease;}
.v39-notebook-picker-card:hover{transform:translateY(-1px);border-color:var(--primary);background:var(--primary-soft);}
.v39-notebook-picker-card span{width:32px;height:32px;border-radius:12px;background:var(--primary-soft);color:var(--primary);display:grid;place-items:center;}
.v39-notebook-picker-card svg{width:16px;height:16px;}
.v39-notebook-picker-card b{font-size:14px;line-height:1.2;}
.v39-notebook-picker-card small{font-size:11px;color:var(--muted);}

/* v39.3.4 Notebook flow refactor: keep sidebar clean and move notebooks to their own page */
.v39-sidebar .v39-notebooks-block{display:none!important;}
.v39-notebook-page{display:flex;flex-direction:column;gap:14px;}
.v39-notebook-overview{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:10px;}
.v39-notebook-overview>div{background:var(--surface,#fff);border:1px solid var(--border,#dbe5f3);border-radius:14px;padding:12px 14px;box-shadow:var(--shadow-soft,0 8px 24px rgba(15,23,42,.06));}
.v39-notebook-overview b{display:block;font-size:20px;color:var(--text,#14213d);line-height:1.1;}
.v39-notebook-overview small{display:block;color:var(--muted,#64748b);margin-top:4px;font-weight:700;}
.v39-notebook-category-panel{background:var(--surface,#fff);border:1px solid var(--border,#dbe5f3);border-radius:18px;padding:14px;box-shadow:var(--shadow-soft,0 8px 24px rgba(15,23,42,.06));}
.v39-notebook-category-panel .v39-section-head{margin-bottom:12px;align-items:flex-start;}
.v39-count-pill{display:inline-flex;align-items:center;justify-content:center;border:1px solid var(--border,#dbe5f3);background:var(--surface-soft,#f2f6ff);border-radius:999px;padding:5px 9px;font-size:12px;font-weight:800;color:var(--muted,#64748b);white-space:nowrap;}
.v39-notebook-library-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(250px,1fr));gap:10px;}
.v39-notebook-library-card{appearance:none;border:1px solid var(--border,#dbe5f3);background:var(--surface,#fff);border-radius:15px;padding:12px;display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:11px;text-align:left;cursor:pointer;color:var(--text,#14213d);transition:.16s ease;min-height:70px;}
.v39-notebook-library-card:hover{border-color:var(--primary,#2563eb);box-shadow:0 10px 26px rgba(37,99,235,.10);transform:translateY(-1px);}
.v39-notebook-library-card.active{border-color:var(--primary,#2563eb);background:var(--primary-soft,#eaf2ff);}
.v39-nb-lib-icon{width:38px;height:38px;border-radius:12px;display:flex;align-items:center;justify-content:center;background:var(--primary-soft,#eaf2ff);color:var(--primary,#2563eb);}
.v39-nb-lib-icon .ui-icon{width:18px;height:18px;}
.v39-nb-lib-main{min-width:0;display:flex;flex-direction:column;gap:4px;}
.v39-nb-lib-main b{font-size:14px;line-height:1.15;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.v39-nb-lib-main small{font-size:11px;color:var(--muted,#64748b);font-weight:700;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.v39-nb-lib-badge{font-size:10px;font-weight:900;letter-spacing:.04em;border-radius:999px;padding:5px 7px;background:var(--surface-soft,#f2f6ff);color:var(--muted,#64748b);border:1px solid var(--border,#dbe5f3);}
.v39-nb-lib-badge.admin{background:rgba(79,70,229,.10);color:#4f46e5;border-color:rgba(79,70,229,.18);}
.v39-nb-lib-badge.private{background:rgba(245,158,11,.12);color:#b45309;border-color:rgba(245,158,11,.22);}
.v39-nb-lib-badge.public{background:rgba(16,185,129,.12);color:#047857;border-color:rgba(16,185,129,.22);}
[data-theme="dark"] .v39-notebook-library-card,[data-theme="dark"] .v39-notebook-category-panel,[data-theme="dark"] .v39-notebook-overview>div{background:var(--surface,#111827);border-color:var(--border,#334155);}
@media(max-width:900px){.v39-notebook-overview{grid-template-columns:repeat(2,minmax(0,1fr));}.v39-notebook-library-grid{grid-template-columns:1fr;}}


/* v39.3.5 sidebar cleanup + safe expand + notebook back button */
.v39-sidebar-actions{display:none!important;}
.v39-sidebar-bottom-toggle{margin-top:auto!important;padding-top:10px!important;border-top:1px solid var(--v39-line)!important;display:flex!important;justify-content:center!important;background:linear-gradient(to top,var(--v39-surface) 80%,rgba(255,255,255,0))!important;}
.v39-sidebar-expand-btn{height:34px!important;min-width:34px!important;border-radius:12px!important;border:1px solid var(--v39-line)!important;background:var(--v39-surface)!important;color:var(--v39-text)!important;display:flex!important;align-items:center!important;justify-content:center!important;gap:6px!important;padding:0 10px!important;font-weight:900!important;box-shadow:0 8px 20px rgba(15,23,42,.06)!important;}
.v39-sidebar-expand-btn:hover{background:var(--v39-primary-soft)!important;color:var(--v39-primary)!important;border-color:rgba(37,99,235,.22)!important;}
.v39-sidebar-expand-btn span{font-size:15px!important;line-height:1!important;}
.v39-sidebar-expand-btn b{font-size:10px!important;line-height:1!important;}
.sidebar-collapsed .v39-sidebar-bottom-toggle{display:flex!important;visibility:visible!important;width:100%!important;padding-top:8px!important;border-top:0!important;margin-top:auto!important;background:transparent!important;}
.sidebar-collapsed .v39-sidebar-expand-btn{width:38px!important;height:38px!important;min-width:38px!important;padding:0!important;border-radius:13px!important;}
.sidebar-collapsed .v39-sidebar-expand-btn b{display:none!important;}
.sidebar-collapsed .v39-sidebar-expand-btn span{font-size:20px!important;}
.notebook-card-head-v3846{position:relative!important;}
.notebook-back-btn-v3935{position:absolute!important;top:14px!important;left:14px!important;z-index:4!important;width:27px!important;height:27px!important;border-radius:9px!important;border:1px solid var(--v39-line)!important;background:var(--v39-surface)!important;color:var(--v39-muted)!important;display:grid!important;place-items:center!important;font-size:14px!important;font-weight:950!important;box-shadow:0 6px 16px rgba(15,23,42,.06)!important;}
.notebook-back-btn-v3935:hover{background:var(--v39-primary-soft)!important;color:var(--v39-primary)!important;border-color:rgba(37,99,235,.24)!important;}
.notebook-card-title-line-v3846{padding-left:32px!important;}
body.dark .v39-sidebar-bottom-toggle{background:linear-gradient(to top,var(--v39-surface) 80%,rgba(15,23,42,0))!important;}
body.dark .v39-sidebar-expand-btn,body.dark .notebook-back-btn-v3935{background:var(--panel)!important;border-color:var(--border)!important;color:var(--text)!important;}
body.dark .v39-sidebar-expand-btn:hover,body.dark .notebook-back-btn-v3935:hover{background:var(--v39-primary-soft)!important;color:var(--v39-primary)!important;}
@media(max-width:880px){.notebook-card-title-line-v3846{padding-left:30px!important}.notebook-back-btn-v3935{top:12px!important;left:12px!important}}


/* v39.3.6 notebook header redesign */
.notebook-card-head-v3846{
  padding:10px!important;
  background:linear-gradient(180deg,rgba(248,251,255,.88),rgba(255,255,255,.96))!important;
}
.notebook-card-main-v3846{
  position:relative!important;
  display:grid!important;
  grid-template-columns:minmax(0,1fr)!important;
  gap:12px!important;
  padding:14px!important;
  border-radius:16px!important;
  border:1px solid var(--v39-line)!important;
  background:var(--v39-surface)!important;
  box-shadow:0 10px 24px rgba(15,23,42,.05)!important;
}
.notebook-back-btn-v3935{
  position:absolute!important;
  top:14px!important;
  left:14px!important;
  width:30px!important;
  height:30px!important;
  border-radius:10px!important;
  border:1px solid var(--v39-line)!important;
  background:var(--v39-surface)!important;
  color:var(--v39-muted)!important;
  display:grid!important;
  place-items:center!important;
  font-size:14px!important;
  font-weight:900!important;
  box-shadow:0 6px 16px rgba(15,23,42,.06)!important;
}
.notebook-back-btn-v3935:hover{
  background:var(--v39-primary-soft)!important;
  border-color:rgba(37,99,235,.20)!important;
  color:var(--v39-primary)!important;
}
.notebook-category-badge-v3846{
  position:absolute!important;
  top:14px!important;
  right:14px!important;
  border-radius:999px!important;
  padding:6px 10px!important;
  font-size:10px!important;
  line-height:1!important;
  font-weight:900!important;
}
.notebook-card-title-line-v3846{
  display:grid!important;
  grid-template-columns:42px minmax(0,1fr)!important;
  align-items:center!important;
  gap:12px!important;
  padding-top:28px!important;
}
.notebook-card-icon-v3846{
  width:42px!important;
  height:42px!important;
  border-radius:14px!important;
  box-shadow:none!important;
}
.notebook-card-icon-v3846:before{font-size:16px!important;}
.notebook-card-title-v3846{gap:4px!important;align-content:center!important;}
.notebook-card-title-v3846 h2{
  font-size:16px!important;
  line-height:1.1!important;
  font-weight:900!important;
  letter-spacing:-.03em!important;
}
.notebook-card-title-v3846 small{
  font-size:11.5px!important;
  color:var(--v39-muted)!important;
  font-weight:800!important;
}
.notebook-card-actions-v3846{
  display:flex!important;
  align-items:center!important;
  justify-content:flex-start!important;
  gap:10px!important;
  padding-top:2px!important;
}
.notebook-action-btn-v3846{
  width:36px!important;
  height:34px!important;
  min-width:36px!important;
  border-radius:11px!important;
  background:var(--v39-surface)!important;
  border:1px solid var(--v39-line)!important;
  color:var(--v39-muted)!important;
}
.notebook-action-btn-v3846 .nb-action-symbol{font-size:14px!important;}
.notebook-action-btn-v3846:hover{
  background:var(--v39-primary-soft)!important;
  border-color:rgba(37,99,235,.20)!important;
  color:var(--v39-primary)!important;
}
.notebook-action-btn-v3846.danger-action-v3846{
  color:#b91c1c!important;
  border-color:#f3d0d0!important;
  background:var(--v39-surface)!important;
}
.notebook-action-btn-v3846.danger-action-v3846:hover{
  background:#fef2f2!important;
  border-color:#fecaca!important;
  color:#991b1b!important;
}
@media (max-width: 880px){
  .notebook-card-main-v3846{padding:12px!important;border-radius:14px!important;}
  .notebook-back-btn-v3935{top:12px!important;left:12px!important;}
  .notebook-category-badge-v3846{top:12px!important;right:12px!important;}
  .notebook-card-title-line-v3846{padding-top:28px!important;grid-template-columns:40px minmax(0,1fr)!important;gap:10px!important;}
  .notebook-card-icon-v3846{width:40px!important;height:40px!important;}
}


/* v39.3.7 notebook header redesign v2 */
.notebook-card-head-v3846{
  padding:10px!important;
  background:linear-gradient(180deg,rgba(248,251,255,.88),rgba(255,255,255,.96))!important;
}
.notebook-card-main-v3846{
  position:relative!important;
  display:grid!important;
  grid-template-columns:1fr!important;
  gap:14px!important;
  padding:16px!important;
  border-radius:16px!important;
  border:1px solid var(--v39-line)!important;
  background:var(--v39-surface)!important;
  box-shadow:0 10px 24px rgba(15,23,42,.045)!important;
}
.notebook-back-btn-v3935{
  position:absolute!important;
  top:16px!important;
  left:16px!important;
  width:30px!important;height:30px!important;min-width:30px!important;
  display:grid!important;place-items:center!important;
  border-radius:10px!important;
  border:1px solid var(--v39-line)!important;
  background:var(--v39-surface)!important;
  color:var(--v39-muted)!important;
  font-size:14px!important;font-weight:900!important;
  box-shadow:0 6px 16px rgba(15,23,42,.05)!important;
}
.notebook-back-btn-v3935:hover{background:var(--v39-primary-soft)!important;color:var(--v39-primary)!important;border-color:rgba(37,99,235,.20)!important;}
.notebook-category-badge-v3846{
  position:absolute!important;
  top:16px!important;
  right:16px!important;
  display:inline-flex!important;align-items:center!important;justify-content:center!important;
  padding:6px 10px!important;
  min-height:28px!important;
  border-radius:999px!important;
  font-size:10px!important;
  font-weight:900!important;
  letter-spacing:.06em!important;
  text-transform:uppercase!important;
}
.notebook-card-title-line-v3846{
  display:block!important;
  padding-top:34px!important;
}
.notebook-card-icon-v3846{display:none!important;}
.notebook-card-title-v3846{
  display:grid!important;
  gap:5px!important;
  min-width:0!important;
}
.notebook-card-title-v3846 h2{
  margin:0!important;
  font-size:20px!important;
  line-height:1.1!important;
  font-weight:900!important;
  letter-spacing:-.03em!important;
  color:var(--v39-text)!important;
  white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important;
}
.notebook-card-title-v3846 small{
  margin:0!important;
  font-size:12px!important;
  line-height:1.25!important;
  font-weight:800!important;
  color:var(--v39-muted)!important;
}
.notebook-card-actions-v3846{
  display:flex!important;
  align-items:center!important;
  justify-content:flex-start!important;
  gap:10px!important;
  padding-top:2px!important;
}
.notebook-action-btn-v3846{
  width:36px!important;
  height:36px!important;
  min-width:36px!important;
  border-radius:12px!important;
  display:grid!important;place-items:center!important;
  background:var(--v39-surface)!important;
  border:1px solid var(--v39-line)!important;
  color:var(--v39-muted)!important;
}
.notebook-action-btn-v3846 .nb-action-symbol{font-size:14px!important;line-height:1!important;}
.notebook-action-btn-v3846 span:not(.nb-action-symbol){display:none!important;}
.notebook-action-btn-v3846:hover{background:var(--v39-primary-soft)!important;color:var(--v39-primary)!important;border-color:rgba(37,99,235,.20)!important;}
.notebook-action-btn-v3846.danger-action-v3846{color:#b91c1c!important;border-color:#f3d0d0!important;}
.notebook-action-btn-v3846.danger-action-v3846:hover{background:#fef2f2!important;color:#991b1b!important;border-color:#fecaca!important;}
body.dark .notebook-back-btn-v3935,body.dark .notebook-action-btn-v3846{background:var(--panel)!important;border-color:var(--border)!important;color:var(--text)!important;}
body.dark .notebook-back-btn-v3935:hover,body.dark .notebook-action-btn-v3846:hover{background:var(--v39-primary-soft)!important;color:var(--v39-primary)!important;}
body.dark .notebook-action-btn-v3846.danger-action-v3846{color:#fca5a5!important;}
@media (max-width:880px){
  .notebook-card-main-v3846{padding:14px!important;}
  .notebook-back-btn-v3935{top:14px!important;left:14px!important;}
  .notebook-category-badge-v3846{top:14px!important;right:14px!important;}
  .notebook-card-title-line-v3846{padding-top:34px!important;}
  .notebook-card-title-v3846 h2{font-size:18px!important;}
}


/* v39.3.8 notebook header clean redesign */
.notebook-card-head-v3938{
  padding:10px!important;
  background:linear-gradient(180deg,rgba(248,251,255,.90),rgba(255,255,255,.98))!important;
  border-bottom:1px solid var(--v39-line)!important;
  flex:0 0 auto!important;
}
.notebook-card-main-v3938{
  display:grid!important;
  gap:13px!important;
  padding:15px!important;
  border:1px solid var(--v39-line)!important;
  border-radius:16px!important;
  background:var(--v39-surface)!important;
  box-shadow:0 10px 24px rgba(15,23,42,.05)!important;
}
.notebook-card-title-line-v3938{
  display:grid!important;
  gap:6px!important;
  min-width:0!important;
}
.notebook-card-title-line-v3938 h2{
  margin:0!important;
  color:var(--v39-text)!important;
  font-size:20px!important;
  line-height:1.1!important;
  font-weight:920!important;
  letter-spacing:-.035em!important;
  white-space:nowrap!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
}
.notebook-card-meta-v3938{
  display:flex!important;
  align-items:center!important;
  justify-content:space-between!important;
  gap:10px!important;
  min-width:0!important;
}
.notebook-card-meta-v3938 small{
  color:var(--v39-muted)!important;
  font-size:12px!important;
  line-height:1.2!important;
  font-weight:800!important;
}
.notebook-category-badge-v3938{
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  flex:0 0 auto!important;
  border-radius:999px!important;
  padding:6px 10px!important;
  min-height:25px!important;
  font-size:10px!important;
  line-height:1!important;
  font-weight:920!important;
  letter-spacing:.065em!important;
  text-transform:uppercase!important;
  color:var(--v39-primary)!important;
  background:var(--v39-primary-soft)!important;
  border:1px solid rgba(37,99,235,.16)!important;
}
.notebook-category-badge-v3938.private,
.notebook-category-badge-v3938.pribadi,
.notebook-category-badge-v3938.public,
.notebook-category-badge-v3938.publik,
.notebook-category-badge-v3938.admin{
  color:var(--v39-primary)!important;
  background:var(--v39-primary-soft)!important;
  border-color:rgba(37,99,235,.16)!important;
}
.notebook-card-actions-v3938{
  display:flex!important;
  align-items:center!important;
  justify-content:flex-start!important;
  gap:10px!important;
  padding-top:1px!important;
}
.notebook-action-btn-v3938{
  width:36px!important;
  height:36px!important;
  min-width:36px!important;
  display:grid!important;
  place-items:center!important;
  border-radius:12px!important;
  border:1px solid var(--v39-line)!important;
  background:var(--v39-surface)!important;
  color:var(--v39-muted)!important;
  box-shadow:none!important;
}
.notebook-action-btn-v3938 .nb-action-symbol{
  font-size:18px!important;
  line-height:1!important;
  font-weight:900!important;
  color:currentColor!important;
}
.notebook-action-btn-v3938 span:not(.nb-action-symbol){display:none!important;}
.notebook-action-btn-v3938:hover{
  background:var(--v39-primary-soft)!important;
  border-color:rgba(37,99,235,.22)!important;
  color:var(--v39-primary)!important;
}
.notebook-action-btn-v3938.danger-action-v3938{
  color:#b91c1c!important;
  border-color:#efd5d5!important;
}
.notebook-action-btn-v3938.danger-action-v3938:hover{
  background:#fef2f2!important;
  border-color:#fecaca!important;
  color:#991b1b!important;
}
.note-list-footer-v3938{
  flex:0 0 auto!important;
  padding:8px 10px 10px!important;
  border-top:1px solid var(--v39-line)!important;
  background:var(--v39-surface)!important;
}
.note-list-collapse-btn-v3938{
  width:100%!important;
  min-height:34px!important;
  border-radius:12px!important;
  border:1px solid var(--v39-line)!important;
  background:var(--v39-surface)!important;
  color:var(--v39-muted)!important;
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  gap:8px!important;
  font-size:11.5px!important;
  font-weight:850!important;
}
.note-list-collapse-btn-v3938 span{font-size:14px!important;line-height:1!important;}
.note-list-collapse-btn-v3938:hover{
  background:var(--v39-primary-soft)!important;
  border-color:rgba(37,99,235,.22)!important;
  color:var(--v39-primary)!important;
}
body.dark .notebook-card-head-v3938,
body.dark .note-list-footer-v3938{
  background:var(--panel)!important;
  border-color:var(--border)!important;
}
body.dark .notebook-card-main-v3938,
body.dark .notebook-action-btn-v3938,
body.dark .note-list-collapse-btn-v3938{
  background:var(--panel)!important;
  border-color:var(--border)!important;
  color:var(--text)!important;
}
body.dark .notebook-action-btn-v3938:hover,
body.dark .note-list-collapse-btn-v3938:hover{
  background:var(--v39-primary-soft)!important;
  color:var(--v39-primary)!important;
}
body.dark .notebook-action-btn-v3938.danger-action-v3938{color:#fca5a5!important;}
@media(max-width:880px){
  .notebook-card-main-v3938{padding:13px!important;border-radius:14px!important;}
  .notebook-card-title-line-v3938 h2{font-size:18px!important;}
  .notebook-card-actions-v3938{gap:8px!important;}
  .notebook-action-btn-v3938{width:34px!important;height:34px!important;min-width:34px!important;}
}


/* v39.3.9 clean notebook action icons + sticky note-list collapse */
.notebook-card-actions-v3938{
  display:flex!important;
  align-items:center!important;
  justify-content:flex-start!important;
  gap:10px!important;
}
.notebook-action-btn-v3938{
  width:36px!important;
  height:36px!important;
  min-width:36px!important;
  border-radius:12px!important;
  display:grid!important;
  place-items:center!important;
}
.notebook-action-btn-v3938 svg{
  width:17px!important;
  height:17px!important;
  stroke:currentColor!important;
  stroke-width:2!important;
  fill:none!important;
}
.notebook-action-btn-v3938 span:not(.nb-action-symbol){display:none!important;}

.note-list-expanded-v384{
  display:flex!important;
  flex-direction:column!important;
  min-height:0!important;
  height:100%!important;
}
.notes-list-v3845{
  flex:1 1 auto!important;
  min-height:0!important;
  overflow:auto!important;
  padding-bottom:10px!important;
}
.note-list-footer-v3938{
  position:sticky!important;
  bottom:0!important;
  z-index:10!important;
  flex:0 0 auto!important;
  padding:8px 10px 10px!important;
  border-top:1px solid var(--v39-line)!important;
  background:linear-gradient(180deg,rgba(255,255,255,.92),var(--v39-surface))!important;
  box-shadow:0 -10px 18px rgba(15,23,42,.045)!important;
}
.note-list-collapse-btn-v3938{
  width:100%!important;
  min-height:34px!important;
  border-radius:12px!important;
  border:1px solid var(--v39-line)!important;
  background:var(--v39-surface)!important;
  color:var(--v39-muted)!important;
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  gap:8px!important;
  font-size:11.5px!important;
  font-weight:850!important;
}
.note-list-collapse-btn-v3938 svg{
  width:15px!important;
  height:15px!important;
  stroke:currentColor!important;
  stroke-width:2!important;
}
.note-list-collapse-btn-v3938:hover{
  background:var(--v39-primary-soft)!important;
  border-color:rgba(37,99,235,.22)!important;
  color:var(--v39-primary)!important;
}
body.dark .note-list-footer-v3938{
  background:linear-gradient(180deg,rgba(17,24,39,.86),var(--panel))!important;
  border-color:var(--border)!important;
}
body.dark .note-list-collapse-btn-v3938{
  background:var(--panel)!important;
  border-color:var(--border)!important;
  color:var(--text)!important;
}
body.dark .note-list-collapse-btn-v3938:hover{
  background:var(--v39-primary-soft)!important;
  color:var(--v39-primary)!important;
}


/* v39.3.10 definitive icon fix + bottom fixed note-list collapse */
.notebook-action-btn-v3938 svg{
  width:18px!important;
  height:18px!important;
  stroke:currentColor!important;
  stroke-width:2.15!important;
  fill:none!important;
}
.notebook-action-btn-v3938 span:not(.nb-action-symbol){display:none!important;}
.note-list-final{position:relative!important;}
.note-list-expanded-v384{
  position:relative!important;
  display:flex!important;
  flex-direction:column!important;
  min-height:0!important;
  height:100%!important;
  padding-bottom:54px!important;
}
.notes-list-v3845{
  flex:1 1 auto!important;
  min-height:0!important;
  overflow:auto!important;
  padding-bottom:14px!important;
}
.note-list-footer-v39310{
  position:absolute!important;
  left:10px!important;
  right:10px!important;
  bottom:10px!important;
  z-index:30!important;
  padding:0!important;
  pointer-events:auto!important;
}
.note-list-collapse-btn-v39310{
  width:100%!important;
  height:38px!important;
  border-radius:13px!important;
  border:1px solid var(--v39-line)!important;
  background:rgba(255,255,255,.96)!important;
  color:var(--v39-muted)!important;
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  gap:8px!important;
  font-size:11.5px!important;
  font-weight:900!important;
  box-shadow:0 10px 24px rgba(15,23,42,.12)!important;
  backdrop-filter:blur(8px)!important;
}
.note-list-collapse-btn-v39310 svg{
  width:16px!important;
  height:16px!important;
  stroke:currentColor!important;
  stroke-width:2.15!important;
  fill:none!important;
}
.note-list-collapse-btn-v39310:hover{
  background:var(--v39-primary-soft)!important;
  border-color:rgba(37,99,235,.25)!important;
  color:var(--v39-primary)!important;
}
body.dark .note-list-collapse-btn-v39310{
  background:rgba(17,24,39,.96)!important;
  border-color:var(--border)!important;
  color:var(--text)!important;
}
body.dark .note-list-collapse-btn-v39310:hover{
  background:var(--v39-primary-soft)!important;
  color:var(--v39-primary)!important;
}

/* v39.4 Admin + Chat Polish - scoped, safe CSS only */
/* Chat page */
.chat-layout-pro{
  display:grid!important;
  grid-template-columns:minmax(220px,260px) minmax(0,1fr) minmax(240px,300px)!important;
  gap:12px!important;
  height:calc(100vh - 112px)!important;
  min-height:520px!important;
  overflow:hidden!important;
  padding:0!important;
}
.chat-layout-pro > .panel{
  border:1px solid var(--v39-line)!important;
  border-radius:16px!important;
  background:var(--v39-surface)!important;
  box-shadow:0 10px 26px rgba(15,23,42,.045)!important;
  overflow:hidden!important;
}
.chat-channels-pro{
  display:flex!important;
  flex-direction:column!important;
  min-height:0!important;
  padding:12px!important;
  gap:10px!important;
}
.chat-search-row{display:flex!important;gap:8px!important;align-items:center!important;}
.chat-search-box{height:36px!important;display:flex!important;align-items:center!important;gap:7px!important;flex:1!important;border:1px solid var(--v39-line)!important;border-radius:13px!important;background:#f8fbff!important;padding:0 10px!important;color:var(--v39-muted)!important;font-size:12px!important;}
.chat-search-box input{border:0!important;background:transparent!important;outline:0!important;width:100%!important;font-size:12px!important;color:var(--v39-text)!important;}
.filter-chip{width:36px!important;height:36px!important;border-radius:12px!important;border:1px solid var(--v39-line)!important;background:var(--v39-surface)!important;color:var(--v39-muted)!important;}
.new-chat-wrap{position:relative!important;}
.new-chat-btn{height:39px!important;border-radius:14px!important;display:flex!important;align-items:center!important;justify-content:center!important;gap:8px!important;font-size:12px!important;font-weight:900!important;}
.new-chat-menu{position:absolute!important;left:0!important;right:0!important;top:calc(100% + 8px)!important;background:var(--v39-surface)!important;border:1px solid var(--v39-line)!important;border-radius:14px!important;box-shadow:0 18px 36px rgba(15,23,42,.12)!important;z-index:30!important;padding:8px!important;}
.new-chat-menu button{width:100%!important;display:flex!important;gap:9px!important;align-items:center!important;text-align:left!important;border:0!important;background:transparent!important;border-radius:10px!important;padding:9px!important;color:var(--v39-text)!important;}
.new-chat-menu button:hover{background:var(--v39-primary-soft)!important;color:var(--v39-primary)!important;}
.chat-tabs{display:grid!important;grid-template-columns:repeat(4,1fr)!important;gap:6px!important;}
.chat-tabs button{min-height:38px!important;border-radius:11px!important;border:1px solid var(--v39-line)!important;background:#f8fbff!important;color:var(--v39-muted)!important;font-size:10.5px!important;font-weight:850!important;padding:5px!important;}
.chat-tabs button.active{background:var(--v39-primary-soft)!important;border-color:rgba(37,99,235,.24)!important;color:var(--v39-primary)!important;}
.chat-tabs button b{display:block!important;font-size:10px!important;margin-top:2px!important;}
.chat-side-scroll{flex:1 1 auto!important;min-height:0!important;overflow:auto!important;padding-right:3px!important;}
.chat-side-section{display:grid!important;gap:7px!important;margin:10px 0!important;}
.chat-side-section h4{font-size:11px!important;letter-spacing:.04em!important;text-transform:uppercase!important;color:var(--v39-muted)!important;margin:0 0 2px!important;}
.chat-room-card{width:100%!important;display:grid!important;grid-template-columns:40px minmax(0,1fr) auto!important;align-items:center!important;gap:9px!important;border:1px solid transparent!important;border-radius:14px!important;background:transparent!important;padding:8px!important;text-align:left!important;color:var(--v39-text)!important;}
.chat-room-card:hover{background:#f8fbff!important;border-color:var(--v39-line)!important;}
.chat-room-card.active{background:var(--v39-primary-soft)!important;border-color:rgba(37,99,235,.22)!important;}
.chat-room-card .room-icon,.room-title-icon{width:40px!important;height:40px!important;border-radius:13px!important;background:var(--v39-primary-soft)!important;color:var(--v39-primary)!important;display:grid!important;place-items:center!important;}
.chat-room-card b{font-size:12px!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important;display:block!important;}
.chat-room-card small{font-size:10.5px!important;color:var(--v39-muted)!important;display:block!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important;}
.chat-template-card{border:1px solid var(--v39-line)!important;border-radius:15px!important;background:#f8fbff!important;padding:11px!important;display:grid!important;gap:6px!important;}
.chat-template-card b{font-size:12px!important;}.chat-template-card small{font-size:10.5px!important;color:var(--v39-muted)!important;}.chat-template-card .small-btn{height:32px!important;border-radius:10px!important;font-size:11px!important;}
.chat-box-pro{display:grid!important;grid-template-rows:auto auto minmax(0,1fr) auto!important;min-width:0!important;}
.chat-room-head-pro{height:auto!important;min-height:66px!important;padding:12px 14px!important;border-bottom:1px solid var(--v39-line)!important;background:linear-gradient(180deg,#fff,#f8fbff)!important;display:flex!important;align-items:center!important;justify-content:space-between!important;gap:12px!important;}
.room-title-block{display:flex!important;align-items:center!important;gap:10px!important;min-width:0!important;}
.room-title-block h2{font-size:16px!important;line-height:1.1!important;margin:0!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important;}.room-title-block small{font-size:10.5px!important;}.online-green{color:#059669!important;}
.chat-head-actions{display:flex!important;gap:7px!important;align-items:center!important;}
.room-icon-action{width:34px!important;height:34px!important;border-radius:11px!important;border:1px solid var(--v39-line)!important;background:var(--v39-surface)!important;color:var(--v39-muted)!important;display:grid!important;place-items:center!important;font-size:13px!important;}
.room-icon-action:hover{background:var(--v39-primary-soft)!important;color:var(--v39-primary)!important;border-color:rgba(37,99,235,.22)!important;}.room-icon-action.danger-icon:hover{background:#fef2f2!important;color:#b91c1c!important;border-color:#fecaca!important;}
.messenger-list{min-height:0!important;overflow:auto!important;padding:14px!important;background:#f8fafc!important;display:flex!important;flex-direction:column!important;gap:8px!important;}
.date-pill{align-self:center!important;background:var(--v39-surface)!important;border:1px solid var(--v39-line)!important;color:var(--v39-muted)!important;border-radius:999px!important;padding:4px 10px!important;font-size:10.5px!important;font-weight:800!important;}
.chat-row{display:flex!important;gap:8px!important;align-items:flex-end!important;max-width:82%!important;}.chat-row.mine{align-self:flex-end!important;flex-direction:row-reverse!important;}.chat-row.theirs{align-self:flex-start!important;}
.chat-avatar{width:28px!important;height:28px!important;border-radius:50%!important;background:var(--v39-primary-soft)!important;color:var(--v39-primary)!important;display:grid!important;place-items:center!important;font-size:11px!important;font-weight:900!important;}
.chat-message-stack{display:grid!important;gap:4px!important;min-width:0!important;}.chat-sender-line{display:flex!important;align-items:center!important;gap:7px!important;font-size:10.5px!important;color:var(--v39-muted)!important;}.chat-sender-line .chat-menu-trigger{margin-left:auto!important;}
.chat-bubble{border:1px solid var(--v39-line)!important;border-radius:15px!important;background:var(--v39-surface)!important;padding:9px 11px!important;box-shadow:0 5px 16px rgba(15,23,42,.04)!important;color:var(--v39-text)!important;}.chat-row.mine .chat-bubble{background:#dbeafe!important;border-color:#bfdbfe!important;}
.chat-body{font-size:12px!important;line-height:1.45!important;}.chat-foot{display:flex!important;gap:8px!important;align-items:center!important;justify-content:flex-end!important;color:var(--v39-muted)!important;font-size:9.5px!important;margin-top:5px!important;}
.smart-compose-shell{padding:12px!important;border-top:1px solid var(--v39-line)!important;background:var(--v39-surface)!important;}.smart-composer-pro{border:1px solid var(--v39-line)!important;border-radius:16px!important;overflow:hidden!important;background:var(--v39-surface)!important;}.smart-composer-pro textarea{width:100%!important;min-height:72px!important;max-height:150px!important;border:0!important;outline:0!important;resize:none!important;padding:12px!important;background:transparent!important;color:var(--v39-text)!important;font-size:12px!important;}.simplified-compose-tools{display:flex!important;align-items:center!important;gap:8px!important;border-top:1px solid var(--v39-line)!important;padding:8px!important;background:#f8fbff!important;}.attach-chat-btn,.complaint-toggle{min-height:32px!important;border-radius:11px!important;border:1px solid var(--v39-line)!important;background:var(--v39-surface)!important;color:var(--v39-text)!important;padding:0 10px!important;display:inline-flex!important;align-items:center!important;gap:6px!important;font-size:11px!important;font-weight:800!important;}.send-chat-btn{margin-left:auto!important;width:38px!important;height:38px!important;border-radius:50%!important;padding:0!important;display:grid!important;place-items:center!important;}
.chat-room-info-panel{display:flex!important;flex-direction:column!important;gap:10px!important;padding:12px!important;min-height:0!important;overflow:auto!important;}.room-info-card,.room-panel-block{border:1px solid var(--v39-line)!important;border-radius:15px!important;background:var(--v39-surface)!important;padding:12px!important;}.room-info-card h2{font-size:15px!important;margin:0!important;}.room-info-card small{font-size:10.5px!important;}.room-panel-block h3{font-size:12px!important;margin:0 0 8px!important;}.room-info-item{display:flex!important;gap:9px!important;align-items:center!important;padding:8px 0!important;border-bottom:1px solid var(--v39-line)!important;}.room-info-item:last-child{border-bottom:0!important;}

/* Admin/User Management polish */
.user-admin-grid{display:grid!important;grid-template-columns:minmax(290px,360px) minmax(0,1fr)!important;grid-template-areas:'create summary' 'create pending' 'users users'!important;gap:14px!important;align-items:start!important;}
.user-create-card{grid-area:create!important;position:sticky!important;top:12px!important;border:1px solid var(--v39-line)!important;border-radius:18px!important;box-shadow:0 10px 26px rgba(15,23,42,.045)!important;padding:16px!important;background:var(--v39-surface)!important;}.user-create-card h2,.admin-summary-card h2,.pending-card h2,.users-table-card h2{font-size:16px!important;margin:0 0 6px!important;}.user-create-card .muted{font-size:11px!important;line-height:1.4!important;}.form-grid.two{display:grid!important;grid-template-columns:1fr 1fr!important;gap:10px!important;}.user-create-card label{font-size:11px!important;font-weight:850!important;color:var(--v39-muted)!important;display:grid!important;gap:5px!important;}.user-create-card input,.user-create-card select,.user-create-card textarea,.admin-filter-grid input,.admin-filter-grid select{min-height:34px!important;border:1px solid var(--v39-line)!important;border-radius:11px!important;background:#f8fbff!important;color:var(--v39-text)!important;padding:7px 9px!important;font-size:12px!important;}.user-create-card textarea{min-height:74px!important;resize:vertical!important;}.user-create-card .primary{width:100%!important;height:38px!important;border-radius:13px!important;margin-top:10px!important;}
.admin-summary-card{grid-area:summary!important;border:1px solid var(--v39-line)!important;border-radius:18px!important;padding:16px!important;background:var(--v39-surface)!important;}.admin-summary-card .mini-stats{display:grid!important;grid-template-columns:repeat(6,minmax(0,1fr))!important;gap:9px!important;}.admin-summary-card .mini-stats span{display:grid!important;gap:4px!important;min-height:64px!important;border:1px solid var(--v39-line)!important;border-radius:14px!important;background:#f8fbff!important;padding:10px!important;color:var(--v39-muted)!important;font-size:10.5px!important;font-weight:800!important;}.admin-summary-card .mini-stats b{font-size:20px!important;color:var(--v39-text)!important;}
.pending-card{grid-area:pending!important;border:1px solid var(--v39-line)!important;border-radius:18px!important;padding:16px!important;background:var(--v39-surface)!important;}.users-table-card{grid-area:users!important;border:1px solid var(--v39-line)!important;border-radius:18px!important;padding:16px!important;background:var(--v39-surface)!important;}.admin-filter-grid{display:grid!important;grid-template-columns:minmax(220px,1fr) 160px 160px!important;gap:10px!important;margin:12px 0 14px!important;}
.user-row-v35{display:grid!important;grid-template-columns:minmax(0,1fr) auto!important;gap:12px!important;align-items:center!important;border:1px solid var(--v39-line)!important;border-radius:15px!important;background:#f8fbff!important;padding:12px!important;margin:9px 0!important;box-shadow:0 5px 16px rgba(15,23,42,.025)!important;}.user-main b{font-size:13px!important;display:block!important;margin-bottom:4px!important;}.user-main small{font-size:10.5px!important;line-height:1.5!important;color:var(--v39-muted)!important;}.status-pill{display:inline-flex!important;align-items:center!important;border-radius:999px!important;padding:2px 8px!important;font-size:9.5px!important;font-weight:900!important;background:var(--v39-primary-soft)!important;color:var(--v39-primary)!important;}.status-disabled{background:#fee2e2!important;color:#991b1b!important}.status-pending{background:#fef3c7!important;color:#92400e!important}.status-approved{background:#dcfce7!important;color:#166534!important}.user-actions{display:flex!important;align-items:center!important;gap:7px!important;flex-wrap:wrap!important;justify-content:flex-end!important;}.user-actions button{min-height:31px!important;border-radius:10px!important;border:1px solid var(--v39-line)!important;background:var(--v39-surface)!important;color:var(--v39-text)!important;padding:0 10px!important;font-size:10.5px!important;font-weight:850!important;}.user-actions .danger{background:#fef2f2!important;color:#991b1b!important;border-color:#fecaca!important;}
.v39-list-card.audit{align-items:flex-start!important;border-left:3px solid var(--v39-primary)!important;}.v39-list-card.audit details{max-width:100%!important;}.v39-list-card.audit pre{max-height:220px!important;overflow:auto!important;border-radius:12px!important;background:#0f172a!important;color:#e5e7eb!important;padding:12px!important;font-size:11px!important;}

body.dark .chat-layout-pro > .panel,body.dark .chat-room-head-pro,body.dark .chat-search-box,body.dark .filter-chip,body.dark .chat-tabs button,body.dark .chat-template-card,body.dark .smart-compose-shell,body.dark .smart-composer-pro,body.dark .simplified-compose-tools,body.dark .attach-chat-btn,body.dark .complaint-toggle,body.dark .room-info-card,body.dark .room-panel-block,body.dark .user-create-card,body.dark .admin-summary-card,body.dark .pending-card,body.dark .users-table-card,body.dark .user-row-v35{background:var(--panel)!important;border-color:var(--border)!important;color:var(--text)!important;}.body.dark .messenger-list{background:#0f172a!important;}
@media(max-width:1200px){.chat-layout-pro{grid-template-columns:minmax(210px,250px) minmax(0,1fr)!important}.chat-room-info-panel{display:none!important}.admin-summary-card .mini-stats{grid-template-columns:repeat(3,1fr)!important}}
@media(max-width:900px){.chat-layout-pro{grid-template-columns:1fr!important;height:auto!important;min-height:0!important}.chat-channels-pro,.chat-room-info-panel{display:none!important}.user-admin-grid{grid-template-columns:1fr!important;grid-template-areas:'summary' 'create' 'pending' 'users'!important}.user-create-card{position:static!important}.form-grid.two,.admin-filter-grid{grid-template-columns:1fr!important}.user-row-v35{grid-template-columns:1fr!important}.user-actions{justify-content:flex-start!important}.admin-summary-card .mini-stats{grid-template-columns:repeat(2,1fr)!important}}


/* v39.4.1 template newline hotfix */
.template-preview-text-v3941,
.template-preview-pane pre{
  white-space:pre-wrap!important;
  word-break:break-word!important;
}
.template-card p.template-preview-text-v3941{
  line-height:1.45!important;
  max-height:8.7em!important;
  overflow:hidden!important;
}


/* =========================================================
   v39.4.2 Chat Bubble Alignment Fix
   Definitive left/right alignment for chat messages.
   Scoped to chat layouts so Dashboard/Notes/Admin are not affected.
   ========================================================= */
.chat-layout-pro .messenger-list,
.chat-layout-preview-match .messenger-list,
.chat-box-pro .messenger-list{
  display:flex!important;
  flex-direction:column!important;
  align-items:stretch!important;
  gap:10px!important;
  width:100%!important;
  min-width:0!important;
  overflow-y:auto!important;
}
.chat-layout-pro .chat-row,
.chat-layout-preview-match .chat-row,
.chat-box-pro .chat-row{
  width:100%!important;
  max-width:100%!important;
  display:flex!important;
  align-items:flex-end!important;
  gap:8px!important;
  margin:0!important;
  padding:0 2px!important;
  box-sizing:border-box!important;
}
.chat-layout-pro .chat-row.theirs,
.chat-layout-preview-match .chat-row.theirs,
.chat-box-pro .chat-row.theirs{
  justify-content:flex-start!important;
  align-self:stretch!important;
  flex-direction:row!important;
}
.chat-layout-pro .chat-row.mine,
.chat-layout-preview-match .chat-row.mine,
.chat-box-pro .chat-row.mine{
  justify-content:flex-end!important;
  align-self:stretch!important;
  flex-direction:row!important;
}
.chat-layout-pro .chat-row.mine .chat-avatar,
.chat-layout-preview-match .chat-row.mine .chat-avatar,
.chat-box-pro .chat-row.mine .chat-avatar{
  display:none!important;
}
.chat-layout-pro .chat-message-stack,
.chat-layout-preview-match .chat-message-stack,
.chat-box-pro .chat-message-stack{
  display:flex!important;
  flex-direction:column!important;
  min-width:0!important;
  width:auto!important;
  max-width:min(68%,560px)!important;
}
.chat-layout-pro .chat-row.theirs .chat-message-stack,
.chat-layout-preview-match .chat-row.theirs .chat-message-stack,
.chat-box-pro .chat-row.theirs .chat-message-stack{
  align-items:flex-start!important;
  margin-right:auto!important;
}
.chat-layout-pro .chat-row.mine .chat-message-stack,
.chat-layout-preview-match .chat-row.mine .chat-message-stack,
.chat-box-pro .chat-row.mine .chat-message-stack{
  align-items:flex-end!important;
  margin-left:auto!important;
}
.chat-layout-pro .chat-sender-line,
.chat-layout-preview-match .chat-sender-line,
.chat-box-pro .chat-sender-line{
  width:100%!important;
  max-width:100%!important;
  display:flex!important;
  align-items:center!important;
  gap:6px!important;
  margin:0 0 3px!important;
  font-size:10.5px!important;
  line-height:1.2!important;
  color:var(--v39-muted,#64748b)!important;
}
.chat-layout-pro .chat-row.theirs .chat-sender-line,
.chat-layout-preview-match .chat-row.theirs .chat-sender-line,
.chat-box-pro .chat-row.theirs .chat-sender-line{
  justify-content:flex-start!important;
  text-align:left!important;
  padding-left:2px!important;
}
.chat-layout-pro .chat-row.mine .chat-sender-line,
.chat-layout-preview-match .chat-row.mine .chat-sender-line,
.chat-box-pro .chat-row.mine .chat-sender-line{
  justify-content:flex-end!important;
  text-align:right!important;
  padding-right:2px!important;
}
.chat-layout-pro .chat-sender-line .chat-menu-trigger,
.chat-layout-preview-match .chat-sender-line .chat-menu-trigger,
.chat-box-pro .chat-sender-line .chat-menu-trigger{
  margin-left:0!important;
  flex:0 0 auto!important;
}
.chat-layout-pro .chat-bubble,
.chat-layout-preview-match .chat-bubble,
.chat-box-pro .chat-bubble{
  width:max-content!important;
  max-width:100%!important;
  min-width:0!important;
  box-sizing:border-box!important;
  overflow:visible!important;
  word-break:break-word!important;
  overflow-wrap:anywhere!important;
}
.chat-layout-pro .chat-row.mine .chat-bubble,
.chat-layout-preview-match .chat-row.mine .chat-bubble,
.chat-box-pro .chat-row.mine .chat-bubble{
  border-bottom-right-radius:6px!important;
  border-bottom-left-radius:16px!important;
  text-align:left!important;
}
.chat-layout-pro .chat-row.theirs .chat-bubble,
.chat-layout-preview-match .chat-row.theirs .chat-bubble,
.chat-box-pro .chat-row.theirs .chat-bubble{
  border-bottom-left-radius:6px!important;
  border-bottom-right-radius:16px!important;
  text-align:left!important;
}
.chat-layout-pro .chat-foot,
.chat-layout-preview-match .chat-foot,
.chat-box-pro .chat-foot{
  width:100%!important;
  display:flex!important;
  align-items:center!important;
  gap:8px!important;
  margin-top:5px!important;
}
.chat-layout-pro .chat-row.mine .chat-foot,
.chat-layout-preview-match .chat-row.mine .chat-foot,
.chat-box-pro .chat-row.mine .chat-foot{
  justify-content:flex-end!important;
}
.chat-layout-pro .chat-row.theirs .chat-foot,
.chat-layout-preview-match .chat-row.theirs .chat-foot,
.chat-box-pro .chat-row.theirs .chat-foot{
  justify-content:flex-start!important;
}
.chat-layout-pro .chat-attachments,
.chat-layout-preview-match .chat-attachments,
.chat-box-pro .chat-attachments,
.chat-layout-pro .complaint-card,
.chat-layout-preview-match .complaint-card,
.chat-box-pro .complaint-card{
  max-width:100%!important;
}
.chat-layout-pro .chat-attachment.image img,
.chat-layout-preview-match .chat-attachment.image img,
.chat-box-pro .chat-attachment.image img{
  max-width:min(280px,100%)!important;
  height:auto!important;
}
@media(max-width:900px){
  .chat-layout-pro .chat-message-stack,
  .chat-layout-preview-match .chat-message-stack,
  .chat-box-pro .chat-message-stack{max-width:82%!important;}
}


/* v39.4.3 chat reply jump */
.chat-reply-preview.chat-reply-jump{
  width:100%!important;
  text-align:left!important;
  border:0!important;
  cursor:pointer!important;
  display:grid!important;
  gap:3px!important;
}
.chat-reply-preview.chat-reply-jump:hover{
  filter:brightness(.985)!important;
  box-shadow:inset 3px 0 0 var(--v39-primary, #2563eb)!important;
}
.chat-row.reply-jump-highlight .chat-bubble{
  animation: replyJumpPulseV3943 1.6s ease-in-out!important;
  outline:2px solid rgba(37,99,235,.55)!important;
  outline-offset:3px!important;
}
@keyframes replyJumpPulseV3943{
  0%{box-shadow:0 0 0 0 rgba(37,99,235,.38)}
  45%{box-shadow:0 0 0 9px rgba(37,99,235,.08)}
  100%{box-shadow:0 0 0 0 rgba(37,99,235,0)}
}


/* =========================================================
   v39.5 — Final Chat Polish + Admin Stability
   Strictly scoped to .view-chat and admin/audit pages.
   ========================================================= */

/* CHAT: stable 3-column shell */
.view-chat .content{
  padding:10px!important;
  overflow:hidden!important;
}
.view-chat .chat-layout-pro,
.view-chat .chat-layout-preview-match{
  display:grid!important;
  grid-template-columns:minmax(230px,270px) minmax(0,1fr) minmax(230px,300px)!important;
  gap:10px!important;
  height:calc(100vh - 76px)!important;
  min-height:0!important;
  overflow:hidden!important;
}
.view-chat .chat-layout-pro > .panel,
.view-chat .chat-layout-preview-match > .panel{
  min-height:0!important;
  overflow:hidden!important;
  border:1px solid var(--v39-line,#dbe5f3)!important;
  border-radius:16px!important;
  background:var(--v39-surface,#fff)!important;
  box-shadow:0 8px 24px rgba(15,23,42,.045)!important;
}

/* CHAT: left room panel */
.view-chat .chat-channels-pro{
  display:flex!important;
  flex-direction:column!important;
  gap:10px!important;
  padding:10px!important;
}
.view-chat .chat-search-row{
  display:grid!important;
  grid-template-columns:minmax(0,1fr) 34px!important;
  gap:8px!important;
  flex:0 0 auto!important;
}
.view-chat .chat-search-box{
  min-height:34px!important;
  border-radius:12px!important;
  border:1px solid var(--v39-line,#dbe5f3)!important;
  background:#f8fbff!important;
  display:flex!important;
  align-items:center!important;
  gap:7px!important;
  padding:0 10px!important;
}
.view-chat .chat-search-box input{
  width:100%!important;
  min-width:0!important;
  border:0!important;
  background:transparent!important;
  outline:0!important;
  font-size:11.5px!important;
  color:var(--v39-text,#14213d)!important;
}
.view-chat .filter-chip{
  width:34px!important;
  height:34px!important;
  border-radius:12px!important;
  border:1px solid var(--v39-line,#dbe5f3)!important;
  background:#f8fbff!important;
  color:var(--v39-muted,#64748b)!important;
}
.view-chat .new-chat-btn{
  min-height:38px!important;
  border-radius:13px!important;
  font-weight:900!important;
  box-shadow:0 10px 20px rgba(37,99,235,.14)!important;
}
.view-chat .chat-tabs{
  display:grid!important;
  grid-template-columns:repeat(4,minmax(0,1fr))!important;
  gap:6px!important;
}
.view-chat .chat-tabs button{
  min-height:34px!important;
  border-radius:12px!important;
  padding:5px 4px!important;
  font-size:10.5px!important;
  font-weight:850!important;
  border:1px solid var(--v39-line,#dbe5f3)!important;
  background:#f8fbff!important;
  color:var(--v39-muted,#64748b)!important;
}
.view-chat .chat-tabs button.active{
  background:var(--v39-primary-soft,#eaf2ff)!important;
  border-color:rgba(37,99,235,.25)!important;
  color:var(--v39-primary,#2563eb)!important;
}
.view-chat .room-group{
  min-height:0!important;
  overflow:auto!important;
  padding-right:2px!important;
}
.view-chat .chat-room-card{
  width:100%!important;
  min-height:54px!important;
  margin-bottom:8px!important;
  display:grid!important;
  grid-template-columns:34px minmax(0,1fr) auto!important;
  align-items:center!important;
  gap:9px!important;
  padding:8px!important;
  border-radius:14px!important;
  border:1px solid transparent!important;
  background:transparent!important;
  text-align:left!important;
}
.view-chat .chat-room-card:hover{
  background:#f8fbff!important;
  border-color:var(--v39-line,#dbe5f3)!important;
}
.view-chat .chat-room-card.active{
  background:var(--v39-primary-soft,#eaf2ff)!important;
  border-color:rgba(37,99,235,.22)!important;
}
.view-chat .room-card-icon{
  width:34px!important;
  height:34px!important;
  border-radius:12px!important;
  display:grid!important;
  place-items:center!important;
  background:var(--v39-primary-soft,#eaf2ff)!important;
  color:var(--v39-primary,#2563eb)!important;
}
.view-chat .room-card-main{
  min-width:0!important;
  display:grid!important;
  gap:2px!important;
}
.view-chat .room-card-main b{
  font-size:12px!important;
  line-height:1.2!important;
  white-space:nowrap!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
}
.view-chat .room-card-main small{
  font-size:10.5px!important;
  line-height:1.25!important;
  color:var(--v39-muted,#64748b)!important;
  white-space:nowrap!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
}
.view-chat .room-card-meta{
  display:grid!important;
  justify-items:end!important;
  gap:3px!important;
}
.view-chat .room-card-meta small{
  max-width:58px!important;
  font-size:9px!important;
  color:var(--v39-muted,#64748b)!important;
  white-space:nowrap!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
}
.view-chat .room-card-meta em{
  min-width:18px!important;
  height:18px!important;
  padding:0 5px!important;
  border-radius:999px!important;
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  font-size:9px!important;
  font-weight:900!important;
  background:var(--v39-primary,#2563eb)!important;
  color:white!important;
}

/* CHAT: conversation center */
.view-chat .chat-box-pro{
  display:flex!important;
  flex-direction:column!important;
}
.view-chat .chat-room-head-pro{
  flex:0 0 auto!important;
  min-height:60px!important;
  padding:10px 14px!important;
  border-bottom:1px solid var(--v39-line,#dbe5f3)!important;
  display:flex!important;
  align-items:center!important;
  justify-content:space-between!important;
  gap:10px!important;
}
.view-chat .room-title-block{
  display:flex!important;
  align-items:center!important;
  gap:10px!important;
  min-width:0!important;
}
.view-chat .room-title-icon{
  width:38px!important;
  height:38px!important;
  border-radius:14px!important;
  display:grid!important;
  place-items:center!important;
  background:var(--v39-primary-soft,#eaf2ff)!important;
}
.view-chat .room-title-block h2{
  font-size:15px!important;
  margin:0!important;
  line-height:1.2!important;
}
.view-chat .room-title-block small{
  font-size:10.5px!important;
}
.view-chat .chat-head-actions{
  display:flex!important;
  align-items:center!important;
  gap:7px!important;
}
.view-chat .room-icon-action{
  width:34px!important;
  height:34px!important;
  border-radius:12px!important;
  border:1px solid var(--v39-line,#dbe5f3)!important;
  background:#f8fbff!important;
  color:var(--v39-muted,#64748b)!important;
  display:grid!important;
  place-items:center!important;
}
.view-chat .room-icon-action:hover{
  background:var(--v39-primary-soft,#eaf2ff)!important;
  color:var(--v39-primary,#2563eb)!important;
}
.view-chat .room-icon-action.danger-icon:hover{
  background:#fef2f2!important;
  color:#b91c1c!important;
  border-color:#fecaca!important;
}
.view-chat .chat-select-toolbar{
  flex:0 0 auto!important;
  display:flex!important;
  align-items:center!important;
  justify-content:space-between!important;
  gap:10px!important;
  padding:8px 12px!important;
  border-bottom:1px solid var(--v39-line,#dbe5f3)!important;
  background:#f8fbff!important;
}

/* CHAT: message list and bubble alignment */
.view-chat .messenger-list{
  flex:1 1 auto!important;
  min-height:0!important;
  overflow:auto!important;
  display:flex!important;
  flex-direction:column!important;
  align-items:stretch!important;
  gap:10px!important;
  padding:14px 18px!important;
  background:linear-gradient(180deg,#fbfdff,#fff)!important;
  border:0!important;
  border-radius:0!important;
}
.view-chat .date-pill{
  align-self:center!important;
  position:sticky!important;
  top:0!important;
  z-index:3!important;
  font-size:10px!important;
  border:1px solid var(--v39-line,#dbe5f3)!important;
  background:rgba(255,255,255,.9)!important;
  backdrop-filter:blur(8px)!important;
  padding:4px 10px!important;
  border-radius:999px!important;
}
.view-chat .chat-row{
  width:100%!important;
  max-width:100%!important;
  display:flex!important;
  align-items:flex-end!important;
  gap:8px!important;
  margin:0!important;
  padding:0!important;
  box-sizing:border-box!important;
}
.view-chat .chat-row.theirs{
  justify-content:flex-start!important;
}
.view-chat .chat-row.mine{
  justify-content:flex-end!important;
  flex-direction:row!important;
}
.view-chat .chat-row.mine .chat-avatar{
  display:none!important;
}
.view-chat .chat-avatar{
  width:28px!important;
  height:28px!important;
  min-width:28px!important;
  border-radius:999px!important;
  display:grid!important;
  place-items:center!important;
  background:var(--v39-primary-soft,#eaf2ff)!important;
  color:var(--v39-primary,#2563eb)!important;
  font-size:11px!important;
  font-weight:900!important;
}
.view-chat .chat-message-stack{
  display:flex!important;
  flex-direction:column!important;
  min-width:0!important;
  max-width:min(70%,620px)!important;
  gap:4px!important;
}
.view-chat .chat-row.theirs .chat-message-stack{
  align-items:flex-start!important;
  margin-right:auto!important;
}
.view-chat .chat-row.mine .chat-message-stack{
  align-items:flex-end!important;
  margin-left:auto!important;
}
.view-chat .chat-sender-line{
  width:100%!important;
  display:flex!important;
  align-items:center!important;
  gap:6px!important;
  font-size:10.5px!important;
  font-weight:900!important;
  color:var(--v39-muted,#64748b)!important;
}
.view-chat .chat-row.theirs .chat-sender-line{
  justify-content:flex-start!important;
}
.view-chat .chat-row.mine .chat-sender-line{
  justify-content:flex-end!important;
}
.view-chat .chat-menu-trigger{
  width:22px!important;
  height:22px!important;
  min-width:22px!important;
  border-radius:8px!important;
  border:0!important;
  background:transparent!important;
  color:var(--v39-muted,#64748b)!important;
  display:grid!important;
  place-items:center!important;
}
.view-chat .chat-menu-trigger:hover{
  background:#eef5ff!important;
  color:var(--v39-primary,#2563eb)!important;
}
.view-chat .chat-bubble{
  width:auto!important;
  max-width:100%!important;
  min-width:0!important;
  border-radius:16px!important;
  padding:10px 12px!important;
  background:#fff!important;
  border:1px solid var(--v39-line,#dbe5f3)!important;
  color:var(--v39-text,#14213d)!important;
  box-shadow:0 6px 18px rgba(15,23,42,.045)!important;
  overflow:visible!important;
  word-break:break-word!important;
  overflow-wrap:anywhere!important;
  text-align:left!important;
}
.view-chat .chat-row.mine .chat-bubble{
  background:#dbeafe!important;
  border-color:#bfdbfe!important;
  border-bottom-right-radius:6px!important;
}
.view-chat .chat-row.theirs .chat-bubble{
  border-bottom-left-radius:6px!important;
}
.view-chat .chat-body{
  white-space:pre-wrap!important;
  font-size:12px!important;
  line-height:1.45!important;
}
.view-chat .chat-reply-preview{
  border:0!important;
  border-left:3px solid var(--v39-primary,#2563eb)!important;
  background:rgba(37,99,235,.07)!important;
  border-radius:12px!important;
  padding:8px 10px!important;
  margin-bottom:7px!important;
}
.view-chat .chat-reply-preview b{
  display:block!important;
  font-size:10.5px!important;
  margin-bottom:3px!important;
}
.view-chat .chat-reply-preview span{
  display:block!important;
  font-size:10.5px!important;
  color:var(--v39-muted,#64748b)!important;
}
.view-chat .chat-foot{
  display:flex!important;
  align-items:center!important;
  gap:8px!important;
  margin-top:7px!important;
  font-size:9.5px!important;
  color:var(--v39-muted,#64748b)!important;
}
.view-chat .chat-row.mine .chat-foot{
  justify-content:flex-end!important;
}
.view-chat .chat-row.theirs .chat-foot{
  justify-content:flex-start!important;
}
.view-chat .chat-attachments{
  display:grid!important;
  gap:7px!important;
  margin-top:7px!important;
}
.view-chat .chat-attachment.image img{
  max-width:min(320px,100%)!important;
  height:auto!important;
  border-radius:12px!important;
  border:1px solid var(--v39-line,#dbe5f3)!important;
}
.view-chat .chat-attachment.file,
.view-chat .chat-link-card{
  display:block!important;
  max-width:100%!important;
  border:1px solid var(--v39-line,#dbe5f3)!important;
  background:#f8fbff!important;
  border-radius:12px!important;
  padding:8px 10px!important;
  color:var(--v39-text,#14213d)!important;
}
.view-chat .complaint-card{
  margin-top:8px!important;
  border-radius:12px!important;
  max-width:100%!important;
}
.view-chat .chat-row.reply-jump-highlight .chat-bubble{
  outline:2px solid rgba(37,99,235,.55)!important;
  outline-offset:3px!important;
}

/* CHAT: composer */
.view-chat .smart-compose-shell{
  flex:0 0 auto!important;
  padding:10px 12px 12px!important;
  border-top:1px solid var(--v39-line,#dbe5f3)!important;
  background:#fff!important;
}
.view-chat .smart-composer-pro{
  display:grid!important;
  gap:8px!important;
  border:1px solid var(--v39-line,#dbe5f3)!important;
  border-radius:16px!important;
  padding:10px!important;
  background:#fff!important;
}
.view-chat .smart-composer-pro textarea{
  width:100%!important;
  min-height:58px!important;
  max-height:170px!important;
  resize:none!important;
  border:0!important;
  outline:0!important;
  background:transparent!important;
  color:var(--v39-text,#14213d)!important;
  font-size:12px!important;
  line-height:1.45!important;
  padding:0!important;
}
.view-chat .chat-compose-tools{
  display:flex!important;
  align-items:center!important;
  gap:8px!important;
  border-top:1px solid var(--v39-line,#dbe5f3)!important;
  padding-top:8px!important;
}
.view-chat .attach-chat-btn,
.view-chat .complaint-toggle{
  height:32px!important;
  border-radius:12px!important;
  border:1px solid var(--v39-line,#dbe5f3)!important;
  background:#f8fbff!important;
  color:var(--v39-text,#14213d)!important;
  padding:0 10px!important;
  display:inline-flex!important;
  align-items:center!important;
  gap:7px!important;
  font-size:11px!important;
  font-weight:850!important;
}
.view-chat .send-chat-btn{
  margin-left:auto!important;
  width:38px!important;
  height:38px!important;
  min-width:38px!important;
  border-radius:999px!important;
  display:grid!important;
  place-items:center!important;
  padding:0!important;
}

/* CHAT: right insight panel */
.view-chat .chat-insights,
.view-chat .chat-room-info-panel{
  min-height:0!important;
  overflow:auto!important;
  padding:10px!important;
}
.view-chat .room-info-card,
.view-chat .room-panel-block{
  border:1px solid var(--v39-line,#dbe5f3)!important;
  border-radius:15px!important;
  background:#fff!important;
  padding:12px!important;
  margin-bottom:10px!important;
  box-shadow:0 6px 18px rgba(15,23,42,.035)!important;
}
.view-chat .room-panel-block h3,
.view-chat .room-info-card h3{
  margin:0 0 8px!important;
  font-size:13px!important;
}

/* ADMIN + AUDIT STABILITY/POLISH */
.view-admin .v39-page,
.view-audit .v39-page{
  padding:12px!important;
}
.view-admin .user-create-card,
.view-admin .admin-summary-card,
.view-admin .pending-card,
.view-admin .users-table-card,
.view-audit .v39-panel-card,
.view-audit .audit-card,
.view-audit .log-card{
  border:1px solid var(--v39-line,#dbe5f3)!important;
  border-radius:16px!important;
  background:var(--v39-surface,#fff)!important;
  box-shadow:0 8px 22px rgba(15,23,42,.045)!important;
}
.view-admin .admin-summary-grid,
.view-admin .user-summary-grid{
  display:grid!important;
  grid-template-columns:repeat(auto-fit,minmax(145px,1fr))!important;
  gap:10px!important;
}
.view-admin .user-row-v35,
.view-admin .user-row,
.view-admin .pending-card{
  border-radius:14px!important;
  border:1px solid var(--v39-line,#dbe5f3)!important;
  background:#fff!important;
}
.view-admin .role-badge,
.view-admin .status-badge,
.view-admin .badge,
.view-audit .badge{
  border-radius:999px!important;
  padding:4px 8px!important;
  font-size:10px!important;
  font-weight:900!important;
}
.view-admin .modal-card,
.view-admin .modal,
.view-audit .modal-card,
.view-audit .modal{
  border-radius:18px!important;
}

/* DARK MODE */
body.dark .view-chat .chat-layout-pro > .panel,
body.dark .view-chat .chat-layout-preview-match > .panel,
body.dark .view-chat .chat-search-box,
body.dark .view-chat .filter-chip,
body.dark .view-chat .chat-tabs button,
body.dark .view-chat .chat-bubble,
body.dark .view-chat .smart-compose-shell,
body.dark .view-chat .smart-composer-pro,
body.dark .view-chat .attach-chat-btn,
body.dark .view-chat .complaint-toggle,
body.dark .view-chat .room-info-card,
body.dark .view-chat .room-panel-block,
body.dark .view-admin .user-create-card,
body.dark .view-admin .admin-summary-card,
body.dark .view-admin .pending-card,
body.dark .view-admin .users-table-card,
body.dark .view-admin .user-row-v35,
body.dark .view-admin .user-row,
body.dark .view-audit .v39-panel-card,
body.dark .view-audit .audit-card,
body.dark .view-audit .log-card{
  background:var(--panel,#111827)!important;
  border-color:var(--border,#334155)!important;
  color:var(--text,#e5e7eb)!important;
}
body.dark .view-chat .messenger-list{
  background:var(--bg,#0f172a)!important;
}
body.dark .view-chat .chat-row.mine .chat-bubble{
  background:rgba(59,130,246,.18)!important;
  color:var(--text,#e5e7eb)!important;
  border-color:rgba(59,130,246,.28)!important;
}
body.dark .view-chat .chat-link-card,
body.dark .view-chat .chat-attachment.file{
  background:rgba(30,41,59,.9)!important;
  color:var(--text,#e5e7eb)!important;
  border-color:var(--border,#334155)!important;
}

/* RESPONSIVE CHAT */
@media(max-width:1180px){
  .view-chat .chat-layout-pro,
  .view-chat .chat-layout-preview-match{
    grid-template-columns:minmax(220px,255px) minmax(0,1fr)!important;
  }
  .view-chat .chat-insights,
  .view-chat .chat-room-info-panel{
    display:none!important;
  }
}
@media(max-width:820px){
  .view-chat .content{padding:8px!important;overflow:auto!important;}
  .view-chat .chat-layout-pro,
  .view-chat .chat-layout-preview-match{
    grid-template-columns:1fr!important;
    height:auto!important;
    min-height:calc(100vh - 76px)!important;
    overflow:visible!important;
  }
  .view-chat .chat-channels-pro{
    max-height:260px!important;
  }
  .view-chat .chat-box-pro{
    min-height:640px!important;
  }
  .view-chat .chat-message-stack{
    max-width:86%!important;
  }
}


/* v39.5.1 — Chat tabs containment hotfix */
.view-chat .chat-channels-pro,
.view-chat .chat-tabs{
  box-sizing:border-box!important;
  width:100%!important;
  max-width:100%!important;
}
.view-chat .chat-tabs{
  display:grid!important;
  grid-template-columns:repeat(2,minmax(0,1fr))!important;
  gap:8px!important;
  overflow:hidden!important;
}
.view-chat .chat-tabs button{
  width:100%!important;
  min-width:0!important;
  max-width:100%!important;
  min-height:42px!important;
  padding:6px 6px!important;
  box-sizing:border-box!important;
  display:flex!important;
  flex-direction:column!important;
  align-items:center!important;
  justify-content:center!important;
  gap:2px!important;
  overflow:hidden!important;
  text-align:center!important;
}
.view-chat .chat-tabs button span,
.view-chat .chat-tabs button b,
.view-chat .chat-tabs button small,
.view-chat .chat-tabs button em{
  max-width:100%!important;
}
.view-chat .chat-tabs button .tab-label,
.view-chat .chat-tabs button > :first-child{
  white-space:nowrap!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
  line-height:1.1!important;
  font-size:10.5px!important;
  font-weight:850!important;
}
.view-chat .chat-tabs button .tab-count,
.view-chat .chat-tabs button > :last-child{
  min-width:18px!important;
  height:18px!important;
  padding:0 6px!important;
  border-radius:999px!important;
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  font-size:9px!important;
  line-height:1!important;
  font-weight:900!important;
  background:rgba(37,99,235,.08)!important;
  color:inherit!important;
}
.view-chat .chat-tabs button.active .tab-count,
.view-chat .chat-tabs button.active > :last-child{
  background:rgba(37,99,235,.14)!important;
}
@media (min-width: 360px){
  .view-chat .chat-tabs{
    grid-template-columns:repeat(4,minmax(0,1fr))!important;
  }
  .view-chat .chat-tabs button{
    min-height:38px!important;
    gap:1px!important;
  }
}

/* v39.6 User Management + Security UI */
.view-admin .content{overflow:auto!important}
.view-admin .admin-grid.user-admin-grid{display:grid!important;grid-template-columns:minmax(320px,420px) minmax(0,1fr)!important;gap:12px!important;padding:12px!important;align-items:start!important}
.view-admin .user-create-card{grid-row:span 3!important;padding:16px!important;border-radius:18px!important}
.view-admin .user-create-card h2,.view-admin .admin-summary-card-v396 h2,.view-admin .security-card-v396 h2{margin:0!important;font-size:16px!important;letter-spacing:-.02em!important}
.view-admin .user-create-card p,.view-admin .admin-card-head-v396 p{margin:4px 0 0!important;font-size:11.5px!important;color:var(--v39-muted,#64748b)!important}
.view-admin .user-create-card .form-grid.two{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:10px!important;margin-top:12px!important}
.view-admin .user-create-card label{display:grid!important;gap:5px!important;font-size:11px!important;font-weight:850!important;color:var(--v39-muted,#64748b)!important}
.view-admin .user-create-card input,.view-admin .user-create-card select,.view-admin .user-create-card textarea,.view-admin .admin-filter-grid input,.view-admin .admin-filter-grid select{width:100%!important;min-height:36px!important;border:1px solid var(--v39-line,#dbe5f3)!important;border-radius:12px!important;background:#f8fbff!important;color:var(--v39-text,#14213d)!important;padding:8px 10px!important;font-size:12px!important;outline:0!important}
.view-admin .user-create-card textarea{min-height:82px!important;resize:vertical!important}
.view-admin .user-create-card input:focus,.view-admin .user-create-card select:focus,.view-admin .user-create-card textarea:focus,.view-admin .admin-filter-grid input:focus,.view-admin .admin-filter-grid select:focus{border-color:rgba(37,99,235,.36)!important;box-shadow:0 0 0 3px rgba(37,99,235,.09)!important}
.view-admin .checkline{display:flex!important;align-items:center!important;gap:8px!important;min-height:36px!important;padding:8px 10px!important;border:1px solid var(--v39-line,#dbe5f3)!important;border-radius:12px!important;background:#f8fbff!important}
.view-admin .checkline input{width:16px!important;min-height:16px!important;height:16px!important;padding:0!important}
.view-admin .user-create-card .primary{width:100%!important;min-height:38px!important;border-radius:13px!important;font-weight:900!important;margin-top:12px!important}
.view-admin .admin-summary-card-v396,.view-admin .security-card-v396,.view-admin .pending-card,.view-admin .users-table-card{padding:14px!important;border-radius:18px!important}
.view-admin .admin-card-head-v396{display:flex!important;align-items:flex-start!important;justify-content:space-between!important;gap:10px!important;margin-bottom:12px!important}
.view-admin .mini-stats-v396{display:grid!important;grid-template-columns:repeat(auto-fit,minmax(100px,1fr))!important;gap:8px!important}
.view-admin .mini-stats-v396 span{min-height:56px!important;display:grid!important;align-content:center!important;gap:3px!important;padding:10px!important;border:1px solid var(--v39-line,#dbe5f3)!important;border-radius:14px!important;background:#f8fbff!important;color:var(--v39-muted,#64748b)!important;font-size:10.5px!important;font-weight:800!important}
.view-admin .mini-stats-v396 b{display:block!important;color:var(--v39-text,#14213d)!important;font-size:19px!important;line-height:1!important}
.view-admin .security-grid-v396{display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:10px!important}
.view-admin .security-grid-v396 div{min-height:96px!important;display:grid!important;gap:6px!important;padding:12px!important;border:1px solid var(--v39-line,#dbe5f3)!important;border-radius:15px!important;background:#f8fbff!important}
.view-admin .security-grid-v396 b{font-size:12.5px!important;color:var(--v39-text,#14213d)!important}
.view-admin .security-grid-v396 span{font-size:11px!important;line-height:1.35!important;color:var(--v39-muted,#64748b)!important}
.view-admin .security-grid-v396 em{justify-self:start!important;align-self:end!important;border-radius:999px!important;padding:5px 8px!important;font-style:normal!important;font-size:9.5px!important;font-weight:900!important;letter-spacing:.05em!important}
.view-admin .security-ok{color:#047857!important;background:#d1fae5!important}.view-admin .security-warn{color:#92400e!important;background:#fef3c7!important}
.view-admin .admin-filter-grid{display:grid!important;grid-template-columns:minmax(220px,1fr) 160px 170px!important;gap:10px!important;margin:12px 0!important}
.view-admin .user-row-v396{display:grid!important;grid-template-columns:38px minmax(0,1fr) auto!important;gap:12px!important;align-items:center!important;padding:12px!important;margin:0 0 9px!important;border-radius:16px!important;border:1px solid var(--v39-line,#dbe5f3)!important;background:#fff!important;box-shadow:0 5px 16px rgba(15,23,42,.035)!important}
.view-admin .user-avatar-v396{width:38px!important;height:38px!important;border-radius:14px!important;display:grid!important;place-items:center!important;background:var(--v39-primary-soft,#eaf2ff)!important;color:var(--v39-primary,#2563eb)!important;font-weight:950!important}
.view-admin .user-main-v396{min-width:0!important;display:grid!important;gap:5px!important}.view-admin .user-title-line-v396{display:flex!important;align-items:center!important;flex-wrap:wrap!important;gap:6px!important}.view-admin .user-title-line-v396 b{font-size:13px!important;color:var(--v39-text,#14213d)!important}
.view-admin .user-main-v396 small{font-size:11px!important;color:var(--v39-muted,#64748b)!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important}
.view-admin .role-pill-v396,.view-admin .online-pill-v396,.view-admin .status-pill{display:inline-flex!important;align-items:center!important;justify-content:center!important;border-radius:999px!important;padding:4px 8px!important;min-height:22px!important;font-size:9.5px!important;line-height:1!important;font-weight:900!important;letter-spacing:.04em!important;text-transform:uppercase!important}
.view-admin .role-pill-v396{color:var(--v39-primary,#2563eb)!important;background:var(--v39-primary-soft,#eaf2ff)!important}.view-admin .role-superadmin{color:#7c3aed!important;background:#ede9fe!important}.view-admin .role-admin{color:#0f766e!important;background:#ccfbf1!important}
.view-admin .online-pill-v396.online{color:#047857!important;background:#d1fae5!important}.view-admin .online-pill-v396.offline{color:#64748b!important;background:#f1f5f9!important}
.view-admin .status-approved{color:#047857!important;background:#d1fae5!important}.view-admin .status-pending{color:#92400e!important;background:#fef3c7!important}.view-admin .status-disabled,.view-admin .status-rejected{color:#991b1b!important;background:#fee2e2!important}
.view-admin .user-meta-grid-v396{display:flex!important;flex-wrap:wrap!important;gap:6px!important}.view-admin .user-meta-grid-v396 span{display:inline-flex!important;align-items:center!important;gap:4px!important;border:1px solid var(--v39-line,#dbe5f3)!important;border-radius:999px!important;padding:4px 8px!important;background:#f8fbff!important;color:var(--v39-muted,#64748b)!important;font-size:10.5px!important}.view-admin .user-meta-grid-v396 b{color:var(--v39-text,#14213d)!important}.view-admin .user-meta-grid-v396 .ip-on{color:#047857!important;background:#ecfdf5!important;border-color:#bbf7d0!important}
.view-admin .user-actions-v396{display:flex!important;align-items:center!important;justify-content:flex-end!important;flex-wrap:wrap!important;gap:7px!important}.view-admin .user-actions-v396 button{min-height:30px!important;border-radius:10px!important;padding:0 10px!important;font-size:10.5px!important;font-weight:850!important}
.modal-grid.user-edit-modal-v396{gap:10px!important}.modal-section-title-v396{grid-column:1/-1!important;margin:4px 0 0!important;padding:8px 10px!important;border-radius:12px!important;background:#f8fbff!important;border:1px solid var(--v39-line,#dbe5f3)!important;color:var(--v39-text,#14213d)!important;font-size:12px!important;font-weight:900!important}.security-check-v396{background:#f8fbff!important;border:1px solid var(--v39-line,#dbe5f3)!important;border-radius:12px!important;padding:8px 10px!important}
.view-audit .v39-list-card.audit{border-left:4px solid var(--v39-primary,#2563eb)!important;border-radius:14px!important;padding:12px!important;margin-bottom:9px!important}.view-audit .v39-list-card.audit details{margin-top:8px!important}.view-audit .v39-list-card.audit pre{white-space:pre-wrap!important;border-radius:12px!important;background:#0f172a!important;color:#e5e7eb!important;padding:10px!important;overflow:auto!important}
body.dark .view-admin .user-create-card input,body.dark .view-admin .user-create-card select,body.dark .view-admin .user-create-card textarea,body.dark .view-admin .admin-filter-grid input,body.dark .view-admin .admin-filter-grid select,body.dark .view-admin .checkline,body.dark .view-admin .mini-stats-v396 span,body.dark .view-admin .security-grid-v396 div,body.dark .view-admin .user-row-v396,body.dark .view-admin .user-meta-grid-v396 span,body.dark .modal-section-title-v396,body.dark .security-check-v396{background:var(--panel,#111827)!important;border-color:var(--border,#334155)!important;color:var(--text,#e5e7eb)!important}
body.dark .view-admin .user-title-line-v396 b,body.dark .view-admin .mini-stats-v396 b,body.dark .view-admin .security-grid-v396 b,body.dark .view-admin .user-meta-grid-v396 b{color:var(--text,#e5e7eb)!important}
@media(max-width:1120px){.view-admin .admin-grid.user-admin-grid{grid-template-columns:1fr!important}.view-admin .user-create-card{grid-row:auto!important}}@media(max-width:720px){.view-admin .user-create-card .form-grid.two,.view-admin .security-grid-v396,.view-admin .admin-filter-grid{grid-template-columns:1fr!important}.view-admin .user-row-v396{grid-template-columns:34px minmax(0,1fr)!important}.view-admin .user-actions-v396{grid-column:1/-1!important;justify-content:flex-start!important}}


/* v39.6.1 — Note edit-lock metadata realtime UI fix */
.note-summary-grid-v38.note-summary-grid-lock-v3961,
.note-summary-grid-v38{
  display:grid!important;
  grid-template-columns:max-content minmax(0,1fr)!important;
  gap:7px 12px!important;
  align-items:center!important;
}
.note-summary-grid-v38 dt{
  margin:0!important;
  min-width:0!important;
  white-space:nowrap!important;
  color:var(--v39-muted,#64748b)!important;
  font-size:11px!important;
  font-weight:850!important;
  line-height:1.2!important;
}
.note-summary-grid-v38 dd{
  margin:0!important;
  min-width:0!important;
  color:var(--v39-text,#14213d)!important;
  font-size:11px!important;
  font-weight:850!important;
  line-height:1.2!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
}
.note-summary-grid-v38 .status-badge-v38{
  display:inline-flex!important;
  width:auto!important;
  min-width:0!important;
  max-width:max-content!important;
  height:auto!important;
  min-height:22px!important;
  line-height:1!important;
  align-items:center!important;
  justify-content:center!important;
  padding:5px 9px!important;
  border-radius:999px!important;
  white-space:nowrap!important;
  writing-mode:horizontal-tb!important;
  transform:none!important;
  font-size:10px!important;
  font-weight:900!important;
  letter-spacing:0!important;
}
.note-summary-grid-v38 .status-badge-v38.locked{
  color:#92400e!important;
  background:#fef3c7!important;
  border:1px solid #fde68a!important;
}
.note-summary-grid-v38 .status-badge-v38.editing{
  color:#1d4ed8!important;
  background:#dbeafe!important;
  border:1px solid #bfdbfe!important;
}
.note-summary-grid-v38 .status-badge-v38.read{
  color:#2563eb!important;
  background:#dbeafe!important;
  border:1px solid #bfdbfe!important;
}
body.dark .note-summary-grid-v38 .status-badge-v38.locked{
  color:#fbbf24!important;
  background:rgba(251,191,36,.14)!important;
  border-color:rgba(251,191,36,.30)!important;
}
body.dark .note-summary-grid-v38 .status-badge-v38.editing,
body.dark .note-summary-grid-v38 .status-badge-v38.read{
  color:#93c5fd!important;
  background:rgba(59,130,246,.15)!important;
  border-color:rgba(59,130,246,.28)!important;
}

/* =========================================================
   v39.6.2 — User Management Layout Repair
   Fix messy admin grid, reduce whitespace, improve hierarchy.
   ========================================================= */
.view-admin .content{padding:12px!important;overflow:auto!important}
.view-admin .admin-grid.user-admin-grid{
  width:100%!important;max-width:1500px!important;margin:0 auto!important;padding:0!important;
  display:grid!important;grid-template-columns:minmax(0,1fr) 380px!important;
  grid-template-areas:"summary security" "users create" "users pending"!important;
  gap:14px!important;align-items:start!important;
}
.view-admin .user-create-card{grid-area:create!important}
.view-admin .admin-summary-card-v396,.view-admin .admin-summary-card{grid-area:summary!important}
.view-admin .security-card-v396{grid-area:security!important}
.view-admin .pending-card{grid-area:pending!important}
.view-admin .users-table-card{grid-area:users!important}
.view-admin .user-create-card,.view-admin .admin-summary-card-v396,.view-admin .security-card-v396,.view-admin .pending-card,.view-admin .users-table-card{
  border:1px solid var(--v39-line,#dbe5f3)!important;border-radius:18px!important;background:var(--v39-surface,#fff)!important;
  box-shadow:0 8px 24px rgba(15,23,42,.045)!important;padding:16px!important;overflow:hidden!important;
}
.view-admin .users-table-card>.panel-head,.view-admin .admin-card-head-v396{
  min-height:auto!important;margin:0 0 12px!important;padding:0!important;border:0!important;
  display:flex!important;align-items:flex-start!important;justify-content:space-between!important;gap:12px!important;
}
.view-admin .users-table-card h2,.view-admin .user-create-card h2,.view-admin .pending-card h2,.view-admin .admin-summary-card-v396 h2,.view-admin .security-card-v396 h2{
  margin:0!important;font-size:16px!important;line-height:1.15!important;letter-spacing:-.025em!important;color:var(--v39-text,#14213d)!important;
}
.view-admin .users-table-card small,.view-admin .user-create-card p,.view-admin .admin-card-head-v396 p,.view-admin .pending-card .muted{
  margin-top:4px!important;font-size:11px!important;line-height:1.35!important;color:var(--v39-muted,#64748b)!important;
}
.view-admin .mini-stats-v396{display:grid!important;grid-template-columns:repeat(4,minmax(0,1fr))!important;gap:8px!important}
.view-admin .mini-stats-v396 span{
  min-height:58px!important;padding:10px!important;border-radius:14px!important;display:grid!important;align-content:center!important;gap:4px!important;
  background:#f8fbff!important;border:1px solid var(--v39-line,#dbe5f3)!important;color:var(--v39-muted,#64748b)!important;font-size:10.5px!important;font-weight:850!important;
}
.view-admin .mini-stats-v396 b{font-size:20px!important;line-height:1!important;color:var(--v39-text,#14213d)!important}
.view-admin .security-grid-v396{display:grid!important;grid-template-columns:1fr!important;gap:9px!important}
.view-admin .security-grid-v396 div{
  min-height:auto!important;padding:12px!important;border-radius:14px!important;background:#f8fbff!important;border:1px solid var(--v39-line,#dbe5f3)!important;
  display:grid!important;grid-template-columns:minmax(0,1fr) auto!important;gap:5px 10px!important;align-items:center!important;
}
.view-admin .security-grid-v396 b{font-size:12px!important}
.view-admin .security-grid-v396 span{grid-column:1/-1!important;font-size:10.5px!important}
.view-admin .security-grid-v396 em{grid-row:1!important;grid-column:2!important;align-self:center!important;justify-self:end!important}
.view-admin .admin-filter-grid{
  display:grid!important;grid-template-columns:minmax(260px,1fr) 150px 160px!important;gap:10px!important;margin:12px 0 14px!important;
  padding:10px!important;border-radius:15px!important;background:#f8fbff!important;border:1px solid var(--v39-line,#dbe5f3)!important;
}
.view-admin .admin-filter-grid input,.view-admin .admin-filter-grid select{
  min-height:36px!important;border-radius:12px!important;border:1px solid var(--v39-line,#dbe5f3)!important;background:#fff!important;padding:0 12px!important;font-size:11.5px!important;
}
.view-admin .users-table-card{min-height:420px!important}
.view-admin .user-row-v396{
  grid-template-columns:42px minmax(0,1fr) auto!important;gap:12px!important;padding:12px 14px!important;margin:0 0 10px!important;
  border-radius:16px!important;background:#fff!important;border:1px solid var(--v39-line,#dbe5f3)!important;box-shadow:none!important;
}
.view-admin .user-row-v396:hover{background:#fbfdff!important;border-color:rgba(37,99,235,.24)!important;box-shadow:0 8px 20px rgba(15,23,42,.04)!important}
.view-admin .user-avatar-v396{width:42px!important;height:42px!important;border-radius:14px!important}
.view-admin .user-title-line-v396{gap:7px!important;margin-bottom:1px!important}
.view-admin .user-title-line-v396 b{font-size:13px!important;line-height:1.2!important}
.view-admin .user-main-v396 small{max-width:720px!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important}
.view-admin .user-meta-grid-v396{margin-top:3px!important;gap:6px!important}
.view-admin .user-meta-grid-v396 span{min-height:24px!important;padding:4px 8px!important;border-radius:999px!important;background:#f8fbff!important}
.view-admin .user-actions-v396{min-width:210px!important;justify-content:flex-end!important;gap:7px!important}
.view-admin .user-actions-v396 button{min-height:30px!important;padding:0 10px!important;border-radius:10px!important}
.view-admin .user-create-card{position:sticky!important;top:12px!important;align-self:start!important}
.view-admin .user-create-card .form-grid.two{grid-template-columns:1fr 1fr!important;gap:9px!important}
.view-admin .user-create-card label{font-size:10.5px!important;line-height:1.25!important}
.view-admin .user-create-card input,.view-admin .user-create-card select{min-height:34px!important;border-radius:11px!important;font-size:11px!important}
.view-admin .user-create-card textarea{min-height:78px!important;font-size:11px!important}
.view-admin .user-create-card .primary{min-height:38px!important;border-radius:13px!important}
.view-admin .pending-card{min-height:0!important}
.view-admin .pending-card>p.muted{
  min-height:58px!important;border:1px dashed var(--v39-line,#dbe5f3)!important;border-radius:14px!important;display:grid!important;place-items:center!important;background:#f8fbff!important;
}
.view-admin .role-pill-v396,.view-admin .online-pill-v396,.view-admin .status-pill{min-height:22px!important;max-height:22px!important;line-height:1!important;white-space:nowrap!important}
.modal-grid.user-edit-modal-v396{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:10px!important}
.modal-grid.user-edit-modal-v396 label,.modal-grid.user-edit-modal-v396 small{font-size:11px!important}
.modal-grid.user-edit-modal-v396 textarea{min-height:80px!important}
body.dark .view-admin .user-create-card,body.dark .view-admin .admin-summary-card-v396,body.dark .view-admin .security-card-v396,body.dark .view-admin .pending-card,body.dark .view-admin .users-table-card,body.dark .view-admin .user-row-v396,body.dark .view-admin .admin-filter-grid,body.dark .view-admin .mini-stats-v396 span,body.dark .view-admin .security-grid-v396 div,body.dark .view-admin .pending-card>p.muted,body.dark .view-admin .user-meta-grid-v396 span{
  background:var(--panel,#111827)!important;border-color:var(--border,#334155)!important;color:var(--text,#e5e7eb)!important;
}
body.dark .view-admin .admin-filter-grid input,body.dark .view-admin .admin-filter-grid select,body.dark .view-admin .user-create-card input,body.dark .view-admin .user-create-card select,body.dark .view-admin .user-create-card textarea{
  background:var(--bg,#0f172a)!important;border-color:var(--border,#334155)!important;color:var(--text,#e5e7eb)!important;
}
@media(max-width:1250px){
  .view-admin .admin-grid.user-admin-grid{grid-template-columns:1fr!important;grid-template-areas:"summary" "security" "users" "create" "pending"!important}
  .view-admin .user-create-card{position:static!important}
  .view-admin .security-grid-v396{grid-template-columns:repeat(3,minmax(0,1fr))!important}
}
@media(max-width:760px){
  .view-admin .content{padding:8px!important}
  .view-admin .mini-stats-v396,.view-admin .security-grid-v396,.view-admin .admin-filter-grid,.view-admin .user-create-card .form-grid.two,.modal-grid.user-edit-modal-v396{grid-template-columns:1fr!important}
  .view-admin .user-row-v396{grid-template-columns:38px minmax(0,1fr)!important}
  .view-admin .user-actions-v396{grid-column:1/-1!important;justify-content:flex-start!important;min-width:0!important}
}


/* v39.6.3 User Management clean redesign */
.view-admin .content{padding:16px!important;overflow:auto!important}
.view-admin .admin-grid.user-admin-grid,.view-admin .user-create-card,.view-admin .admin-summary-card-v396,.view-admin .security-card-v396,.view-admin .pending-card,.view-admin .users-table-card{all:unset}
.view-admin .um-page{position:relative;max-width:1380px;margin:0 auto;display:grid;gap:16px}
.view-admin .um-head{display:flex;justify-content:space-between;align-items:flex-start;gap:16px}
.view-admin .um-head h1{margin:0;font-size:24px;line-height:1.1;letter-spacing:-.03em;color:var(--v39-text,#14213d)}
.view-admin .um-head p{margin:6px 0 0;font-size:13px;color:var(--v39-muted,#64748b)}
.view-admin .um-add-btn{display:inline-flex;align-items:center;gap:10px;min-height:48px;padding:0 18px;border-radius:14px;font-weight:900}
.view-admin .um-add-btn .ui-icon{width:18px;height:18px}
.view-admin .um-stats-row{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:14px}
.view-admin .um-stat-card,.view-admin .um-filters-card,.view-admin .um-table-card,.view-admin .um-security-wrap,.view-admin .um-tip-card{background:var(--v39-surface,#fff);border:1px solid var(--v39-line,#dbe5f3);border-radius:18px;box-shadow:0 8px 24px rgba(15,23,42,.05)}
.view-admin .um-stat-card{padding:20px;display:flex;align-items:center;gap:16px;min-height:102px}
.view-admin .um-stat-icon{width:56px;height:56px;border-radius:50%;display:grid;place-items:center;flex:0 0 auto}
.view-admin .um-stat-icon .ui-icon{width:28px;height:28px}
.view-admin .um-stat-card.blue .um-stat-icon{background:#edf4ff;color:#2563eb}
.view-admin .um-stat-card.green .um-stat-icon{background:#e8f8eb;color:#16a34a}
.view-admin .um-stat-card.orange .um-stat-icon{background:#fff3e5;color:#f59e0b}
.view-admin .um-stat-card.purple .um-stat-icon{background:#f3ecff;color:#8b5cf6}
.view-admin .um-stat-card.mint .um-stat-icon{background:#e9f8ef;color:#16a34a}
.view-admin .um-stat-copy{display:grid;gap:4px}.view-admin .um-stat-copy small{font-size:13px;color:#475569;font-weight:700}.view-admin .um-stat-copy b{font-size:38px;line-height:1;color:#14213d}.view-admin .um-stat-copy span{font-size:12px;color:#64748b}
.view-admin .um-filters-card{padding:16px;display:grid;grid-template-columns:minmax(280px,1fr) 220px 220px auto;gap:14px;align-items:center}
.view-admin .um-filter-search,.view-admin .um-select-wrap,.view-admin .um-reset-btn{min-height:48px;border:1px solid var(--v39-line,#dbe5f3);border-radius:14px;background:#fff}
.view-admin .um-filter-search{display:flex;align-items:center;gap:10px;padding:0 14px}.view-admin .um-filter-search .ui-icon,.view-admin .um-select-wrap .ui-icon,.view-admin .um-reset-btn .ui-icon{width:18px;height:18px;color:#64748b;flex:0 0 auto}
.view-admin .um-filter-search input{border:0;outline:0;background:transparent;width:100%;font-size:13px;color:#14213d}
.view-admin .um-select-wrap{display:flex;align-items:center;gap:10px;padding:0 14px}.view-admin .um-select-wrap select{border:0;outline:0;background:transparent;width:100%;font-size:13px;color:#14213d}
.view-admin .um-reset-btn{display:inline-flex;align-items:center;justify-content:center;gap:10px;padding:0 16px;font-weight:800;white-space:nowrap}
.view-admin .um-table-card{padding:0;overflow:hidden}
.view-admin .um-grid-row{display:grid;grid-template-columns:minmax(260px,1.8fr) 110px 110px 110px 140px 120px 90px 170px 260px;gap:12px;align-items:center}
.view-admin .um-table-head{padding:16px 18px;border-bottom:1px solid var(--v39-line,#dbe5f3);background:#fff;font-size:12px;font-weight:800;color:#64748b;text-transform:none}
.view-admin .um-table-head .actions{text-align:right}
.view-admin .um-table-body{padding:10px 18px 0;display:grid;gap:10px}
.view-admin .um-user-row{padding:12px 0;border-bottom:1px solid #eef3fa;background:transparent}
.view-admin .um-user-row:last-child{border-bottom:0}
.view-admin .um-user-col.primary{display:flex;align-items:center;gap:14px;min-width:0}
.view-admin .um-avatar{width:44px;height:44px;border-radius:50%;display:grid;place-items:center;background:#eef4ff;color:#2563eb;font-weight:900;font-size:18px;flex:0 0 auto}
.view-admin .um-user-id{display:grid;min-width:0}.view-admin .um-user-id b{font-size:15px;color:#14213d;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.view-admin .um-user-id small{font-size:12px;color:#64748b;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.view-admin .um-chip,.view-admin .um-position{display:inline-flex;align-items:center;justify-content:center;min-height:28px;padding:0 10px;border-radius:9px;border:1px solid transparent;font-size:12px;font-weight:700;white-space:nowrap}
.view-admin .um-chip.blue{background:#edf4ff;color:#2563eb;border-color:#dbeafe}.view-admin .um-chip.cyan{background:#eefcff;color:#0891b2;border-color:#c6f2ff}.view-admin .um-chip.yellow{background:#fff6df;color:#b45309;border-color:#fde68a}
.view-admin .um-position{justify-content:flex-start;background:#f8fafc;color:#475569;border-color:#e2e8f0}
.view-admin .um-actions{display:flex;justify-content:flex-end;gap:8px;flex-wrap:wrap}.view-admin .um-actions button{min-height:36px;padding:0 12px;border-radius:10px;font-size:12px;font-weight:800}
.view-admin .um-table-foot{display:grid;grid-template-columns:1fr auto auto;gap:16px;align-items:center;padding:16px 18px;border-top:1px solid var(--v39-line,#dbe5f3);background:#fff}
.view-admin .um-foot-note,.view-admin .um-per-page{font-size:13px;color:#64748b}
.view-admin .um-pagination{display:flex;align-items:center;gap:8px}.view-admin .um-pagination .ghost{min-width:36px;min-height:36px;border-radius:10px;padding:0 12px;background:#2563eb;color:#fff;border-color:#2563eb}
.view-admin .um-security-wrap{padding:14px 0 0;background:transparent;border:0;box-shadow:none}
.view-admin .um-security-title{display:flex;align-items:center;gap:10px;margin-bottom:12px;color:#14213d}.view-admin .um-security-title span{display:grid;place-items:center}.view-admin .um-security-title .ui-icon{width:18px;height:18px;color:#64748b}.view-admin .um-security-title h2{margin:0;font-size:14px}
.view-admin .um-security-row{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px}
.view-admin .um-security-card{background:#fff;border:1px solid var(--v39-line,#dbe5f3);border-radius:18px;box-shadow:0 8px 24px rgba(15,23,42,.05);padding:18px;display:grid;grid-template-columns:46px minmax(0,1fr) auto;gap:12px;align-items:center}
.view-admin .um-security-icon{width:46px;height:46px;border-radius:50%;display:grid;place-items:center}.view-admin .um-security-icon .ui-icon{width:22px;height:22px}.view-admin .um-security-icon.blue{background:#edf4ff;color:#2563eb}.view-admin .um-security-icon.green{background:#e9f8ef;color:#16a34a}.view-admin .um-security-icon.orange{background:#fff3e5;color:#f59e0b}
.view-admin .um-security-card b{display:block;font-size:18px;color:#14213d}.view-admin .um-security-card small{display:block;font-size:12px;color:#64748b;margin-top:3px}
.view-admin .um-security-card em{border-radius:999px;padding:6px 10px;font-style:normal;font-size:11px;font-weight:900;white-space:nowrap}.view-admin .um-security-card .ok{background:#dcfce7;color:#15803d}.view-admin .um-security-card .warn{background:#fff3cd;color:#c2410c}.view-admin .um-security-card .off{background:#e2e8f0;color:#475569}
.view-admin .um-tip-card{position:fixed;right:24px;bottom:24px;z-index:8;width:380px;padding:20px;display:grid;grid-template-columns:56px 1fr auto;gap:14px;align-items:start}
.view-admin .um-tip-plus{width:56px;height:56px;border:0;border-radius:50%;display:grid;place-items:center;background:#2563eb;color:#fff}.view-admin .um-tip-plus .ui-icon{width:24px;height:24px}
.view-admin .um-tip-copy{display:grid;gap:6px}.view-admin .um-tip-copy b{font-size:18px;color:#14213d}.view-admin .um-tip-copy small{font-size:13px;line-height:1.45;color:#64748b}
.view-admin .um-tip-close{border:0;background:transparent;color:#64748b;font-size:24px;line-height:1;cursor:pointer}
.view-admin .um-empty{padding:24px;font-size:13px;color:#64748b}
body.dark .view-admin .um-stat-card,body.dark .view-admin .um-filters-card,body.dark .view-admin .um-table-card,body.dark .view-admin .um-security-card,body.dark .view-admin .um-tip-card{background:var(--panel,#111827);border-color:var(--border,#334155)}
body.dark .view-admin .um-head h1,body.dark .view-admin .um-stat-copy b,body.dark .view-admin .um-user-id b,body.dark .view-admin .um-security-card b,body.dark .view-admin .um-tip-copy b,body.dark .view-admin .um-security-title h2{color:var(--text,#e5e7eb)}
body.dark .view-admin .um-head p,body.dark .view-admin .um-stat-copy small,body.dark .view-admin .um-stat-copy span,body.dark .view-admin .um-table-head,body.dark .view-admin .um-user-id small,body.dark .view-admin .um-foot-note,body.dark .view-admin .um-per-page,body.dark .view-admin .um-security-card small,body.dark .view-admin .um-tip-copy small{color:#94a3b8}
body.dark .view-admin .um-filter-search,body.dark .view-admin .um-select-wrap,body.dark .view-admin .um-reset-btn,body.dark .view-admin .um-position{background:var(--bg,#0f172a);border-color:var(--border,#334155)}
body.dark .view-admin .um-filter-search input,body.dark .view-admin .um-select-wrap select{color:var(--text,#e5e7eb)}
@media (max-width: 1450px){.view-admin .um-grid-row{grid-template-columns:minmax(240px,1.6fr) 100px 100px 100px 120px 110px 80px 150px 230px}}
@media (max-width: 1280px){.view-admin .um-stats-row{grid-template-columns:repeat(2,minmax(0,1fr))}.view-admin .um-filters-card{grid-template-columns:minmax(220px,1fr) 1fr 1fr auto}.view-admin .um-grid-row{grid-template-columns:minmax(240px,1.4fr) repeat(4,100px) 110px 140px 210px;font-size:12px}.view-admin .um-tip-card{width:340px}}
@media (max-width: 1080px){.view-admin .um-filters-card{grid-template-columns:1fr}.view-admin .um-table-head{display:none}.view-admin .um-user-row{grid-template-columns:1fr;gap:10px;padding:16px 0}.view-admin .um-user-row>div{display:flex;align-items:center;justify-content:space-between;gap:12px}.view-admin .um-user-row .um-actions{justify-content:flex-start}.view-admin .um-table-foot{grid-template-columns:1fr;justify-items:start}.view-admin .um-security-row{grid-template-columns:1fr}.view-admin .um-tip-card{position:static;width:auto;grid-template-columns:56px 1fr auto}}
@media (max-width: 720px){.view-admin .content{padding:10px!important}.view-admin .um-head{flex-direction:column;align-items:stretch}.view-admin .um-stats-row{grid-template-columns:1fr}.view-admin .um-security-card{grid-template-columns:46px 1fr}.view-admin .um-security-card em{grid-column:2}}


/* v39.6.4 User Management polish hotfix */
/* Remove visual footprint if any old helper remains cached */
.view-admin .um-tip-card{display:none!important;}

/* User identity should not inherit .primary blue button style */
.view-admin .um-user-col.user-identity,
.view-admin .um-user-row .um-user-col.user-identity{
  background:transparent!important;
  color:inherit!important;
  border:0!important;
  box-shadow:none!important;
  border-radius:0!important;
  padding:0!important;
}
.view-admin .um-user-col.user-identity .um-avatar{
  background:#eef4ff!important;
  color:#2563eb!important;
}
.view-admin .um-user-col.user-identity .um-user-id b{
  color:var(--v39-text,#14213d)!important;
}
.view-admin .um-user-col.user-identity .um-user-id small{
  color:var(--v39-muted,#64748b)!important;
}

/* Fit action buttons on normal screens */
.view-admin .um-grid-row{
  grid-template-columns:minmax(210px,1.5fr) 86px 94px 80px 110px 90px 78px 116px 215px!important;
  gap:10px!important;
}
.view-admin .um-table-card{
  overflow:hidden!important;
}
.view-admin .um-actions{
  display:flex!important;
  justify-content:flex-end!important;
  align-items:center!important;
  gap:6px!important;
  flex-wrap:nowrap!important;
  min-width:0!important;
}
.view-admin .um-actions button{
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  min-height:30px!important;
  height:30px!important;
  padding:0 9px!important;
  border-radius:9px!important;
  font-size:10.5px!important;
  line-height:1!important;
  font-weight:850!important;
  white-space:nowrap!important;
  opacity:1!important;
  visibility:visible!important;
  max-width:none!important;
}
.view-admin .um-actions button[data-action="editUser"]{
  min-width:42px!important;
  color:#2563eb!important;
  background:#f8fbff!important;
  border:1px solid #dbe5f3!important;
}
.view-admin .um-actions button[data-action="resetUserLock"]{
  min-width:76px!important;
  color:#334155!important;
  background:#f8fbff!important;
  border:1px solid #dbe5f3!important;
}
.view-admin .um-actions button[data-action="deleteUser"],
.view-admin .um-actions button[data-action="rejectUser"]{
  min-width:64px!important;
  color:#dc2626!important;
  background:#fff7f7!important;
  border:1px solid #fecaca!important;
}
.view-admin .um-actions button[data-action="approveUser"]{
  min-width:68px!important;
  color:#047857!important;
  background:#ecfdf5!important;
  border:1px solid #bbf7d0!important;
}

/* Clickable stat/security cards */
.view-admin .um-stat-card.clickable,
.view-admin .um-security-card.clickable{
  cursor:pointer!important;
  text-align:left!important;
  appearance:none!important;
  font:inherit!important;
}
.view-admin .um-stat-card.clickable:hover,
.view-admin .um-security-card.clickable:hover{
  transform:translateY(-1px);
  border-color:rgba(37,99,235,.28)!important;
  box-shadow:0 12px 28px rgba(15,23,42,.075)!important;
}

/* Pending Approval modal */
.pending-approval-modal-v3964{
  display:grid!important;
  gap:10px!important;
  min-width:min(760px,80vw)!important;
}
.pending-approval-row-v3964{
  display:grid!important;
  grid-template-columns:minmax(220px,1fr) minmax(240px,1.4fr) auto!important;
  gap:12px!important;
  align-items:center!important;
  padding:12px!important;
  border:1px solid var(--v39-line,#dbe5f3)!important;
  border-radius:14px!important;
  background:#fff!important;
}
.pending-user-main-v3964{
  display:flex!important;
  align-items:center!important;
  gap:10px!important;
  min-width:0!important;
}
.pending-avatar-v3964{
  width:38px!important;
  height:38px!important;
  border-radius:999px!important;
  display:grid!important;
  place-items:center!important;
  background:#eef4ff!important;
  color:#2563eb!important;
  font-weight:900!important;
}
.pending-user-main-v3964 b,
.pending-user-main-v3964 small{
  display:block!important;
  white-space:nowrap!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
}
.pending-user-main-v3964 b{font-size:13px!important;color:var(--v39-text,#14213d)!important;}
.pending-user-main-v3964 small{font-size:11px!important;color:var(--v39-muted,#64748b)!important;}
.pending-user-meta-v3964{
  display:flex!important;
  flex-wrap:wrap!important;
  gap:6px!important;
}
.pending-user-meta-v3964 span{
  border:1px solid var(--v39-line,#dbe5f3)!important;
  border-radius:999px!important;
  padding:4px 8px!important;
  background:#f8fbff!important;
  font-size:10.5px!important;
  color:var(--v39-muted,#64748b)!important;
}
.pending-user-meta-v3964 b{color:var(--v39-text,#14213d)!important;}
.pending-actions-v3964{
  display:flex!important;
  justify-content:flex-end!important;
  gap:7px!important;
  flex-wrap:wrap!important;
}
.pending-actions-v3964 button{
  min-height:30px!important;
  border-radius:10px!important;
  padding:0 10px!important;
  font-size:10.5px!important;
  font-weight:850!important;
}
.pending-empty-v3964{
  min-height:150px!important;
  display:grid!important;
  place-items:center!important;
  text-align:center!important;
  border:1px dashed var(--v39-line,#dbe5f3)!important;
  border-radius:16px!important;
  background:#f8fbff!important;
}
.pending-empty-v3964 b{font-size:15px!important;color:var(--v39-text,#14213d)!important;}
.pending-empty-v3964 small{display:block;margin-top:6px;color:var(--v39-muted,#64748b)!important;}

body.dark .view-admin .um-user-col.user-identity .um-user-id b,
body.dark .pending-user-main-v3964 b,
body.dark .pending-user-meta-v3964 b,
body.dark .pending-empty-v3964 b{color:var(--text,#e5e7eb)!important;}
body.dark .view-admin .um-user-col.user-identity .um-user-id small,
body.dark .pending-user-main-v3964 small{color:#94a3b8!important;}
body.dark .pending-approval-row-v3964,
body.dark .pending-user-meta-v3964 span,
body.dark .pending-empty-v3964{
  background:var(--panel,#111827)!important;
  border-color:var(--border,#334155)!important;
}

@media(max-width:1320px){
  .view-admin .um-table-card{
    overflow-x:auto!important;
  }
  .view-admin .um-grid-row{
    min-width:1120px!important;
  }
}
@media(max-width:820px){
  .pending-approval-row-v3964{
    grid-template-columns:1fr!important;
  }
  .pending-actions-v3964{
    justify-content:flex-start!important;
  }
}


/* =========================================================
   v39.7 — Dark Mode + Responsive Final
   Safe CSS/layout polish only. No backend/logic change.
   ========================================================= */

/* Global responsive safety */
html, body {
  min-width: 0!important;
}
.shell,
.content,
.main,
.v39-page,
.view-home .content,
.view-admin .content,
.view-chat .content,
.view-notes .content {
  min-width: 0!important;
}
* {
  box-sizing: border-box;
}

/* Prevent accidental horizontal overflow */
.content {
  max-width: 100%!important;
}
img, video, canvas, iframe {
  max-width: 100%;
}

/* Dark mode base */
body.dark {
  --v39-surface:#111827;
  --v39-bg:#0f172a;
  --v39-text:#e5e7eb;
  --v39-muted:#94a3b8;
  --v39-line:#334155;
  --v39-primary:#60a5fa;
  --v39-primary-soft:rgba(96,165,250,.14);
  background:#0f172a!important;
  color:#e5e7eb!important;
}

body.dark .shell,
body.dark .content,
body.dark .main,
body.dark .topbar,
body.dark .v39-topbar {
  background:#0f172a!important;
  color:#e5e7eb!important;
  border-color:#334155!important;
}

body.dark .panel,
body.dark .card,
body.dark .v39-panel-card,
body.dark .v39-list-card,
body.dark .dashboard-card,
body.dark .metric-card,
body.dark .note-card,
body.dark .editor-side-card-v38,
body.dark .primary-note-pane,
body.dark .editor-main-v38,
body.dark .notebook-card,
body.dark .note-list-panel,
body.dark .sidebar,
body.dark .v39-sidebar {
  background:#111827!important;
  color:#e5e7eb!important;
  border-color:#334155!important;
  box-shadow:0 10px 28px rgba(0,0,0,.22)!important;
}

/* Dark mode typography */
body.dark h1,
body.dark h2,
body.dark h3,
body.dark h4,
body.dark b,
body.dark strong,
body.dark .title,
body.dark .card-title {
  color:#e5e7eb!important;
}
body.dark p,
body.dark small,
body.dark .muted,
body.dark .subtitle {
  color:#94a3b8!important;
}

/* Dark mode inputs/buttons */
body.dark input,
body.dark select,
body.dark textarea,
body.dark [contenteditable],
body.dark .modal-input,
body.dark .title-input,
body.dark .search-input,
body.dark .v39-searchbox,
body.dark .um-filter-search,
body.dark .um-select-wrap,
body.dark .chat-search-box,
body.dark .smart-composer-pro {
  background:#0f172a!important;
  color:#e5e7eb!important;
  border-color:#334155!important;
}
body.dark input::placeholder,
body.dark textarea::placeholder {
  color:#64748b!important;
}
body.dark button.secondary,
body.dark .secondary,
body.dark .ghost {
  background:#1e293b!important;
  color:#e5e7eb!important;
  border-color:#334155!important;
}
body.dark button.secondary:hover,
body.dark .secondary:hover {
  background:#273449!important;
}

/* Sidebar dark polish */
body.dark .v39-sidebar {
  background:linear-gradient(180deg,#111827,#0f172a)!important;
}
body.dark .v39-brand-row,
body.dark .v39-user-card,
body.dark .v39-sidebar-bottom-toggle {
  border-color:#334155!important;
}
body.dark .v39-nav button,
body.dark .nav-btn {
  color:#cbd5e1!important;
}
body.dark .v39-nav button.active,
body.dark .nav-btn.active {
  background:rgba(96,165,250,.15)!important;
  color:#93c5fd!important;
}
body.dark .v39-section-title {
  color:#64748b!important;
}

/* Dashboard responsive and dark */
body.dark .hero-card,
body.dark .welcome-card,
body.dark .recent-card,
body.dark .task-card,
body.dark .activity-card,
body.dark .notification-card {
  background:#111827!important;
  color:#e5e7eb!important;
  border-color:#334155!important;
}
body.dark .empty-state {
  color:#94a3b8!important;
}

/* Notes/editor dark */
body.dark #noteEditor,
body.dark .note-editor,
body.dark .rich-editor,
body.dark .editor-canvas {
  background:#111827!important;
  color:#e5e7eb!important;
  border-color:#334155!important;
}
body.dark .rich-toolbar,
body.dark .toolbar {
  background:#0f172a!important;
  border-color:#334155!important;
}
body.dark .rich-toolbar button,
body.dark .toolbar button,
body.dark .rich-toolbar select,
body.dark .toolbar select {
  background:#111827!important;
  color:#e5e7eb!important;
  border-color:#334155!important;
}
body.dark .note-summary-grid-v38 dd,
body.dark .note-summary-grid-v38 dt {
  color:#e5e7eb!important;
}
body.dark .note-summary-grid-v38 dt {
  color:#94a3b8!important;
}

/* Chat dark */
body.dark .view-chat .messenger-list {
  background:linear-gradient(180deg,#0f172a,#111827)!important;
}
body.dark .view-chat .chat-bubble {
  background:#111827!important;
  color:#e5e7eb!important;
  border-color:#334155!important;
}
body.dark .view-chat .chat-row.mine .chat-bubble {
  background:rgba(37,99,235,.25)!important;
  border-color:rgba(96,165,250,.30)!important;
}
body.dark .view-chat .date-pill {
  background:rgba(15,23,42,.85)!important;
  color:#cbd5e1!important;
  border-color:#334155!important;
}
body.dark .view-chat .chat-reply-preview {
  background:rgba(96,165,250,.12)!important;
}

/* User management dark */
body.dark .view-admin .um-stat-card,
body.dark .view-admin .um-filters-card,
body.dark .view-admin .um-table-card,
body.dark .view-admin .um-security-card,
body.dark .view-admin .um-tip-card {
  background:#111827!important;
  border-color:#334155!important;
  color:#e5e7eb!important;
}
body.dark .view-admin .um-table-head,
body.dark .view-admin .um-table-foot {
  background:#111827!important;
  border-color:#334155!important;
}
body.dark .view-admin .um-user-row {
  border-color:#334155!important;
}
body.dark .view-admin .um-user-row:hover {
  background:#1e293b!important;
}
body.dark .view-admin .um-position,
body.dark .view-admin .um-filter-search,
body.dark .view-admin .um-select-wrap,
body.dark .view-admin .um-reset-btn {
  background:#0f172a!important;
  border-color:#334155!important;
  color:#e5e7eb!important;
}

/* Modal dark */
body.dark .modal,
body.dark .modal-card,
body.dark .dialog,
body.dark .modal-content {
  background:#111827!important;
  color:#e5e7eb!important;
  border-color:#334155!important;
}
body.dark .modal-backdrop {
  background:rgba(2,6,23,.72)!important;
}
body.dark .modal-section-title-v396 {
  background:#0f172a!important;
  border-color:#334155!important;
  color:#e5e7eb!important;
}

/* Dropdown/menu dark */
body.dark .dropdown,
body.dark .more-menu,
body.dark .context-menu,
body.dark .chat-message-menu,
body.dark .popover {
  background:#111827!important;
  color:#e5e7eb!important;
  border-color:#334155!important;
  box-shadow:0 18px 38px rgba(0,0,0,.35)!important;
}

/* Responsive shell */
@media (max-width: 1280px) {
  .v39-sidebar,
  .sidebar {
    width: 236px!important;
  }
  .shell:not(.sidebar-collapsed) .content,
  .shell:not(.sidebar-collapsed) .main {
    min-width:0!important;
  }
}

@media (max-width: 1100px) {
  .view-home .dashboard-grid,
  .dashboard-grid,
  .v39-dashboard-grid {
    grid-template-columns:1fr!important;
  }
  .view-home .metrics-grid,
  .metrics-grid {
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
  }
  .view-notes .notes-workspace,
  .notes-workspace-v38,
  .editor-layout-v38 {
    grid-template-columns:minmax(220px,280px) minmax(0,1fr)!important;
  }
  .editor-inspector-v38 {
    display:none!important;
  }
}

@media (max-width: 900px) {
  .shell {
    grid-template-columns:1fr!important;
  }
  .v39-sidebar,
  .sidebar {
    position:fixed!important;
    z-index:50!important;
    inset:0 auto 0 0!important;
    width:280px!important;
    transform:translateX(-102%)!important;
    transition:transform .2s ease!important;
  }
  .shell:not(.sidebar-collapsed) .v39-sidebar,
  .shell:not(.sidebar-collapsed) .sidebar {
    transform:translateX(0)!important;
  }
  .content,
  .main {
    margin-left:0!important;
    width:100%!important;
  }
  .topbar,
  .v39-topbar {
    padding-left:14px!important;
    padding-right:14px!important;
  }
  .v39-top-tools {
    gap:8px!important;
  }
  .v39-searchbox {
    max-width:260px!important;
  }
}

@media (max-width: 780px) {
  .view-home .metrics-grid,
  .metrics-grid,
  .cards-grid,
  .v39-cards-grid {
    grid-template-columns:1fr!important;
  }
  .view-notes .notes-workspace,
  .notes-workspace-v38,
  .editor-layout-v38 {
    grid-template-columns:1fr!important;
  }
  .note-list-panel,
  .notes-list-shell,
  .notelist-panel {
    max-height:320px!important;
  }
  .editor-inspector-v38 {
    display:block!important;
    max-height:none!important;
  }
  .editor-main-v38,
  .primary-note-pane {
    min-height:480px!important;
  }
  .rich-toolbar,
  .toolbar {
    overflow-x:auto!important;
    white-space:nowrap!important;
  }
  .chat-layout-pro,
  .view-chat .chat-layout-pro {
    grid-template-columns:1fr!important;
    height:auto!important;
  }
  .view-chat .chat-channels-pro {
    max-height:260px!important;
  }
  .view-chat .chat-box-pro {
    min-height:560px!important;
  }
  .view-chat .chat-message-stack {
    max-width:88%!important;
  }
}

@media (max-width: 620px) {
  .content {
    padding:10px!important;
  }
  .topbar-title h1,
  .v39-page-head h1,
  .um-head h1 {
    font-size:20px!important;
  }
  .topbar-title p,
  .v39-page-head p,
  .um-head p {
    font-size:11.5px!important;
  }
  .v39-searchbox {
    display:none!important;
  }
  .editor-command-bar-v38,
  .actionbar,
  .topbar-note-actions {
    flex-wrap:wrap!important;
  }
  .modal-card,
  .modal-content {
    width:calc(100vw - 24px)!important;
    max-width:calc(100vw - 24px)!important;
    max-height:calc(100vh - 24px)!important;
    overflow:auto!important;
  }
  .modal-grid,
  .modal-grid.user-edit-modal-v396 {
    grid-template-columns:1fr!important;
  }
  .view-chat .smart-compose-shell {
    padding:8px!important;
  }
  .view-chat .chat-compose-tools {
    flex-wrap:wrap!important;
  }
  .view-chat .send-chat-btn {
    margin-left:0!important;
  }
}

/* Scrollbars for panels */
.editor-inspector-v38,
.view-chat .chat-insights,
.view-chat .chat-room-info-panel,
.note-list-panel,
.notes-list-v3845,
.room-group,
.content {
  scrollbar-width:thin;
}
.editor-inspector-v38::-webkit-scrollbar,
.view-chat .chat-insights::-webkit-scrollbar,
.view-chat .chat-room-info-panel::-webkit-scrollbar,
.note-list-panel::-webkit-scrollbar,
.notes-list-v3845::-webkit-scrollbar,
.room-group::-webkit-scrollbar,
.content::-webkit-scrollbar {
  width:8px;
  height:8px;
}
.editor-inspector-v38::-webkit-scrollbar-thumb,
.view-chat .chat-insights::-webkit-scrollbar-thumb,
.view-chat .chat-room-info-panel::-webkit-scrollbar-thumb,
.note-list-panel::-webkit-scrollbar-thumb,
.notes-list-v3845::-webkit-scrollbar-thumb,
.room-group::-webkit-scrollbar-thumb,
.content::-webkit-scrollbar-thumb {
  background:#cbd5e1;
  border-radius:999px;
}
body.dark .editor-inspector-v38::-webkit-scrollbar-thumb,
body.dark .view-chat .chat-insights::-webkit-scrollbar-thumb,
body.dark .view-chat .chat-room-info-panel::-webkit-scrollbar-thumb,
body.dark .note-list-panel::-webkit-scrollbar-thumb,
body.dark .notes-list-v3845::-webkit-scrollbar-thumb,
body.dark .room-group::-webkit-scrollbar-thumb,
body.dark .content::-webkit-scrollbar-thumb {
  background:#475569;
}


/* =========================================================
   v39.7.1 — Dark Mode UI Bug Fix
   Fix pages still showing light surfaces in dark mode.
   Scoped overrides only.
   ========================================================= */

body.dark {
  background:#0f172a!important;
}

/* Notebook page dark-mode fix */
body.dark .view-notebooks,
body.dark .view-notebooks .content,
body.dark .view-notebooks .main,
body.dark .notebook-page,
body.dark .notebook-browser,
body.dark .notebook-list-page {
  background:#0f172a!important;
  color:#e5e7eb!important;
}

body.dark .view-notebooks .v39-page-head,
body.dark .view-notebooks .page-head,
body.dark .view-notebooks .top-section {
  background:#0f172a!important;
  border-color:#334155!important;
}

body.dark .view-notebooks .panel,
body.dark .view-notebooks .notebook-section,
body.dark .view-notebooks .notebook-category-section,
body.dark .view-notebooks .category-panel,
body.dark .view-notebooks .notebook-group,
body.dark .view-notebooks .notebook-section-card,
body.dark .view-notebooks .notebook-category-card {
  background:#111827!important;
  color:#e5e7eb!important;
  border-color:#334155!important;
  box-shadow:0 12px 28px rgba(0,0,0,.22)!important;
}

body.dark .view-notebooks .stat-card,
body.dark .view-notebooks .metric-card,
body.dark .view-notebooks .notebook-stat,
body.dark .view-notebooks .summary-card,
body.dark .view-notebooks .notebook-summary-card {
  background:#111827!important;
  color:#e5e7eb!important;
  border-color:#334155!important;
}

body.dark .view-notebooks .notebook-card,
body.dark .view-notebooks .notebook-tile,
body.dark .view-notebooks .notebook-item,
body.dark .view-notebooks .notebook-grid-card {
  background:#1e293b!important;
  color:#e5e7eb!important;
  border-color:#334155!important;
  box-shadow:none!important;
}

body.dark .view-notebooks .notebook-card:hover,
body.dark .view-notebooks .notebook-tile:hover,
body.dark .view-notebooks .notebook-item:hover {
  background:#24324a!important;
  border-color:rgba(96,165,250,.35)!important;
}

body.dark .view-notebooks .notebook-card.active,
body.dark .view-notebooks .notebook-tile.active,
body.dark .view-notebooks .notebook-item.active {
  background:rgba(37,99,235,.22)!important;
  border-color:#3b82f6!important;
}

body.dark .view-notebooks h1,
body.dark .view-notebooks h2,
body.dark .view-notebooks h3,
body.dark .view-notebooks b,
body.dark .view-notebooks strong {
  color:#e5e7eb!important;
}

body.dark .view-notebooks p,
body.dark .view-notebooks small,
body.dark .view-notebooks .muted {
  color:#94a3b8!important;
}

/* Prevent white category containers in notebook page */
body.dark .view-notebooks [class*="section"],
body.dark .view-notebooks [class*="category"],
body.dark .view-notebooks [class*="browser"] {
  border-color:#334155!important;
}

body.dark .view-notebooks [class*="section"]:not(button):not(input):not(select):not(textarea),
body.dark .view-notebooks [class*="category"]:not(button):not(input):not(select):not(textarea) {
  background-color:transparent;
}

body.dark .view-notebooks .panel,
body.dark .view-notebooks .notebook-section,
body.dark .view-notebooks .notebook-category-section,
body.dark .view-notebooks .category-panel {
  background:#111827!important;
}

/* Notebook statistic cards that stayed white */
body.dark .view-notebooks .stats-grid > *,
body.dark .view-notebooks .summary-grid > *,
body.dark .view-notebooks .notebook-stats > * {
  background:#111827!important;
  color:#e5e7eb!important;
  border-color:#334155!important;
}

/* Chat page dark-mode hardening */
body.dark .view-chat,
body.dark .view-chat .content,
body.dark .view-chat .main,
body.dark .view-chat .chat-layout-pro,
body.dark .view-chat .chat-layout-preview-match {
  background:#0f172a!important;
  color:#e5e7eb!important;
}

body.dark .view-chat .chat-layout-pro > .panel,
body.dark .view-chat .chat-layout-preview-match > .panel,
body.dark .view-chat .chat-channels-pro,
body.dark .view-chat .chat-box-pro,
body.dark .view-chat .chat-insights,
body.dark .view-chat .chat-room-info-panel {
  background:#111827!important;
  color:#e5e7eb!important;
  border-color:#334155!important;
}

/* Fix white chat room header */
body.dark .view-chat .chat-room-head-pro,
body.dark .view-chat .room-head,
body.dark .view-chat .chat-header,
body.dark .view-chat .conversation-header {
  background:#111827!important;
  color:#e5e7eb!important;
  border-color:#334155!important;
}

body.dark .view-chat .room-title-block h2,
body.dark .view-chat .room-title-block b,
body.dark .view-chat .chat-room-head-pro h2,
body.dark .view-chat .chat-room-head-pro b {
  color:#e5e7eb!important;
}

body.dark .view-chat .room-title-block small,
body.dark .view-chat .chat-room-head-pro small {
  color:#94a3b8!important;
}

body.dark .view-chat .room-title-icon,
body.dark .view-chat .chat-avatar,
body.dark .view-chat .room-card-icon {
  background:rgba(96,165,250,.15)!important;
  color:#93c5fd!important;
}

body.dark .view-chat .room-icon-action,
body.dark .view-chat .filter-chip,
body.dark .view-chat .chat-tabs button,
body.dark .view-chat .new-chat-btn.secondary {
  background:#1e293b!important;
  color:#e5e7eb!important;
  border-color:#334155!important;
}

body.dark .view-chat .room-icon-action:hover,
body.dark .view-chat .chat-tabs button.active {
  background:rgba(96,165,250,.16)!important;
  color:#93c5fd!important;
  border-color:rgba(96,165,250,.32)!important;
}

body.dark .view-chat .chat-search-box,
body.dark .view-chat .chat-search-box input {
  background:#0f172a!important;
  color:#e5e7eb!important;
  border-color:#334155!important;
}

body.dark .view-chat .chat-room-card {
  background:transparent!important;
  color:#e5e7eb!important;
  border-color:transparent!important;
}

body.dark .view-chat .chat-room-card:hover {
  background:#1e293b!important;
  border-color:#334155!important;
}

body.dark .view-chat .chat-room-card.active {
  background:rgba(37,99,235,.24)!important;
  border-color:rgba(96,165,250,.32)!important;
}

body.dark .view-chat .chat-room-card b,
body.dark .view-chat .room-card-main b {
  color:#e5e7eb!important;
}

body.dark .view-chat .chat-room-card small,
body.dark .view-chat .room-card-main small,
body.dark .view-chat .room-card-meta small {
  color:#94a3b8!important;
}

/* Fix message area and composer */
body.dark .view-chat .messenger-list {
  background:#0f172a!important;
  border-color:#334155!important;
}

body.dark .view-chat .smart-compose-shell,
body.dark .view-chat .smart-composer-pro,
body.dark .view-chat .chat-compose-tools {
  background:#111827!important;
  border-color:#334155!important;
}

body.dark .view-chat .smart-composer-pro textarea {
  background:#111827!important;
  color:#e5e7eb!important;
}

body.dark .view-chat .attach-chat-btn,
body.dark .view-chat .complaint-toggle,
body.dark .view-chat .send-chat-btn {
  border-color:#334155!important;
}

/* Chat right panel cards */
body.dark .view-chat .room-info-card,
body.dark .view-chat .room-panel-block,
body.dark .view-chat .room-insight-card,
body.dark .view-chat .chat-info-card,
body.dark .view-chat .pinned-card,
body.dark .view-chat .files-card,
body.dark .view-chat .complaint-summary-card {
  background:#111827!important;
  color:#e5e7eb!important;
  border-color:#334155!important;
}

body.dark .view-chat .room-info-card h3,
body.dark .view-chat .room-panel-block h3,
body.dark .view-chat .room-info-card b,
body.dark .view-chat .room-panel-block b {
  color:#e5e7eb!important;
}

body.dark .view-chat .room-info-card small,
body.dark .view-chat .room-panel-block small,
body.dark .view-chat .room-info-card p,
body.dark .view-chat .room-panel-block p {
  color:#94a3b8!important;
}

/* Fix white scrollbar rail in chat */
body.dark .view-chat *::-webkit-scrollbar-track,
body.dark .view-notebooks *::-webkit-scrollbar-track {
  background:#0f172a!important;
}
body.dark .view-chat *::-webkit-scrollbar-thumb,
body.dark .view-notebooks *::-webkit-scrollbar-thumb {
  background:#475569!important;
  border-radius:999px!important;
}

/* Topbar search dark contrast */
body.dark .v39-top-tools,
body.dark .v39-searchbox {
  background:#111827!important;
  border-color:#334155!important;
  color:#e5e7eb!important;
}

body.dark .v39-top-tools button {
  background:#111827!important;
  border-color:#334155!important;
  color:#e5e7eb!important;
}

/* Badges dark contrast */
body.dark .category-badge,
body.dark .status-badge,
body.dark .status-pill,
body.dark .role-pill-v396,
body.dark .online-pill-v396,
body.dark .notebook-category-badge-v3938 {
  border-color:rgba(148,163,184,.22)!important;
}

body.dark .category-badge.admin,
body.dark .notebook-category-badge-v3938.admin {
  background:rgba(139,92,246,.18)!important;
  color:#c4b5fd!important;
}

body.dark .category-badge.private,
body.dark .category-badge.pribadi,
body.dark .notebook-category-badge-v3938.private,
body.dark .notebook-category-badge-v3938.pribadi {
  background:rgba(245,158,11,.14)!important;
  color:#fbbf24!important;
}

body.dark .category-badge.public,
body.dark .category-badge.publik,
body.dark .notebook-category-badge-v3938.public,
body.dark .notebook-category-badge-v3938.publik {
  background:rgba(20,184,166,.14)!important;
  color:#5eead4!important;
}

/* Avoid dark page cards accidentally staying pure white */
body.dark .view-notebooks .white,
body.dark .view-chat .white,
body.dark .view-notebooks [style*="background: white"],
body.dark .view-chat [style*="background: white"],
body.dark .view-notebooks [style*="background:#fff"],
body.dark .view-chat [style*="background:#fff"] {
  background:#111827!important;
  color:#e5e7eb!important;
}

/* More readable empty areas in dark mode */
body.dark .empty,
body.dark .v39-empty-block,
body.dark .empty-state {
  background:#111827!important;
  color:#94a3b8!important;
  border-color:#334155!important;
}

/* Ensure buttons do not become invisible */
body.dark button:not(.primary):not(.danger):not(.send-chat-btn),
body.dark .button:not(.primary):not(.danger) {
  border-color:#334155;
}


/* =========================================================
   v39.7.2 — Notebook Dark Mode Card Fix
   Fix remaining white cards on Notebook page dark mode.
   ========================================================= */

/* Notebook page top stats/cards still white in dark mode */
body.dark .view-notebooks .notebook-hero-card,
body.dark .view-notebooks .notebook-dashboard-card,
body.dark .view-notebooks .notebook-metric-card,
body.dark .view-notebooks .notebook-stat-card,
body.dark .view-notebooks .notebook-summary-item,
body.dark .view-notebooks .notebook-summary-stat,
body.dark .view-notebooks .notebook-kpi,
body.dark .view-notebooks .notebook-kpi-card,
body.dark .view-notebooks .metric-card,
body.dark .view-notebooks .stat-card,
body.dark .view-notebooks .summary-card,
body.dark .view-notebooks .v39-stat-card,
body.dark .view-notebooks .v39-metric-card,
body.dark .view-notebooks .v39-summary-card,
body.dark .view-notebooks .notebooks-stat-card,
body.dark .view-notebooks .notebooks-summary-card {
  background:#111827!important;
  color:#e5e7eb!important;
  border:1px solid #334155!important;
  box-shadow:0 10px 26px rgba(0,0,0,.18)!important;
}

/* Generic direct children in Notebook stat rows */
body.dark .view-notebooks .stats-grid > *,
body.dark .view-notebooks .metric-grid > *,
body.dark .view-notebooks .summary-grid > *,
body.dark .view-notebooks .notebook-stats > *,
body.dark .view-notebooks .notebooks-stats > *,
body.dark .view-notebooks .notebook-summary > *,
body.dark .view-notebooks .notebooks-summary > *,
body.dark .view-notebooks .v39-stats-grid > *,
body.dark .view-notebooks .v39-metrics-grid > * {
  background:#111827!important;
  color:#e5e7eb!important;
  border-color:#334155!important;
}

/* Hard target white rounded cards inside Notebook content */
body.dark .view-notebooks .content > div:not(.topbar):not(.v39-topbar),
body.dark .view-notebooks main > div:not(.topbar):not(.v39-topbar) {
  border-color:#334155;
}

body.dark .view-notebooks .notebook-page > .card,
body.dark .view-notebooks .notebook-page > .panel,
body.dark .view-notebooks .notebook-page > section,
body.dark .view-notebooks .notebook-browser > .card,
body.dark .view-notebooks .notebook-browser > .panel,
body.dark .view-notebooks .notebook-browser > section {
  background:#111827!important;
  color:#e5e7eb!important;
  border-color:#334155!important;
}

/* Specific: top stat boxes in screenshot */
body.dark .view-notebooks .notebook-overview-card,
body.dark .view-notebooks .overview-card,
body.dark .view-notebooks .overview-stat,
body.dark .view-notebooks .overview-metric,
body.dark .view-notebooks .notebook-counter-card,
body.dark .view-notebooks .counter-card {
  background:#111827!important;
  color:#e5e7eb!important;
  border-color:#334155!important;
}

/* Ensure text inside notebook stat cards is readable */
body.dark .view-notebooks .stat-card h3,
body.dark .view-notebooks .stat-card b,
body.dark .view-notebooks .metric-card h3,
body.dark .view-notebooks .metric-card b,
body.dark .view-notebooks .summary-card h3,
body.dark .view-notebooks .summary-card b,
body.dark .view-notebooks .notebook-stat-card h3,
body.dark .view-notebooks .notebook-stat-card b,
body.dark .view-notebooks .notebooks-stat-card h3,
body.dark .view-notebooks .notebooks-stat-card b {
  color:#e5e7eb!important;
}

body.dark .view-notebooks .stat-card small,
body.dark .view-notebooks .stat-card p,
body.dark .view-notebooks .metric-card small,
body.dark .view-notebooks .metric-card p,
body.dark .view-notebooks .summary-card small,
body.dark .view-notebooks .summary-card p,
body.dark .view-notebooks .notebook-stat-card small,
body.dark .view-notebooks .notebook-stat-card p,
body.dark .view-notebooks .notebooks-stat-card small,
body.dark .view-notebooks .notebooks-stat-card p {
  color:#94a3b8!important;
}

/* Category section card should stay dark, not transparent/white */
body.dark .view-notebooks .notebook-category-section,
body.dark .view-notebooks .notebook-section-card,
body.dark .view-notebooks .notebook-category-card,
body.dark .view-notebooks .category-panel,
body.dark .view-notebooks .notebook-group {
  background:#111827!important;
  color:#e5e7eb!important;
  border:1px solid #334155!important;
}

/* Notebook tiles should have darker card background */
body.dark .view-notebooks .notebook-card,
body.dark .view-notebooks .notebook-tile,
body.dark .view-notebooks .notebook-item,
body.dark .view-notebooks .notebook-grid-card,
body.dark .view-notebooks button[data-action="openNotebook"] {
  background:#1e293b!important;
  color:#e5e7eb!important;
  border-color:#334155!important;
}

/* Avoid accidental white cards caused by older CSS */
body.dark .view-notebooks div[class*="stat"],
body.dark .view-notebooks div[class*="metric"],
body.dark .view-notebooks div[class*="summary"] {
  border-color:#334155!important;
}

/* More targeted fallback: any white inline/background under notebook page */
body.dark .view-notebooks [style*="background: rgb(255"],
body.dark .view-notebooks [style*="background-color: rgb(255"],
body.dark .view-notebooks [style*="background:white"],
body.dark .view-notebooks [style*="background: white"],
body.dark .view-notebooks [style*="background:#fff"],
body.dark .view-notebooks [style*="background: #fff"],
body.dark .view-notebooks [style*="background-color:#fff"],
body.dark .view-notebooks [style*="background-color: #fff"] {
  background:#111827!important;
  color:#e5e7eb!important;
  border-color:#334155!important;
}

/* Keep primary action button blue, not affected by dark card overrides */
body.dark .view-notebooks button.primary,
body.dark .view-notebooks .primary {
  background:#2563eb!important;
  color:#fff!important;
  border-color:#2563eb!important;
}

/* Top Notebook title/header spacing and contrast */
body.dark .view-notebooks .v39-page-head h1,
body.dark .view-notebooks .page-head h1,
body.dark .view-notebooks h1 {
  color:#e5e7eb!important;
}
body.dark .view-notebooks .v39-page-head p,
body.dark .view-notebooks .page-head p {
  color:#94a3b8!important;
}

/* Pills/counters in category header */
body.dark .view-notebooks .count-pill,
body.dark .view-notebooks .notebook-count-pill,
body.dark .view-notebooks .category-count,
body.dark .view-notebooks .section-count {
  background:#1e293b!important;
  color:#cbd5e1!important;
  border:1px solid #475569!important;
}


/* =========================================================
   v39.7.3 — Precise Notebook Dark Mode Fix
   Actual Notebook page classes:
   .v39-notebook-page, .v39-notebook-overview, .v39-count-pill
   ========================================================= */

/* Top overview cards: Notebook tersedia / Total note aktif / Admin / Pribadi / Publik */
body.dark .v39-notebook-page .v39-notebook-overview > div,
body.dark .view-notebooks .v39-notebook-overview > div {
  background:#111827!important;
  color:#e5e7eb!important;
  border:1px solid #334155!important;
  box-shadow:0 10px 26px rgba(0,0,0,.20)!important;
}

body.dark .v39-notebook-page .v39-notebook-overview > div b,
body.dark .view-notebooks .v39-notebook-overview > div b {
  color:#e5e7eb!important;
}

body.dark .v39-notebook-page .v39-notebook-overview > div small,
body.dark .view-notebooks .v39-notebook-overview > div small {
  color:#94a3b8!important;
}

/* Category panel count pill: 1 notebook / 2 notebook */
body.dark .v39-notebook-page .v39-count-pill,
body.dark .view-notebooks .v39-count-pill {
  background:#1e293b!important;
  color:#cbd5e1!important;
  border:1px solid #475569!important;
  box-shadow:none!important;
}

/* Category panels */
body.dark .v39-notebook-page .v39-notebook-category-panel,
body.dark .view-notebooks .v39-notebook-category-panel {
  background:#111827!important;
  color:#e5e7eb!important;
  border:1px solid #334155!important;
  box-shadow:none!important;
}

body.dark .v39-notebook-page .v39-section-head h2,
body.dark .view-notebooks .v39-section-head h2 {
  color:#e5e7eb!important;
}

body.dark .v39-notebook-page .v39-section-head small,
body.dark .view-notebooks .v39-section-head small {
  color:#94a3b8!important;
}

/* Notebook tiles inside library grid */
body.dark .v39-notebook-page .v39-notebook-library-grid > *,
body.dark .view-notebooks .v39-notebook-library-grid > * {
  background:#1e293b!important;
  color:#e5e7eb!important;
  border-color:#334155!important;
}

body.dark .v39-notebook-page .v39-notebook-library-grid button,
body.dark .view-notebooks .v39-notebook-library-grid button {
  background:#1e293b!important;
  color:#e5e7eb!important;
  border-color:#334155!important;
}

body.dark .v39-notebook-page .v39-notebook-library-grid button:hover,
body.dark .view-notebooks .v39-notebook-library-grid button:hover {
  background:#24324a!important;
  border-color:rgba(96,165,250,.38)!important;
}

/* Ensure primary add notebook button remains blue */
body.dark .v39-notebook-page .v39-page-head button.primary,
body.dark .view-notebooks .v39-page-head button.primary {
  background:#2563eb!important;
  color:#fff!important;
  border-color:#2563eb!important;
}

/* Remove pure white inherited surfaces only in notebook page */
body.dark .v39-notebook-page .v39-notebook-overview > div[style],
body.dark .v39-notebook-page .v39-count-pill[style] {
  background:#111827!important;
  color:#e5e7eb!important;
}

/* Better contrast for notebook category badges inside tiles */
body.dark .v39-notebook-page .category-badge,
body.dark .view-notebooks .category-badge {
  border-color:rgba(148,163,184,.25)!important;
}


/* =========================================================
   v39.8 — Templates Page Redesign
   Matches selected design: list left + preview right.
   ========================================================= */
.tpl-page-v398{
  max-width:1500px;
  margin:0 auto;
  padding:14px 18px 18px;
  display:grid;
  gap:16px;
}
.tpl-head-v398{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:16px;
}
.tpl-head-v398 h1{
  margin:0;
  font-size:30px;
  line-height:1.05;
  letter-spacing:-.04em;
  color:var(--v39-text,#14213d);
}
.tpl-head-v398 p{
  margin:6px 0 0;
  color:var(--v39-muted,#64748b);
  font-size:13px;
}
.tpl-new-btn-v398{
  min-height:42px;
  border-radius:12px;
  padding:0 16px;
  display:inline-flex;
  align-items:center;
  gap:9px;
  font-weight:900;
}
.tpl-new-btn-v398 .ui-icon{width:18px;height:18px;}
.tpl-stats-v398{
  display:grid;
  grid-template-columns:repeat(5,minmax(0,1fr));
  gap:14px;
}
.tpl-stat-card-v398{
  min-height:92px;
  padding:16px 18px;
  border:1px solid var(--v39-line,#dbe5f3);
  border-radius:16px;
  background:#fff;
  box-shadow:0 8px 24px rgba(15,23,42,.045);
  display:flex;
  align-items:center;
  gap:14px;
}
.tpl-stat-card-v398 > span{
  width:46px;
  height:46px;
  border-radius:999px;
  display:grid;
  place-items:center;
  background:#eaf2ff;
  color:#2563eb;
  flex:0 0 auto;
}
.tpl-stat-card-v398 > span .ui-icon{width:22px;height:22px;}
.tpl-stat-card-v398 div{display:grid;gap:3px;}
.tpl-stat-card-v398 small{font-size:12px;color:#475569;font-weight:800;}
.tpl-stat-card-v398 b{font-size:24px;line-height:1;color:#14213d;}
.tpl-stat-card-v398 em{font-style:normal;font-size:11px;color:#64748b;}
.tpl-tabs-v398{
  display:flex;
  gap:9px;
  align-items:center;
  flex-wrap:wrap;
}
.tpl-tabs-v398 button{
  min-height:34px;
  padding:0 16px;
  border-radius:10px;
  border:1px solid transparent;
  background:#f1f5f9;
  color:#475569;
  font-size:12px;
  font-weight:850;
}
.tpl-tabs-v398 button.active{
  background:#2563eb;
  color:#fff;
  border-color:#2563eb;
}
.tpl-filter-v398{
  display:grid;
  grid-template-columns:minmax(260px,1fr) 190px 210px;
  gap:12px;
}
.tpl-search-v398,
.tpl-filter-v398 select{
  min-height:40px;
  border:1px solid var(--v39-line,#dbe5f3);
  border-radius:12px;
  background:#fff;
  color:#14213d;
}
.tpl-search-v398{
  display:flex;
  align-items:center;
  gap:9px;
  padding:0 12px;
}
.tpl-search-v398 .ui-icon{width:16px;height:16px;color:#64748b;}
.tpl-search-v398 input{
  border:0;
  outline:0;
  background:transparent;
  width:100%;
  color:#14213d;
  font-size:12px;
}
.tpl-filter-v398 select{
  padding:0 12px;
  font-size:12px;
  font-weight:750;
}
.tpl-workspace-v398{
  display:grid;
  grid-template-columns:minmax(380px,520px) minmax(0,1fr);
  gap:20px;
  min-height:520px;
}
.tpl-list-v398{
  display:grid;
  gap:12px;
  align-content:start;
  max-height:calc(100vh - 330px);
  min-height:520px;
  overflow:auto;
  padding-right:8px;
}
.tpl-row-v398{
  position:relative;
  width:100%;
  display:grid;
  grid-template-columns:48px minmax(0,1fr) 100px 20px;
  gap:13px;
  align-items:center;
  border:1px solid var(--v39-line,#dbe5f3);
  border-radius:15px;
  background:#fff;
  padding:14px;
  text-align:left;
  color:#14213d;
  box-shadow:0 4px 14px rgba(15,23,42,.035);
  cursor:pointer;
}
.tpl-row-v398.active{
  border-color:#60a5fa;
  box-shadow:0 0 0 2px rgba(37,99,235,.10), 0 8px 22px rgba(15,23,42,.05);
  background:#fbfdff;
}
.tpl-row-icon-v398{
  width:48px;
  height:48px;
  border-radius:12px;
  display:grid;
  place-items:center;
}
.tpl-row-icon-v398 .ui-icon{width:23px;height:23px;}
.tpl-row-icon-v398.admin{background:#eaf2ff;color:#2563eb;}
.tpl-row-icon-v398.public{background:#dcfce7;color:#16a34a;}
.tpl-row-icon-v398.private{background:#f3e8ff;color:#9333ea;}
.tpl-row-main-v398{
  min-width:0;
  display:grid;
  gap:5px;
}
.tpl-row-main-v398 b{
  color:#14213d;
  font-size:14px;
  line-height:1.2;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.tpl-row-main-v398 small{
  color:#64748b;
  font-size:11.5px;
  line-height:1.35;
  display:-webkit-box;
  -webkit-line-clamp:2;
  -webkit-box-orient:vertical;
  overflow:hidden;
}
.tpl-row-main-v398 em{
  justify-self:start;
  border-radius:8px;
  padding:4px 8px;
  font-style:normal;
  font-size:10px;
  font-weight:900;
}
.tpl-row-main-v398 em.admin{background:#dbeafe;color:#2563eb;}
.tpl-row-main-v398 em.public{background:#dcfce7;color:#16a34a;}
.tpl-row-main-v398 em.private{background:#f3e8ff;color:#9333ea;}
.tpl-row-actions-v398{
  display:grid;
  gap:8px;
  justify-items:start;
  border-left:1px solid var(--v39-line,#dbe5f3);
  padding-left:14px;
}
.tpl-row-actions-v398 span{
  display:inline-flex;
  align-items:center;
  gap:6px;
  font-size:11px;
  font-weight:850;
  color:#475569;
}
.tpl-row-actions-v398 span:first-child{color:#2563eb;}
.tpl-row-actions-v398 .ui-icon{width:14px;height:14px;}
.tpl-row-v398 > i{
  color:#64748b;
  display:grid;
  place-items:center;
}
.tpl-row-v398 > i .ui-icon{width:16px;height:16px;}
.tpl-preview-v398{
  border:1px solid var(--v39-line,#dbe5f3);
  border-radius:16px;
  background:#fff;
  box-shadow:0 8px 24px rgba(15,23,42,.045);
  padding:24px 28px;
  min-width:0;
  overflow:auto;
  max-height:calc(100vh - 300px);
}
.tpl-preview-head-v398{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin-bottom:26px;
}
.tpl-preview-head-v398 > span{
  display:inline-flex;
  align-items:center;
  gap:8px;
  color:#2563eb;
  font-size:12px;
  font-weight:900;
}
.tpl-preview-head-v398 .ui-icon{width:17px;height:17px;}
.tpl-preview-head-v398 button{
  min-height:34px;
  border-radius:10px;
  display:inline-flex;
  align-items:center;
  gap:8px;
  font-size:11px;
  font-weight:850;
}
.tpl-preview-v398 h2{
  margin:0 0 18px;
  font-size:28px;
  line-height:1.1;
  letter-spacing:-.035em;
  color:#14213d;
}
.tpl-preview-meta-v398{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:14px;
  padding-bottom:18px;
  border-bottom:1px solid var(--v39-line,#dbe5f3);
  margin-bottom:18px;
}
.tpl-preview-meta-v398 div{
  border-right:1px solid var(--v39-line,#dbe5f3);
  padding-right:12px;
}
.tpl-preview-meta-v398 div:last-child{border-right:0;}
.tpl-preview-meta-v398 b{
  display:block;
  font-size:10px;
  color:#94a3b8;
  margin-bottom:5px;
}
.tpl-preview-meta-v398 small{
  display:block;
  color:#475569;
  font-size:12px;
  font-weight:750;
}
.tpl-preview-meta-v398 em{
  display:inline-flex;
  border-radius:8px;
  padding:4px 8px;
  font-style:normal;
  font-size:10px;
  font-weight:900;
}
.tpl-preview-meta-v398 em.admin{background:#dbeafe;color:#2563eb;}
.tpl-preview-meta-v398 em.public{background:#dcfce7;color:#16a34a;}
.tpl-preview-meta-v398 em.private{background:#f3e8ff;color:#9333ea;}
.tpl-preview-v398 pre{
  margin:0;
  white-space:pre-wrap;
  word-break:break-word;
  font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;
  font-size:12px;
  line-height:1.45;
  color:#111827;
  background:transparent;
}
.tpl-preview-actions-v398{
  margin-top:20px;
  display:flex;
  flex-wrap:wrap;
  gap:10px;
}
.tpl-preview-actions-v398 button{
  min-height:36px;
  border-radius:10px;
  padding:0 12px;
  font-weight:850;
}
.tpl-empty-v398{
  min-height:180px;
  display:grid;
  place-items:center;
  text-align:center;
  border:1px dashed var(--v39-line,#dbe5f3);
  border-radius:16px;
  background:#f8fbff;
  color:#64748b;
}
.tpl-empty-v398 b{color:#14213d;font-size:15px;}
.tpl-empty-v398 small{display:block;margin-top:6px;}

/* Dark mode Templates */
body.dark .tpl-head-v398 h1,
body.dark .tpl-stat-card-v398 b,
body.dark .tpl-row-main-v398 b,
body.dark .tpl-preview-v398 h2,
body.dark .tpl-empty-v398 b{
  color:#e5e7eb!important;
}
body.dark .tpl-head-v398 p,
body.dark .tpl-stat-card-v398 small,
body.dark .tpl-stat-card-v398 em,
body.dark .tpl-row-main-v398 small,
body.dark .tpl-preview-meta-v398 small,
body.dark .tpl-empty-v398{
  color:#94a3b8!important;
}
body.dark .tpl-stat-card-v398,
body.dark .tpl-search-v398,
body.dark .tpl-filter-v398 select,
body.dark .tpl-row-v398,
body.dark .tpl-preview-v398,
body.dark .tpl-empty-v398{
  background:#111827!important;
  border-color:#334155!important;
  color:#e5e7eb!important;
  box-shadow:0 10px 26px rgba(0,0,0,.18)!important;
}
body.dark .tpl-row-v398.active{
  background:#16233a!important;
  border-color:#3b82f6!important;
}
body.dark .tpl-search-v398 input{
  color:#e5e7eb!important;
}
body.dark .tpl-row-actions-v398,
body.dark .tpl-preview-meta-v398,
body.dark .tpl-preview-meta-v398 div{
  border-color:#334155!important;
}
body.dark .tpl-preview-v398 pre{
  color:#e5e7eb!important;
}

/* Responsive */
@media(max-width:1180px){
  .tpl-stats-v398{grid-template-columns:repeat(2,minmax(0,1fr));}
  .tpl-workspace-v398{grid-template-columns:1fr;}
  .tpl-list-v398,.tpl-preview-v398{max-height:none;min-height:auto;}
}
@media(max-width:720px){
  .tpl-page-v398{padding:10px;gap:12px;}
  .tpl-head-v398{flex-direction:column;align-items:stretch;}
  .tpl-stats-v398{grid-template-columns:1fr;}
  .tpl-filter-v398{grid-template-columns:1fr;}
  .tpl-row-v398{grid-template-columns:42px minmax(0,1fr);gap:10px;}
  .tpl-row-actions-v398{grid-column:1/-1;grid-template-columns:repeat(3,auto);display:flex;border-left:0;border-top:1px solid var(--v39-line,#dbe5f3);padding:10px 0 0;}
  .tpl-row-v398 > i{position:absolute;top:12px;right:12px;}
  .tpl-preview-meta-v398{grid-template-columns:1fr 1fr;}
  .tpl-preview-meta-v398 div{border-right:0;}
}


/* =========================================================
   v39.8.1 — Templates Action Placement Hotfix
   - Remove Use/Edit/Preview from left template list.
   - Move Edit/Delete next to Salin Template in preview header.
   ========================================================= */

.tpl-row-v398{
  grid-template-columns:48px minmax(0,1fr) 28px!important;
}

.tpl-row-actions-v398{
  display:none!important;
}

.tpl-row-chevron-v398{
  width:28px!important;
  height:28px!important;
  border-radius:9px!important;
  display:grid!important;
  place-items:center!important;
  color:#64748b!important;
  background:#f8fbff!important;
  border:1px solid var(--v39-line,#dbe5f3)!important;
}

.tpl-row-v398.active .tpl-row-chevron-v398{
  color:#2563eb!important;
  background:#eaf2ff!important;
  border-color:#bfdbfe!important;
}

.tpl-row-chevron-v398 .ui-icon{
  width:15px!important;
  height:15px!important;
}

.tpl-preview-head-v398{
  align-items:center!important;
}

.tpl-preview-top-actions-v398{
  display:flex!important;
  align-items:center!important;
  justify-content:flex-end!important;
  gap:8px!important;
  flex-wrap:wrap!important;
}

.tpl-preview-top-actions-v398 button{
  min-height:34px!important;
  border-radius:10px!important;
  padding:0 11px!important;
  display:inline-flex!important;
  align-items:center!important;
  gap:7px!important;
  font-size:11px!important;
  font-weight:850!important;
  line-height:1!important;
}

.tpl-preview-top-actions-v398 button.danger{
  background:#fff7f7!important;
  color:#dc2626!important;
  border:1px solid #fecaca!important;
}

.tpl-preview-actions-v398:empty{
  display:none!important;
}

body.dark .tpl-row-chevron-v398{
  background:#0f172a!important;
  border-color:#334155!important;
  color:#94a3b8!important;
}

body.dark .tpl-row-v398.active .tpl-row-chevron-v398{
  background:rgba(96,165,250,.14)!important;
  border-color:rgba(96,165,250,.32)!important;
  color:#93c5fd!important;
}

body.dark .tpl-preview-top-actions-v398 button.danger{
  background:rgba(220,38,38,.12)!important;
  color:#fca5a5!important;
  border-color:rgba(248,113,113,.30)!important;
}

@media(max-width:720px){
  .tpl-row-v398{
    grid-template-columns:42px minmax(0,1fr) 28px!important;
  }
  .tpl-preview-head-v398{
    align-items:flex-start!important;
    flex-direction:column!important;
  }
  .tpl-preview-top-actions-v398{
    justify-content:flex-start!important;
  }
}


/* v39.8.2 — Template Delete Urgent Hotfix */
.tpl-preview-top-actions-v398 button[data-action="deleteTemplate"]{
  cursor:pointer!important;
  pointer-events:auto!important;
}
.tpl-preview-top-actions-v398 button[data-action="deleteTemplate"]:hover{
  filter:brightness(.98)!important;
}
body.dark .tpl-preview-top-actions-v398 button[data-action="deleteTemplate"]{
  cursor:pointer!important;
  pointer-events:auto!important;
}


/* v39.9.1 — Chat Bulk Delete Selection Hotfix */
.chat-select-check{
  cursor:pointer!important;
  pointer-events:auto!important;
  min-width:28px!important;
  min-height:28px!important;
  display:grid!important;
  place-items:center!important;
  z-index:3!important;
}
.chat-select-check input{
  cursor:pointer!important;
  width:18px!important;
  height:18px!important;
  pointer-events:auto!important;
}
.chat-select-toolbar{
  position:sticky!important;
  top:0!important;
  z-index:8!important;
}
.chat-select-toolbar .danger.small-btn:not(:disabled){
  opacity:1!important;
  cursor:pointer!important;
  pointer-events:auto!important;
}
.chat-row.selected .chat-bubble{
  outline:2px solid rgba(37,99,235,.28)!important;
  outline-offset:2px!important;
}
body.dark .chat-row.selected .chat-bubble{
  outline-color:rgba(96,165,250,.42)!important;
}


/* v39.9.2 — Compact Selected Chat Toolbar + Forward Selected */
.chat-select-toolbar.compact-select-toolbar,
.compact-select-toolbar{
  min-height:42px!important;
  height:auto!important;
  padding:6px 10px!important;
  display:flex!important;
  align-items:center!important;
  justify-content:space-between!important;
  gap:8px!important;
  flex-wrap:wrap!important;
  border-radius:12px!important;
}
.compact-select-toolbar b{
  font-size:12px!important;
  line-height:1!important;
  margin:0!important;
  white-space:nowrap!important;
}
.compact-select-toolbar .small-btn{
  min-height:30px!important;
  height:30px!important;
  padding:0 10px!important;
  border-radius:9px!important;
  font-size:11px!important;
  line-height:1!important;
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  gap:5px!important;
  white-space:nowrap!important;
}
.compact-select-toolbar button:disabled{
  opacity:.45!important;
  cursor:not-allowed!important;
}
@media(max-width:720px){
  .chat-select-toolbar.compact-select-toolbar,
  .compact-select-toolbar{
    justify-content:flex-start!important;
    padding:7px!important;
  }
  .compact-select-toolbar .small-btn{
    min-height:28px!important;
    height:28px!important;
    padding:0 8px!important;
    font-size:10.5px!important;
  }
}


/* v39.9.4 — Chat Scroll + Composer Focus UX */
#chatForm textarea[name="body"]:focus{
  outline:2px solid rgba(37,99,235,.18)!important;
  outline-offset:2px!important;
}
body.dark #chatForm textarea[name="body"]:focus{
  outline-color:rgba(96,165,250,.28)!important;
}

/* v39.9.10 chat scroll anchor lock: never animate or browser-anchor chat viewport during render/polling */
#chatList,
.chat-list,
.messenger-list{
  scroll-behavior:auto!important;
  overflow-anchor:none!important;
}
#chatList *,
.chat-list *,
.messenger-list *{
  overflow-anchor:none!important;
}

/* v39.9.11 Chat read position + unread jump button */
.chat-box-pro{position:relative;}
.chat-jump-latest{
  position:absolute;
  right:22px;
  bottom:140px;
  z-index:15;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:6px;
  min-width:46px;
  height:42px;
  padding:0 12px;
  border:0;
  border-radius:999px;
  background:var(--accent,#2563eb);
  color:#fff;
  box-shadow:0 14px 35px rgba(15,23,42,.22);
  cursor:pointer;
  font-weight:800;
}
.chat-jump-latest span{font-size:20px;line-height:1;}
.chat-jump-latest b{
  min-width:20px;
  height:20px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border-radius:999px;
  background:rgba(255,255,255,.22);
  font-size:12px;
}
.chat-jump-latest:hover{transform:translateY(-1px);filter:brightness(1.03);}
@media (max-width: 720px){.chat-jump-latest{right:16px;bottom:128px;}}

/* v39.9.15 — Advanced Search note-card overflow fix
   Prevent long note text, emails, URLs, or tokens from escaping the result card. */
.search-results.note-grid,
.v39-secondary-note-grid.note-grid{
  align-items:stretch!important;
}
.search-results .note-card,
.v39-secondary-note-grid .note-card,
.note-card{
  min-width:0!important;
  max-width:100%!important;
  overflow:hidden!important;
}
.search-results .note-card h3,
.search-results .note-card p,
.search-results .note-card span,
.v39-secondary-note-grid .note-card h3,
.v39-secondary-note-grid .note-card p,
.v39-secondary-note-grid .note-card span,
.note-card h3,
.note-card p,
.note-card span{
  min-width:0!important;
  max-width:100%!important;
  overflow-wrap:anywhere!important;
  word-break:break-word!important;
  hyphens:auto!important;
}
.search-results .note-card h3,
.v39-secondary-note-grid .note-card h3,
.note-card h3{
  overflow:hidden!important;
  text-overflow:ellipsis!important;
}
.search-results .note-card p,
.v39-secondary-note-grid .note-card p{
  display:-webkit-box!important;
  -webkit-box-orient:vertical!important;
  -webkit-line-clamp:7!important;
  overflow:hidden!important;
}
.search-results .note-card span,
.v39-secondary-note-grid .note-card span{
  display:block!important;
}


/* v40 Mail Reader Only */
.mail-reader-layout{display:grid;grid-template-columns:380px minmax(0,1fr);gap:16px;min-height:calc(100vh - 132px)}
.mail-reader-sidebar,.mail-reader-detail{overflow:hidden}.mail-reader-head,.mail-detail-head,.mail-alias-row{display:flex;align-items:flex-start;justify-content:space-between;gap:12px}.mail-reader-head h2,.mail-detail-head h2{margin:0 0 6px}.mail-filter-tabs{display:flex;gap:8px;flex-wrap:wrap;margin:14px 0}.mail-filter-tabs .active{outline:2px solid rgba(37,99,235,.25)}.mail-reader-list{display:grid;gap:8px;max-height:45vh;overflow:auto;padding-right:2px}.mail-reader-row{width:100%;display:flex;justify-content:space-between;gap:10px;text-align:left;background:var(--soft);color:var(--text);border:1px solid transparent;border-radius:14px;padding:12px}.mail-reader-row:hover,.mail-reader-row.active{border-color:var(--primary);background:var(--panel)}.mail-reader-row.unread{box-shadow:inset 4px 0 0 var(--primary)}.mail-row-main{display:grid;gap:3px;min-width:0}.mail-row-main b,.mail-row-main small,.mail-row-main em{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.mail-row-main small,.mail-row-main em,.mail-row-meta small{color:var(--muted);font-size:12px}.mail-row-main em{font-style:normal}.mail-row-meta{display:grid;justify-items:end;gap:4px;flex:0 0 80px}.mail-admin-card{margin-top:14px;padding:14px}.mail-alias-row{background:var(--soft);border-radius:12px;padding:10px;margin-top:8px}.mail-alias-row b,.mail-alias-row small{display:block}.mail-alias-row small{color:var(--muted)}.mail-detail-head{border-bottom:1px solid var(--border);padding-bottom:14px;margin-bottom:14px}.mail-detail-head p{margin:3px 0;color:var(--muted)}.mail-attach-badge{background:var(--soft);border:1px solid var(--border);border-radius:999px;padding:6px 10px;font-weight:800}.mail-body{line-height:1.7;overflow:auto;max-height:calc(100vh - 250px);padding-right:4px}.mail-body pre{white-space:pre-wrap;font-family:inherit;margin:0}.empty-mini{padding:18px;border:1px dashed var(--border);border-radius:14px;color:var(--muted);text-align:center}@media(max-width:1000px){.mail-reader-layout{grid-template-columns:1fr}.mail-reader-list{max-height:320px}}
/* v40.1 Mail Spam per Alias */
.mail-folder-badge{display:inline-flex;align-items:center;gap:4px;border-radius:999px;padding:2px 7px;font-size:11px;font-weight:800;background:#eef2ff;color:#3730a3;margin-right:6px;}
.mail-folder-badge.spam{background:#fff1f2;color:#be123c;border:1px solid rgba(190,18,60,.12);}

/* v40.2 Mail polish */
.mail-tools-row{display:flex;gap:.5rem;align-items:center;margin:.75rem 0;flex-wrap:wrap}.mail-search-input,.mail-owner-filter{border:1px solid var(--border,#d9e2ef);border-radius:12px;padding:.65rem .8rem;background:var(--surface,#fff);color:inherit;font:inherit}.mail-search-input{flex:1;min-width:220px}.mail-owner-filter{max-width:190px}.mail-detail-actions{display:flex;gap:.5rem;flex-wrap:wrap;padding:.75rem 0;border-bottom:1px solid var(--border,#e5edf6);margin-bottom:.75rem}.mail-reader-head button[disabled]{opacity:.6;cursor:not-allowed}.mail-reader-row.unread .mail-row-main b::before{content:'• ';color:#2563eb;font-weight:900}.mail-reader-row.unread{box-shadow:inset 3px 0 0 #2563eb}

/* v40.2.1 - Mail alias management moved to User Management */
.view-admin .um-mail-alias-card{
  background:var(--v39-surface,#fff);
  border:1px solid var(--v39-line,#dbe5f3);
  border-radius:18px;
  box-shadow:0 8px 24px rgba(15,23,42,.05);
  padding:18px;
  margin:0 0 18px;
}
.view-admin .um-mail-alias-head{display:flex;align-items:flex-start;justify-content:space-between;gap:14px;margin-bottom:14px}
.view-admin .um-mail-alias-head h2{margin:0 0 6px;font-size:18px;color:var(--text,#0f172a)}
.view-admin .um-mail-alias-head p{margin:0;color:var(--muted,#64748b);font-size:13px;line-height:1.5}
.view-admin .um-mail-alias-stats{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;margin-bottom:14px}
.view-admin .um-mail-alias-stats span{background:var(--soft,#f1f5f9);border:1px solid var(--border,#dbe5f3);border-radius:14px;padding:12px;display:grid;gap:3px}
.view-admin .um-mail-alias-stats b{font-size:16px;color:var(--text,#0f172a)}
.view-admin .um-mail-alias-stats small{color:var(--muted,#64748b);font-size:12px;font-weight:700}
.view-admin .um-mail-alias-list{display:grid;gap:8px}
.view-admin .um-mail-alias-row{display:grid;grid-template-columns:minmax(0,1fr) auto auto auto;align-items:center;gap:10px;background:var(--soft,#f1f5f9);border:1px solid var(--border,#dbe5f3);border-radius:14px;padding:10px 12px}
.view-admin .um-mail-alias-row b,.view-admin .um-mail-alias-row small{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.view-admin .um-mail-alias-row small{color:var(--muted,#64748b);font-size:12px;margin-top:2px}
.view-admin .um-mail-alias-row em{font-style:normal;font-size:11px;font-weight:900;border-radius:999px;padding:5px 8px;background:#dcfce7;color:#166534}
.view-admin .um-mail-alias-row.is-off{opacity:.65}.view-admin .um-mail-alias-row.is-off em{background:#fee2e2;color:#991b1b}
.mail-alias-note{margin:14px 0 0;text-align:center;font-size:12px}
body.dark .view-admin .um-mail-alias-card{background:var(--panel,#111827);border-color:var(--border,#334155)}
body.dark .view-admin .um-mail-alias-stats span,body.dark .view-admin .um-mail-alias-row{background:rgba(148,163,184,.08);border-color:var(--border,#334155)}
@media(max-width:900px){.view-admin .um-mail-alias-head{display:grid}.view-admin .um-mail-alias-stats{grid-template-columns:1fr}.view-admin .um-mail-alias-row{grid-template-columns:1fr auto}.view-admin .um-mail-alias-row button{width:100%}}
/* v40.2.2 Mail alias pool polish */
.view-admin .mail-alias-head-actions{display:flex;gap:8px;flex-wrap:wrap;justify-content:flex-end}
.view-admin .um-mail-alias-stats{grid-template-columns:repeat(4,minmax(0,1fr))}
.view-admin .alias-tools{margin:10px 0 8px}
.view-admin .alias-filter-tabs{margin-top:8px;margin-bottom:12px}
.view-admin .alias-badge-active{background:#dcfce7!important;color:#166534!important}
.view-admin .alias-badge-inactive{background:#fee2e2!important;color:#991b1b!important}
@media(max-width:1100px){.view-admin .um-mail-alias-stats{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:700px){.view-admin .um-mail-alias-stats{grid-template-columns:1fr}.view-admin .mail-alias-head-actions{justify-content:stretch}.view-admin .mail-alias-head-actions button{width:100%}}

/* v40.3 Mail Alias Professional Management */
.um-mail-alias-card.professional{border:1px solid var(--border);border-radius:22px;background:var(--panel);padding:18px;box-shadow:var(--shadow-sm);display:flex;flex-direction:column;gap:14px}
.um-mail-alias-stats.professional{display:grid;grid-template-columns:repeat(5,minmax(120px,1fr));gap:12px}
.um-mail-alias-stats.professional span{border:1px solid var(--border);background:linear-gradient(180deg,rgba(59,130,246,.07),rgba(255,255,255,.02));border-radius:16px;padding:14px;display:flex;flex-direction:column;gap:4px}
.um-mail-alias-stats.professional b{font-size:22px;color:var(--text)}
.um-mail-alias-stats.professional small{color:var(--muted);font-weight:700}
.mail-tools-row.alias-tools.professional{display:grid;grid-template-columns:minmax(220px,1fr) 180px;gap:10px;align-items:center}
.mail-alias-table-card{border:1px solid var(--border);border-radius:18px;overflow:hidden;background:var(--card);}
.mail-alias-table-head,.mail-alias-table-row{display:grid;grid-template-columns:1.5fr .7fr 1.1fr .45fr .45fr .45fr .8fr 1.35fr;gap:10px;align-items:center;padding:12px 14px}
.mail-alias-table-head{background:rgba(15,23,42,.04);font-size:12px;font-weight:900;color:var(--muted);text-transform:uppercase;letter-spacing:.04em;border-bottom:1px solid var(--border)}
.mail-alias-table-row{border-bottom:1px solid var(--border);font-size:13px}
.mail-alias-table-row:last-child{border-bottom:0}
.mail-alias-table-row b{display:block;color:var(--text)}
.mail-alias-table-row small{display:block;color:var(--muted);margin-top:3px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.alias-status-pill,.mail-access-pill{display:inline-flex;align-items:center;justify-content:center;border-radius:999px;padding:7px 10px;font-size:11px;font-weight:900;letter-spacing:.02em}
.alias-status-pill.active,.mail-access-pill.on{background:#dcfce7;color:#15803d}
.alias-status-pill.inactive{background:#e0f2fe;color:#0369a1}
.alias-status-pill.disabled,.mail-access-pill.off{background:#fee2e2;color:#b91c1c}
.mail-table-actions{display:flex;flex-wrap:wrap;gap:6px;justify-content:flex-end}
.mail-table-actions .small{padding:7px 9px;font-size:11px;border-radius:10px}
.mail-user-assignment-card{border:1px solid var(--border);border-radius:18px;background:rgba(248,250,252,.65);padding:14px;display:flex;flex-direction:column;gap:10px}
.mail-user-assignment-head{display:flex;justify-content:space-between;align-items:flex-end;gap:10px}
.mail-user-assignment-head h3{margin:0;font-size:16px}
.mail-user-assignment-head small{color:var(--muted);font-weight:700}
.mail-user-assignment-list{display:flex;flex-direction:column;gap:8px;max-height:360px;overflow:auto;padding-right:3px}
.mail-user-assignment-row{display:grid;grid-template-columns:1.2fr 1.2fr .55fr 1.55fr;gap:10px;align-items:center;border:1px solid var(--border);background:var(--panel);border-radius:14px;padding:10px 12px}
.mail-user-assignment-row b{display:block;color:var(--text)}
.mail-user-assignment-row small{display:block;color:var(--muted);margin-top:3px}
.user-mail-alias-mini{color:var(--primary)!important;font-weight:800;margin-top:5px;display:block}
@media (max-width:1100px){.um-mail-alias-stats.professional{grid-template-columns:repeat(2,1fr)}.mail-alias-table-head{display:none}.mail-alias-table-row,.mail-user-assignment-row{grid-template-columns:1fr}.mail-table-actions{justify-content:flex-start}.mail-tools-row.alias-tools.professional{grid-template-columns:1fr}}


/* v40.3.2 Mail Alias Assign Modal Polish */
.app-modal:has(.mail-alias-assign-modal){width:min(680px,calc(100vw - 28px))!important;border-radius:24px}
.modal-body:has(.mail-alias-assign-modal){padding:18px!important;background:linear-gradient(180deg,rgba(59,130,246,.04),transparent 34%)}
.mail-alias-assign-modal{display:flex;flex-direction:column;gap:14px}
.alias-assign-info-card{border:1px solid var(--border);background:linear-gradient(135deg,rgba(37,99,235,.08),rgba(255,255,255,.03));border-radius:18px;padding:16px;display:grid;gap:6px}
.alias-assign-info-card span{font-size:11px;font-weight:900;text-transform:uppercase;letter-spacing:.06em;color:var(--muted)}
.alias-assign-info-card b{font-size:18px;color:var(--text);word-break:break-all}
.alias-assign-info-card small{color:var(--muted);font-weight:700;line-height:1.45}
.alias-assign-summary{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.alias-assign-summary div{border:1px solid var(--border);background:var(--soft);border-radius:16px;padding:12px 14px;display:grid;gap:2px}
.alias-assign-summary b{font-size:20px;color:var(--text)}
.alias-assign-summary small{font-size:12px;color:var(--muted);font-weight:800}
.alias-user-search-input{min-height:48px;font-weight:800}
.alias-user-hint{display:flex;gap:10px;align-items:flex-start;border:1px dashed var(--border);border-radius:14px;padding:12px;background:rgba(148,163,184,.08);color:var(--muted);font-size:12px;line-height:1.45}
.alias-user-hint b{color:var(--text);white-space:nowrap}
@media(max-width:620px){.alias-assign-summary{grid-template-columns:1fr}.alias-user-hint{display:grid}}


/* v40.3.8 User Management UI tidy polish */
.view-admin .um-user-card-list{padding:20px!important;}
.view-admin .um-list-head{display:flex;align-items:flex-start;justify-content:space-between;padding:4px 2px 18px;border-bottom:1px solid #e7edf5;margin-bottom:16px;}
.view-admin .um-list-head h2{margin:0 0 4px;font-size:18px;line-height:1.2;color:var(--v39-text,#14213d);}
.view-admin .um-list-head p{margin:0;color:var(--v39-muted,#64748b);font-size:13px;}
.view-admin .um-card-body{display:grid;gap:14px;}
.view-admin .um-user-card{background:#fff;border:1px solid #e6edf6;border-radius:20px;padding:18px 18px 16px;display:grid;gap:14px;box-shadow:0 8px 24px rgba(15,23,42,.04);transition:.18s ease;}
.view-admin .um-user-card:hover{border-color:#d7e3f3;box-shadow:0 14px 30px rgba(15,23,42,.07);transform:translateY(-1px);}
.view-admin .um-user-card.is-online{position:relative;}
.view-admin .um-user-card.is-online::before{content:"";position:absolute;left:0;top:18px;bottom:18px;width:4px;border-radius:999px;background:linear-gradient(180deg,#22c55e,#86efac);}
.view-admin .um-user-top{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;padding-left:8px;}
.view-admin .um-user-badges{display:flex;flex-wrap:wrap;gap:8px;justify-content:flex-end;}
.view-admin .um-user-meta-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;padding-left:8px;}
.view-admin .um-meta-item{background:#f8fbff;border:1px solid #e7edf5;border-radius:14px;padding:12px 13px;display:grid;gap:4px;min-height:68px;}
.view-admin .um-meta-item span{font-size:11px;font-weight:700;letter-spacing:.04em;text-transform:uppercase;color:#7b8aa0;}
.view-admin .um-meta-item b{font-size:14px;line-height:1.35;color:#1e293b;font-weight:800;word-break:break-word;}
.view-admin .um-user-bottom{display:flex;align-items:center;justify-content:space-between;gap:16px;padding-left:8px;padding-top:4px;border-top:1px dashed #e7edf5;}
.view-admin .um-user-status-note{color:#64748b;font-size:12px;line-height:1.4;}
.view-admin .um-user-card .um-actions{justify-content:flex-end!important;flex-wrap:wrap!important;gap:8px!important;}
.view-admin .um-user-card .um-actions button{height:34px!important;min-height:34px!important;padding:0 12px!important;border-radius:11px!important;font-size:11px!important;}
.view-admin .um-user-card .user-mail-alias-mini{margin-top:2px;}
.view-admin .um-table-foot{margin-top:14px;padding-top:16px;border-top:1px solid #e7edf5;}
body.dark .view-admin .um-user-card{background:#0f172a;border-color:#243244;box-shadow:none;}
body.dark .view-admin .um-user-card:hover{border-color:#334155;box-shadow:0 12px 28px rgba(2,6,23,.36);}
body.dark .view-admin .um-list-head{border-color:#233145;}
body.dark .view-admin .um-list-head h2{color:#e5e7eb;}
body.dark .view-admin .um-list-head p,body.dark .view-admin .um-user-status-note{color:#94a3b8;}
body.dark .view-admin .um-meta-item{background:#111c2d;border-color:#243244;}
body.dark .view-admin .um-meta-item span{color:#8fa3bf;}
body.dark .view-admin .um-meta-item b{color:#e2e8f0;}
body.dark .view-admin .um-user-bottom,body.dark .view-admin .um-table-foot{border-color:#233145;}
@media (max-width:1200px){.view-admin .um-user-meta-grid{grid-template-columns:repeat(2,minmax(0,1fr));}}
@media (max-width:860px){.view-admin .um-user-top,.view-admin .um-user-bottom{flex-direction:column;align-items:flex-start;}.view-admin .um-user-badges{justify-content:flex-start;}.view-admin .um-user-bottom{align-items:stretch;}.view-admin .um-user-card .um-actions{justify-content:flex-start!important;}}
@media (max-width:640px){.view-admin .um-user-card-list{padding:14px!important;}.view-admin .um-user-meta-grid{grid-template-columns:1fr;}.view-admin .um-list-head{padding-bottom:14px;margin-bottom:14px;}.view-admin .um-user-card{padding:16px;}.view-admin .um-user-top,.view-admin .um-user-meta-grid,.view-admin .um-user-bottom{padding-left:0;}.view-admin .um-user-card.is-online::before{top:16px;bottom:16px;}}


/* v40.4.1 Login/Register redesign based on supplied animated reference */
.auth-v405{
  position:relative;
  overflow:hidden;
  min-height:100vh;
  background:#25252b;
  isolation:isolate;
}
.auth-v405::before{
  content:"";
  position:absolute;
  inset:0;
  background:
    radial-gradient(circle at 18% 18%, rgba(228,96,51,.24), transparent 30%),
    radial-gradient(circle at 86% 76%, rgba(37,99,235,.18), transparent 32%),
    linear-gradient(135deg,#17171d 0%,#25252b 52%,#111827 100%);
  z-index:-3;
}
.auth-bg-orb{
  position:absolute;
  width:280px;
  height:280px;
  border-radius:999px;
  filter:blur(30px);
  opacity:.3;
  z-index:-2;
}
.auth-bg-orb.orb-one{left:8%;top:12%;background:#e46033;}
.auth-bg-orb.orb-two{right:8%;bottom:8%;background:#2563eb;}
.auth-panel-v405{
  position:relative;
  width:min(860px,calc(100vw - 36px));
  min-height:520px;
  border:2px solid #e46033;
  border-radius:28px;
  box-shadow:0 0 28px rgba(228,96,51,.65),0 24px 70px rgba(0,0,0,.35);
  background:#25252b;
  overflow:hidden;
}
.auth-panel-v405 .ui-icon{width:19px;height:19px}
.auth-curve{
  position:absolute;
  pointer-events:none;
  transition:1.25s ease;
}
.auth-curve-main{
  right:-190px;
  top:-120px;
  width:860px;
  height:740px;
  background:linear-gradient(45deg,#25252b,#e46033);
  transform:rotate(10deg) skewY(40deg);
  transform-origin:bottom right;
  transition-delay:.85s;
  z-index:1;
}
.auth-curve-dark{
  left:255px;
  top:100%;
  width:900px;
  height:800px;
  background:#25252b;
  border-top:3px solid #e46033;
  transform:rotate(0deg) skewY(0deg);
  transform-origin:bottom left;
  transition-delay:.25s;
  z-index:2;
}
.auth-panel-v405.active .auth-curve-main{
  transform:rotate(0deg) skewY(0deg);
  transition-delay:.15s;
}
.auth-panel-v405.active .auth-curve-dark{
  transform:rotate(-11deg) skewY(-41deg);
  transition-delay:.65s;
}
.auth-form-side,.auth-info-side{
  position:absolute;
  top:0;
  width:50%;
  height:100%;
  z-index:3;
}
.auth-form-side{
  display:flex;
  align-items:center;
  justify-content:center;
}
.auth-login-side{left:0;padding:34px 48px 34px 42px;}
.auth-register-side{right:0;padding:26px 46px 26px 44px;}
.auth-info-side{
  display:flex;
  justify-content:center;
  flex-direction:column;
  color:#fff;
}
.auth-login-info{
  right:0;
  text-align:right;
  padding:0 44px 68px 132px;
}
.auth-register-info{
  left:0;
  text-align:left;
  padding:0 132px 68px 42px;
  pointer-events:none;
}
.auth-form-inner{
  width:100%;
  color:#fff;
}
.auth-mini-brand{
  display:flex;
  align-items:center;
  gap:10px;
  margin-bottom:18px;
  color:#fff;
}
.auth-mini-brand span{
  width:38px;height:38px;border-radius:14px;
  display:grid;place-items:center;
  background:linear-gradient(135deg,#e46033,#ffb088);
  color:#fff;font-weight:950;
  box-shadow:0 12px 26px rgba(228,96,51,.26);
}
.auth-mini-brand b{font-size:15px;letter-spacing:.02em;color:#fff;}
.auth-form-inner h2,.auth-info-side h2{
  margin:0;
  color:#fff;
  letter-spacing:-.05em;
}
.auth-form-inner h2{
  text-align:left;
  font-size:32px;
  line-height:1.08;
}
.auth-info-side h2{
  text-transform:uppercase;
  font-size:38px;
  line-height:1.14;
}
.auth-subtitle,.auth-info-side p{
  color:rgba(255,255,255,.78);
  line-height:1.55;
}
.auth-subtitle{margin:8px 0 18px;font-size:13px;}
.auth-info-side p{font-size:15px;margin:14px 0 0;}
.auth-form-v405{
  display:grid;
  gap:14px;
}
.auth-field{
  position:relative;
  height:52px;
  display:block;
}
.auth-field input{
  width:100%;
  height:100%;
  background:transparent!important;
  border:0!important;
  border-bottom:2px solid rgba(255,255,255,.88)!important;
  outline:none!important;
  box-shadow:none!important;
  border-radius:0!important;
  padding:17px 34px 5px 0!important;
  color:#fff!important;
  font-size:15px!important;
  font-weight:700!important;
  transition:.25s ease!important;
}
.auth-field span{
  position:absolute;
  top:50%;
  left:0;
  transform:translateY(-50%);
  color:rgba(255,255,255,.85);
  font-size:14px;
  font-weight:700;
  transition:.25s ease;
  pointer-events:none;
}
.auth-field em{
  position:absolute;
  top:50%;
  right:0;
  transform:translateY(-50%);
  color:rgba(255,255,255,.7);
  transition:.25s ease;
}
.auth-field input:focus,
.auth-field input:not(:placeholder-shown){
  border-bottom-color:#e46033!important;
}
.auth-field input:focus ~ span,
.auth-field input:not(:placeholder-shown) ~ span{
  top:4px;
  color:#ff9a73;
  font-size:11px;
  letter-spacing:.04em;
  text-transform:uppercase;
}
.auth-field input:focus ~ em,
.auth-field input:not(:placeholder-shown) ~ em{
  color:#ff9a73;
}
.auth-btn{
  position:relative;
  width:100%;
  height:46px;
  margin-top:4px;
  background:transparent;
  border:2px solid #e46033;
  border-radius:999px;
  color:#fff;
  cursor:pointer;
  font-size:15px;
  font-weight:900;
  overflow:hidden;
  z-index:1;
}
.auth-btn::before{
  content:"";
  position:absolute;
  left:0;
  top:-100%;
  width:100%;
  height:300%;
  background:linear-gradient(#25252b,#e46033,#25252b,#e46033);
  z-index:-1;
  transition:.45s ease;
}
.auth-btn:hover::before{top:0;}
.auth-switch-text{
  text-align:center;
  color:rgba(255,255,255,.74);
  font-size:13px;
  line-height:1.45;
  margin-top:4px;
}
.auth-switch-text button{
  border:0;
  background:transparent;
  color:#ff9a73;
  font-weight:900;
  cursor:pointer;
  padding:3px 4px;
}
.auth-switch-text button:hover{text-decoration:underline;}
.auth-login-side .auth-form-inner,
.auth-login-info,
.auth-register-side .auth-form-inner,
.auth-register-info{
  transition:.72s ease;
}
.auth-login-side .auth-form-inner{
  transform:translateX(0);
  opacity:1;
  filter:blur(0);
  transition-delay:.55s;
}
.auth-login-info{
  transform:translateX(0);
  opacity:1;
  filter:blur(0);
  transition-delay:.45s;
}
.auth-register-side .auth-form-inner{
  transform:translateX(120%);
  opacity:0;
  filter:blur(10px);
  transition-delay:.05s;
}
.auth-register-info{
  transform:translateX(-120%);
  opacity:0;
  filter:blur(10px);
  transition-delay:.05s;
}
.auth-panel-v405.active .auth-login-side .auth-form-inner{
  transform:translateX(-120%);
  opacity:0;
  filter:blur(10px);
  transition-delay:.05s;
}
.auth-panel-v405.active .auth-login-info{
  transform:translateX(120%);
  opacity:0;
  filter:blur(10px);
  transition-delay:.05s;
}
.auth-panel-v405.active .auth-register-side .auth-form-inner{
  transform:translateX(0);
  opacity:1;
  filter:blur(0);
  transition-delay:.55s;
}
.auth-panel-v405.active .auth-register-info{
  transform:translateX(0);
  opacity:1;
  filter:blur(0);
  transition-delay:.5s;
}
@media (max-width:820px){
  .auth-panel-v405{
    width:min(460px,calc(100vw - 28px));
    min-height:auto;
    overflow:visible;
    border-radius:24px;
    padding:0;
  }
  .auth-curve,.auth-info-side{display:none;}
  .auth-form-side{
    position:relative;
    width:100%;
    min-height:520px;
    background:#25252b;
    border-radius:22px;
  }
  .auth-login-side,.auth-register-side{left:auto;right:auto;padding:28px;}
  .auth-register-side{display:none;}
  .auth-panel-v405.active .auth-login-side{display:none;}
  .auth-panel-v405.active .auth-register-side{display:flex;}
  .auth-login-side .auth-form-inner,
  .auth-register-side .auth-form-inner,
  .auth-panel-v405.active .auth-login-side .auth-form-inner,
  .auth-panel-v405.active .auth-register-side .auth-form-inner{
    transform:none;opacity:1;filter:none;transition:none;
  }
}
@media (max-width:430px){
  .auth-form-side{min-height:560px;}
  .auth-login-side,.auth-register-side{padding:24px 20px;}
  .auth-form-inner h2{font-size:28px;}
}


/* v40.4.2 Login theme alignment with original Savaya Note UI/UX */
.auth-v405{
  background:var(--bg,#f5f7fb)!important;
}
.auth-v405::before{
  background:
    radial-gradient(circle at 14% 16%, rgba(37,99,235,.20), transparent 34%),
    radial-gradient(circle at 82% 78%, rgba(6,182,212,.16), transparent 36%),
    linear-gradient(135deg,#f8fbff 0%,#eef4ff 48%,#e8f7fb 100%)!important;
}
.auth-bg-orb.orb-one{background:#2563eb!important;opacity:.22!important;}
.auth-bg-orb.orb-two{background:#06b6d4!important;opacity:.20!important;}
.auth-panel-v405{
  background:#ffffff!important;
  border:1px solid rgba(215,224,234,.95)!important;
  box-shadow:0 24px 70px rgba(15,23,42,.12)!important;
}
.auth-curve-main{
  background:linear-gradient(135deg,#2563eb 0%,#3b82f6 52%,#06b6d4 100%)!important;
}
.auth-curve-dark{
  background:#ffffff!important;
  border-top:3px solid rgba(37,99,235,.26)!important;
}
.auth-form-inner,
.auth-form-inner h2,
.auth-mini-brand,
.auth-mini-brand b{
  color:#142033!important;
}
.auth-mini-brand span{
  background:linear-gradient(135deg,#2563eb,#06b6d4)!important;
  box-shadow:0 12px 26px rgba(37,99,235,.22)!important;
}
.auth-subtitle{
  color:#64748b!important;
}
.auth-field input{
  color:#142033!important;
  border-bottom-color:#d7e0ea!important;
}
.auth-field span{
  color:#64748b!important;
}
.auth-field em{
  color:#94a3b8!important;
}
.auth-field input:focus,
.auth-field input:not(:placeholder-shown){
  border-bottom-color:#2563eb!important;
}
.auth-field input:focus ~ span,
.auth-field input:not(:placeholder-shown) ~ span,
.auth-field input:focus ~ em,
.auth-field input:not(:placeholder-shown) ~ em{
  color:#2563eb!important;
}
.auth-btn{
  border-color:#2563eb!important;
  color:#ffffff!important;
  background:#2563eb!important;
  box-shadow:0 12px 26px rgba(37,99,235,.18)!important;
}
.auth-btn::before{
  background:linear-gradient(180deg,#2563eb,#06b6d4,#1d4ed8,#2563eb)!important;
}
.auth-switch-text{
  color:#64748b!important;
}
.auth-switch-text button{
  color:#2563eb!important;
}
.auth-info-side,
.auth-info-side h2{
  color:#ffffff!important;
}
.auth-info-side p{
  color:rgba(255,255,255,.82)!important;
}
body.dark .auth-v405{
  background:#0f172a!important;
}
body.dark .auth-v405::before{
  background:
    radial-gradient(circle at 14% 16%, rgba(59,130,246,.20), transparent 34%),
    radial-gradient(circle at 82% 78%, rgba(6,182,212,.13), transparent 36%),
    linear-gradient(135deg,#0f172a 0%,#111827 48%,#172033 100%)!important;
}
body.dark .auth-panel-v405{
  background:#111827!important;
  border-color:#263244!important;
  box-shadow:0 24px 80px rgba(0,0,0,.40)!important;
}
body.dark .auth-curve-main{
  background:linear-gradient(135deg,#1d4ed8 0%,#2563eb 50%,#0891b2 100%)!important;
}
body.dark .auth-curve-dark{
  background:#111827!important;
  border-top-color:rgba(59,130,246,.35)!important;
}
body.dark .auth-form-inner,
body.dark .auth-form-inner h2,
body.dark .auth-mini-brand,
body.dark .auth-mini-brand b{
  color:#e5e7eb!important;
}
body.dark .auth-subtitle,
body.dark .auth-switch-text{
  color:#9ca3af!important;
}
body.dark .auth-field input{
  color:#e5e7eb!important;
  border-bottom-color:#334155!important;
}
body.dark .auth-field span{color:#9ca3af!important;}
body.dark .auth-field em{color:#94a3b8!important;}
@media (max-width:820px){
  .auth-form-side{background:#ffffff!important;box-shadow:0 20px 50px rgba(15,23,42,.12)!important;border:1px solid #d7e0ea!important;}
  body.dark .auth-form-side{background:#111827!important;border-color:#263244!important;}
}


/* v40.4.3 Login UI professional readability fix
   - Menghilangkan overlap curve besar yang menutup teks
   - Menjadikan panel informasi sebagai gradient side panel yang stabil
   - Menjaga warna sesuai UI/UX Savaya Note */
.auth-panel-v405{
  min-height:560px!important;
  border-radius:30px!important;
  background:#ffffff!important;
  overflow:hidden!important;
}
.auth-panel-v405::before{
  content:"";
  position:absolute;
  inset:0;
  background:linear-gradient(90deg,#ffffff 0%,#ffffff 50%,transparent 50%,transparent 100%);
  z-index:0;
  pointer-events:none;
}
.auth-panel-v405.active::before{
  background:linear-gradient(90deg,transparent 0%,transparent 50%,#ffffff 50%,#ffffff 100%);
}
.auth-curve-dark{display:none!important;}
.auth-curve-main{
  top:0!important;
  right:0!important;
  left:auto!important;
  width:52%!important;
  height:100%!important;
  transform:none!important;
  transform-origin:center!important;
  transition:all .65s cubic-bezier(.2,.8,.2,1)!important;
  background:linear-gradient(135deg,#2563eb 0%,#2f80ed 48%,#06b6d4 100%)!important;
  clip-path:polygon(18% 0,100% 0,100% 100%,0 100%)!important;
  z-index:1!important;
  box-shadow:inset 24px 0 40px rgba(255,255,255,.10);
}
.auth-panel-v405.active .auth-curve-main{
  left:0!important;
  right:auto!important;
  width:52%!important;
  transform:none!important;
  clip-path:polygon(0 0,100% 0,82% 100%,0 100%)!important;
}
.auth-form-side,.auth-info-side{z-index:3!important;}
.auth-info-side{z-index:4!important;overflow:hidden!important;}
.auth-login-side{left:0!important;width:50%!important;padding:42px 58px 42px 48px!important;}
.auth-register-side{right:0!important;width:50%!important;padding:34px 52px 34px 56px!important;}
.auth-login-info{right:0!important;width:50%!important;text-align:right!important;padding:0 50px 0 112px!important;}
.auth-register-info{left:0!important;width:50%!important;text-align:left!important;padding:0 112px 0 50px!important;}
.auth-info-side h2{
  font-size:34px!important;
  line-height:1.12!important;
  letter-spacing:-.045em!important;
  color:#ffffff!important;
  text-shadow:0 2px 12px rgba(15,23,42,.16)!important;
}
.auth-info-side p{
  max-width:330px!important;
  margin-top:14px!important;
  font-size:15px!important;
  line-height:1.65!important;
  color:rgba(255,255,255,.92)!important;
  text-shadow:0 1px 8px rgba(15,23,42,.12)!important;
}
.auth-login-info p{margin-left:auto!important;}
.auth-register-info p{margin-right:auto!important;}
.auth-form-inner h2{font-size:33px!important;color:#142033!important;}
.auth-subtitle{font-size:14px!important;color:#64748b!important;}
.auth-mini-brand{margin-bottom:22px!important;}
.auth-mini-brand b{font-size:16px!important;color:#142033!important;}
.auth-field{height:56px!important;margin-top:2px!important;}
.auth-field input{
  border-bottom:2px solid #d5deeb!important;
  color:#142033!important;
  padding-right:40px!important;
}
.auth-field span{color:#64748b!important;}
.auth-field em{color:#94a3b8!important;right:4px!important;}
.auth-btn{
  height:50px!important;
  border-radius:14px!important;
  border:1px solid rgba(37,99,235,.30)!important;
  background:linear-gradient(135deg,#2563eb,#06b6d4)!important;
  box-shadow:0 16px 34px rgba(37,99,235,.22)!important;
}
.auth-btn::before{display:none!important;}
.auth-btn:hover{transform:translateY(-1px);box-shadow:0 20px 38px rgba(37,99,235,.28)!important;}
.auth-switch-text{font-size:14px!important;color:#64748b!important;margin-top:8px!important;}
.auth-switch-text button{
  background:#eef4ff!important;
  color:#2563eb!important;
  border-radius:10px!important;
  padding:8px 14px!important;
  margin-top:6px!important;
}
.auth-switch-text button:hover{text-decoration:none!important;background:#dbeafe!important;}
body.dark .auth-panel-v405{background:#111827!important;border-color:#263244!important;}
body.dark .auth-panel-v405::before{background:linear-gradient(90deg,#111827 0%,#111827 50%,transparent 50%,transparent 100%)!important;}
body.dark .auth-panel-v405.active::before{background:linear-gradient(90deg,transparent 0%,transparent 50%,#111827 50%,#111827 100%)!important;}
body.dark .auth-form-inner h2,body.dark .auth-mini-brand b{color:#e5e7eb!important;}
body.dark .auth-field input{color:#e5e7eb!important;border-bottom-color:#334155!important;}
body.dark .auth-switch-text button{background:#172033!important;color:#60a5fa!important;}
@media (max-width:900px){
  .auth-panel-v405{width:min(520px,calc(100vw - 28px))!important;min-height:auto!important;}
  .auth-panel-v405::before,.auth-panel-v405.active::before,.auth-curve-main,.auth-info-side{display:none!important;}
  .auth-form-side{position:relative!important;width:100%!important;min-height:540px!important;background:#fff!important;border-radius:28px!important;padding:34px 32px!important;}
  .auth-login-side,.auth-register-side{left:auto!important;right:auto!important;width:100%!important;}
  body.dark .auth-form-side{background:#111827!important;}
}
@media (max-width:460px){
  .auth-v405{padding:18px!important;}
  .auth-form-side{padding:28px 22px!important;min-height:560px!important;}
  .auth-form-inner h2{font-size:29px!important;}
}


/* v40.4.5 Popup System Foundation - modern modal UI */
.modal-backdrop-v4045{
  place-items:center!important;
  padding:24px!important;
  background:rgba(15,23,42,.48)!important;
  backdrop-filter:blur(14px) saturate(1.12)!important;
}
.app-modal-v4045{
  width:min(640px,calc(100vw - 32px))!important;
  max-height:min(88vh,820px)!important;
  border-radius:28px!important;
  border:1px solid rgba(203,213,225,.85)!important;
  background:linear-gradient(180deg,#ffffff 0%,#f8fbff 100%)!important;
  color:#16213a!important;
  box-shadow:0 30px 90px rgba(15,23,42,.24),0 0 0 1px rgba(255,255,255,.45) inset!important;
  overflow:hidden!important;
  animation:modalInV4045 .2s cubic-bezier(.2,.9,.25,1)!important;
}
.app-modal-v4045.modal-size-sm{width:min(460px,calc(100vw - 32px))!important;}
.app-modal-v4045.modal-size-lg{width:min(780px,calc(100vw - 32px))!important;}
.app-modal-v4045.modal-size-xl{width:min(980px,calc(100vw - 32px))!important;}
.app-modal-v4045.modal-size-wide{width:min(1120px,calc(100vw - 32px))!important;}
@keyframes modalInV4045{from{opacity:0;transform:translateY(14px) scale(.975)}to{opacity:1;transform:translateY(0) scale(1)}}
.modal-head-v4045{
  padding:18px 20px!important;
  background:linear-gradient(135deg,#f8fbff 0%,#eef6ff 100%)!important;
  border-bottom:1px solid #dbe7f5!important;
}
.modal-title-wrap-v4045{display:flex;align-items:center;gap:12px;min-width:0;}
.modal-title-wrap-v4045 h2{margin:0!important;font-size:20px!important;letter-spacing:-.035em!important;color:#14213d!important;line-height:1.15!important;}
.modal-title-wrap-v4045 small{display:block;margin-top:4px;color:#64748b;font-size:12px;font-weight:700;line-height:1.35;}
.modal-title-icon-v4045{width:38px;height:38px;border-radius:14px;background:linear-gradient(135deg,#2563eb,#06b6d4);color:white;display:grid;place-items:center;font-weight:950;box-shadow:0 12px 28px rgba(37,99,235,.22);flex:0 0 auto;}
.modal-kind-danger .modal-title-icon-v4045{background:linear-gradient(135deg,#ef4444,#f97316);box-shadow:0 12px 28px rgba(239,68,68,.2);}
.modal-x-v4045{width:40px!important;height:40px!important;border-radius:14px!important;background:#fff!important;border:1px solid #dbe7f5!important;color:#475569!important;box-shadow:0 8px 20px rgba(15,23,42,.06)!important;font-size:20px!important;}
.modal-x-v4045:hover{background:#f1f5f9!important;color:#0f172a!important;}
.modal-body-v4045{padding:20px!important;overflow:auto!important;line-height:1.55!important;}
.modal-body-v4045 .modal-grid{gap:12px!important;}
.modal-body-v4045 .modal-grid label,.modal-body-v4045 .modal-label{font-size:12px!important;letter-spacing:.01em!important;color:#52647e!important;font-weight:900!important;margin:0 0 6px!important;}
.modal-body-v4045 .modal-input{min-height:46px!important;border-radius:15px!important;border:1px solid #dbe7f5!important;background:#fff!important;color:#16213a!important;padding:11px 13px!important;box-shadow:0 1px 0 rgba(15,23,42,.02)!important;}
.modal-body-v4045 select.modal-input{height:46px!important;}
.modal-body-v4045 textarea.modal-input,.modal-body-v4045 .modal-textarea{min-height:140px!important;resize:vertical!important;}
.modal-body-v4045 .modal-input:focus{border-color:#2563eb!important;box-shadow:0 0 0 4px rgba(37,99,235,.13)!important;}
.modal-body-v4045 .muted{color:#64748b!important;}
.modal-message-card-v4045{border:1px solid #dbe7f5;background:#f8fbff;border-radius:18px;padding:16px;color:#334155;}
.modal-message-card-v4045.danger{border-color:#fecaca;background:#fff7f7;color:#7f1d1d;}
.modal-message-card-v4045 p{margin:0!important;white-space:pre-wrap;}
.modal-actions-v4045{position:sticky!important;bottom:0!important;display:flex!important;justify-content:flex-end!important;gap:10px!important;padding:16px 20px!important;border-top:1px solid #dbe7f5!important;background:rgba(248,251,255,.94)!important;backdrop-filter:blur(10px)!important;}
.modal-actions-v4045 button{height:42px!important;min-width:112px!important;border-radius:14px!important;font-weight:900!important;padding:0 16px!important;}
.modal-actions-v4045 .primary,.modal-submit-v4045.primary{background:linear-gradient(135deg,#2563eb,#06b6d4)!important;border:0!important;color:#fff!important;box-shadow:0 12px 26px rgba(37,99,235,.22)!important;}
.modal-actions-v4045 .secondary,.modal-cancel-v4045{background:#fff!important;border:1px solid #dbe7f5!important;color:#334155!important;}
.modal-actions-v4045 .danger{background:linear-gradient(135deg,#ef4444,#dc2626)!important;border:0!important;color:#fff!important;box-shadow:0 12px 26px rgba(239,68,68,.18)!important;}
.app-modal:has(.template-chat-modal){width:min(980px,calc(100vw - 32px))!important;}
.app-modal:has(.template-create-form),.app-modal:has(.user-edit-modal-v396){width:min(820px,calc(100vw - 32px))!important;}
.app-modal:has(.room-create-form),.app-modal:has(.member-picker){width:min(920px,calc(100vw - 32px))!important;}
.app-modal:has(.mail-alias-assign-modal){width:min(760px,calc(100vw - 32px))!important;}
body.dark .app-modal-v4045{background:linear-gradient(180deg,#0f172a 0%,#111c2d 100%)!important;border-color:#243244!important;color:#e5e7eb!important;box-shadow:0 30px 90px rgba(0,0,0,.46)!important;}
body.dark .modal-head-v4045,body.dark .modal-actions-v4045{background:rgba(17,28,45,.94)!important;border-color:#243244!important;}
body.dark .modal-title-wrap-v4045 h2{color:#e5e7eb!important;}
body.dark .modal-title-wrap-v4045 small,body.dark .modal-body-v4045 .muted{color:#94a3b8!important;}
body.dark .modal-x-v4045,body.dark .modal-actions-v4045 .secondary,body.dark .modal-cancel-v4045{background:#0f172a!important;border-color:#334155!important;color:#cbd5e1!important;}
body.dark .modal-body-v4045 .modal-input{background:#0f172a!important;border-color:#334155!important;color:#e5e7eb!important;}
body.dark .modal-message-card-v4045{background:#111c2d;border-color:#334155;color:#cbd5e1;}
body.dark .modal-message-card-v4045.danger{background:rgba(127,29,29,.22);border-color:rgba(248,113,113,.45);color:#fecaca;}
@media(max-width:720px){
  .modal-backdrop-v4045{padding:10px!important;place-items:end center!important;}
  .app-modal-v4045{width:100%!important;max-height:92vh!important;border-radius:24px 24px 0 0!important;}
  .modal-head-v4045{padding:16px!important;}
  .modal-body-v4045{padding:16px!important;}
  .modal-actions-v4045{display:grid!important;grid-template-columns:1fr!important;padding:14px 16px!important;}
  .modal-actions-v4045 button{width:100%!important;}
  .modal-title-wrap-v4045 h2{font-size:18px!important;}
}


/* v40.4.6 Popup form width alignment fix */
.app-modal-v4045:has(.template-create-form){
  width:min(860px,calc(100vw - 32px))!important;
}
.modal-body-v4045:has(.template-create-form){
  padding:22px 24px!important;
}
.modal-body-v4045 .template-create-form{
  width:100%!important;
  max-width:none!important;
  min-width:0!important;
  display:grid!important;
  grid-template-columns:1fr!important;
  gap:14px!important;
}
.modal-body-v4045 .template-create-form .modal-input,
.modal-body-v4045 .template-create-form input,
.modal-body-v4045 .template-create-form select,
.modal-body-v4045 .template-create-form textarea{
  width:100%!important;
  max-width:100%!important;
  box-sizing:border-box!important;
}
.modal-body-v4045 .template-create-form label{
  margin:2px 0 -4px!important;
}
.modal-body-v4045 .template-create-form textarea.modal-input,
.modal-body-v4045 .template-create-form .modal-textarea{
  min-height:190px!important;
}
.app-modal-v4045:has(.template-create-form) .modal-actions-v4045{
  padding-left:24px!important;
  padding-right:24px!important;
}
@media(max-width:720px){
  .app-modal-v4045:has(.template-create-form){width:100%!important;}
  .modal-body-v4045:has(.template-create-form){padding:16px!important;}
  .modal-body-v4045 .template-create-form textarea.modal-input,
  .modal-body-v4045 .template-create-form .modal-textarea{min-height:160px!important;}
}

/* v40.4.7 — Template popup workflow redesign: one complete popup */
.template-system-modal-v4047{display:grid;grid-template-columns:minmax(0,1.55fr) minmax(280px,.75fr);gap:18px;width:100%;align-items:stretch;}
.template-system-main-v4047,.template-system-side-v4047{min-width:0;}
.template-system-side-v4047{display:grid;gap:12px;align-content:start;}
.template-info-card-v4047{display:flex;gap:12px;align-items:flex-start;background:linear-gradient(135deg,#eef6ff,#f8fbff);border:1px solid #dbeafe;border-radius:18px;padding:14px 16px;margin-bottom:14px;}
.template-info-icon-v4047{display:inline-grid;place-items:center;width:40px;height:40px;border-radius:14px;background:linear-gradient(135deg,#2563eb,#06b6d4);color:#fff;box-shadow:0 12px 24px rgba(37,99,235,.22);}
.template-info-card-v4047 b,.template-summary-card-v4047 b,.template-preview-card-v4047 b,.template-tips-card-v4047 b{display:block;color:#172033;font-size:14px;margin-bottom:4px;}
.template-info-card-v4047 small{display:block;color:#64748b;line-height:1.5;}
.template-form-grid-v4047{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px 16px;}
.template-field-v4047{display:grid!important;gap:8px!important;margin:0!important;align-content:start;}
.template-field-v4047.span-2{grid-column:1/-1;}
.template-field-v4047>span{font-size:12px;font-weight:900;color:#52637b;letter-spacing:.02em;}
.template-field-v4047 small{font-size:11px;color:#7b8aa0;line-height:1.4;}
.template-field-v4047 .modal-input{width:100%!important;}
.template-content-v4047{min-height:260px!important;resize:vertical!important;line-height:1.55!important;font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono",monospace!important;font-size:13px!important;}
.template-summary-card-v4047,.template-preview-card-v4047,.template-tips-card-v4047{background:#fff;border:1px solid #e3ebf6;border-radius:18px;padding:15px;box-shadow:0 10px 24px rgba(15,23,42,.04);}
.template-summary-card-v4047 dl{display:grid;grid-template-columns:86px 1fr;gap:8px 10px;margin:10px 0 0;}
.template-summary-card-v4047 dt{font-size:11px;text-transform:uppercase;letter-spacing:.04em;color:#7b8aa0;font-weight:900;}
.template-summary-card-v4047 dd{margin:0;color:#334155;font-size:12px;line-height:1.4;font-weight:700;}
.template-preview-card-v4047 pre{white-space:pre-wrap;word-break:break-word;max-height:260px;overflow:auto;margin:10px 0 0;background:#f8fbff;border:1px solid #e7edf5;border-radius:14px;padding:12px;color:#334155;font-size:12px;line-height:1.55;}
.template-tips-card-v4047 ul{margin:8px 0 0 18px;padding:0;color:#64748b;font-size:12px;line-height:1.55;}
.template-use-now-v4047{grid-column:1/-1;margin-top:12px!important;background:#f8fbff;border:1px solid #e7edf5;border-radius:14px;padding:12px 14px!important;}
.modal-size-xl .template-system-modal-v4047{min-height:min(620px,72vh);}
body.dark .template-info-card-v4047{background:linear-gradient(135deg,#0f2238,#111c2d);border-color:#243b5a;}
body.dark .template-info-card-v4047 b,body.dark .template-summary-card-v4047 b,body.dark .template-preview-card-v4047 b,body.dark .template-tips-card-v4047 b{color:#e2e8f0;}
body.dark .template-info-card-v4047 small,body.dark .template-field-v4047 small,body.dark .template-tips-card-v4047 ul{color:#94a3b8;}
body.dark .template-field-v4047>span{color:#a8b5c7;}
body.dark .template-summary-card-v4047,body.dark .template-preview-card-v4047,body.dark .template-tips-card-v4047,body.dark .template-use-now-v4047{background:#0f172a;border-color:#243244;box-shadow:none;}
body.dark .template-summary-card-v4047 dd{color:#cbd5e1;}
body.dark .template-preview-card-v4047 pre{background:#111c2d;border-color:#243244;color:#dbeafe;}
@media (max-width:1100px){.template-system-modal-v4047{grid-template-columns:1fr;}.template-system-side-v4047{grid-template-columns:repeat(2,minmax(0,1fr));}.template-preview-card-v4047{grid-column:1/-1;}.template-content-v4047{min-height:220px!important;}}
@media (max-width:700px){.template-form-grid-v4047,.template-system-side-v4047{grid-template-columns:1fr;}.template-field-v4047.span-2{grid-column:auto;}.template-summary-card-v4047 dl{grid-template-columns:1fr;gap:3px;}.template-content-v4047{min-height:200px!important;}}


/* v40.4.8 - Note History popup workflow redesign */
.modal-panel-history{overflow:visible!important;}
.history-workflow-v4048{display:grid;gap:16px;width:100%;min-width:0;}
.history-summary-v4048{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;}
.history-summary-v4048>div{background:linear-gradient(180deg,#f8fbff,#eef6ff);border:1px solid #dce8f7;border-radius:16px;padding:14px 16px;display:grid;gap:4px;min-width:0;}
.history-summary-v4048 span,.history-preview-meta-v4048 span{font-size:11px;text-transform:uppercase;letter-spacing:.06em;font-weight:900;color:#64748b;}
.history-summary-v4048 b,.history-preview-meta-v4048 b{font-size:14px;color:#14213d;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.history-list-v4048{display:grid;gap:12px;max-height:min(52vh,520px);overflow:auto;padding-right:4px;}
.history-card-v4048{display:grid;grid-template-columns:46px minmax(0,1fr) auto;gap:14px;align-items:center;background:#fff;border:1px solid #dce8f7;border-radius:18px;padding:14px;box-shadow:0 8px 22px rgba(15,23,42,.045);min-width:0;}
.history-index-v4048{width:36px;height:36px;border-radius:12px;display:grid;place-items:center;background:linear-gradient(135deg,#2563eb,#06b6d4);color:#fff;font-weight:950;}
.history-main-v4048{min-width:0;display:grid;gap:5px;}
.history-title-line-v4048{display:flex;align-items:center;gap:8px;min-width:0;}
.history-title-line-v4048 b{font-size:14px;color:#14213d;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.history-title-line-v4048 span{font-size:10px;font-weight:900;color:#2563eb;background:#eef6ff;border:1px solid #cfe2ff;border-radius:999px;padding:4px 8px;white-space:nowrap;}
.history-meta-v4048{font-size:12px;font-weight:700;color:#64748b;}
.history-main-v4048 p{margin:0;color:#475569;font-size:12.5px;line-height:1.45;word-break:break-word;}
.history-actions-v4048{display:flex;gap:8px;align-items:center;justify-content:flex-end;}
.history-actions-v4048 button{height:34px;padding:0 12px;border-radius:11px;font-size:11px;font-weight:900;white-space:nowrap;}
.history-note-v4048{background:#f8fbff;border:1px dashed #cfe2ff;border-radius:14px;padding:12px 14px;color:#64748b;font-size:12.5px;font-weight:700;}
.history-empty-v4048{display:grid;place-items:center;text-align:center;gap:8px;min-height:220px;background:#f8fbff;border:1px dashed #cfe2ff;border-radius:18px;color:#64748b;}
.history-empty-v4048 b{font-size:16px;color:#14213d;}
.history-preview-v4048{display:grid;gap:16px;}
.history-preview-meta-v4048{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;}
.history-preview-meta-v4048>div{background:#f8fbff;border:1px solid #dce8f7;border-radius:15px;padding:13px 14px;display:grid;gap:4px;min-width:0;}
.history-preview-content-v4048{background:#fff;border:1px solid #dce8f7;border-radius:18px;padding:18px;min-height:260px;max-height:56vh;overflow:auto;line-height:1.7;color:#14213d;}
body.dark .history-summary-v4048>div,body.dark .history-preview-meta-v4048>div,body.dark .history-note-v4048,body.dark .history-empty-v4048{background:#111c2d;border-color:#25364d;}
body.dark .history-card-v4048,body.dark .history-preview-content-v4048{background:#0f172a;border-color:#25364d;box-shadow:none;}
body.dark .history-summary-v4048 b,body.dark .history-title-line-v4048 b,body.dark .history-empty-v4048 b,body.dark .history-preview-meta-v4048 b,body.dark .history-preview-content-v4048{color:#e5e7eb;}
body.dark .history-main-v4048 p,body.dark .history-meta-v4048,body.dark .history-note-v4048{color:#94a3b8;}
@media(max-width:780px){.history-summary-v4048,.history-preview-meta-v4048{grid-template-columns:1fr}.history-card-v4048{grid-template-columns:1fr;align-items:start}.history-actions-v4048{justify-content:stretch}.history-actions-v4048 button{flex:1}.history-index-v4048{width:34px;height:34px}.history-list-v4048{max-height:58vh}}


/* v40.4.9 History popup data + preview fix */
.history-preview-v4049{display:grid;gap:16px;}
.history-preview-meta-v4049{display:flex;flex-wrap:wrap;gap:10px;align-items:center;background:#f4f8ff;border:1px solid #dbe7f6;border-radius:16px;padding:14px 16px;color:#14213d;}
.history-preview-meta-v4049 b{font-size:16px;margin-right:auto;}
.history-preview-meta-v4049 span{font-size:12px;color:#64748b;background:#fff;border:1px solid #e6eef8;border-radius:999px;padding:7px 10px;}
.history-preview-body-v4049{background:#fff;border:1px solid #e6edf6;border-radius:18px;padding:18px;min-height:240px;line-height:1.6;color:#1e293b;overflow:auto;}
body.dark .history-preview-meta-v4049{background:#111c2d;border-color:#243244;color:#e5e7eb;}
body.dark .history-preview-meta-v4049 span{background:#0f172a;border-color:#334155;color:#94a3b8;}
body.dark .history-preview-body-v4049{background:#0f172a;border-color:#243244;color:#e5e7eb;}


/* v40.5.0 History Preview back workflow */
.history-preview-help-v4050{margin-top:14px;padding:12px 14px;border:1px dashed #cfe0f5;border-radius:14px;background:#f8fbff;color:#64748b;font-size:12px;font-weight:700;}
.history-preview-v4050 .history-preview-body-v4049{min-height:220px;}
body.dark .history-preview-help-v4050{background:#111c2d;border-color:#2b3b52;color:#94a3b8;}

/* v40.5.3 User Profile + per-user theme */
.v39-avatar{overflow:hidden;display:inline-flex;align-items:center;justify-content:center;}
.v39-avatar-img,.profile-avatar-preview img{width:100%;height:100%;object-fit:cover;display:block;border-radius:inherit;}
.profile-page .profile-head{align-items:flex-start;}
.profile-role-pill{display:inline-flex;align-items:center;justify-content:center;border-radius:999px;padding:8px 12px;font-size:11px;font-weight:900;letter-spacing:.04em;text-transform:uppercase;background:#eef4ff;color:#2563eb;border:1px solid #dbeafe;}
.profile-grid{display:grid;grid-template-columns:minmax(0,1.35fr) minmax(340px,.75fr);gap:18px;align-items:start;}
.profile-card{background:#fff;border:1px solid #dbe5f3;border-radius:24px;box-shadow:0 12px 30px rgba(15,23,42,.055);padding:22px;display:grid;gap:14px;}
.profile-main-card{grid-row:span 2;}
.profile-card h2{margin:0;color:#14213d;font-size:20px;}
.profile-card p,.profile-card small,.profile-help{color:#64748b;line-height:1.55;}
.profile-avatar-wrap{display:flex;gap:18px;align-items:center;padding:16px;border-radius:22px;background:linear-gradient(135deg,#f8fbff,#eef7ff);border:1px solid #dbeafe;}
.profile-avatar-preview{width:96px;height:96px;border-radius:28px;display:flex;align-items:center;justify-content:center;background:linear-gradient(135deg,#2563eb,#06b6d4);color:#fff;font-size:34px;font-weight:900;box-shadow:0 16px 32px rgba(37,99,235,.18);overflow:hidden;flex:0 0 auto;}
.profile-upload-btn{display:inline-flex;align-items:center;justify-content:center;margin:10px 0 4px;padding:10px 14px;border-radius:14px;background:#eff6ff;border:1px solid #bfdbfe;color:#2563eb;font-weight:900;cursor:pointer;}
.profile-form-grid{display:grid;grid-template-columns:180px minmax(0,1fr);gap:12px;align-items:center;}
.profile-form-grid small{grid-column:2;}
.profile-actions{display:flex;justify-content:flex-end;gap:10px;margin-top:4px;}
.profile-theme-choice{display:grid;grid-template-columns:1fr 1fr;gap:10px;}
.profile-theme-choice button{min-height:48px;border-radius:16px;border:1px solid #dbe5f3;background:#f8fbff;color:#334155;font-weight:900;cursor:pointer;}
.profile-theme-choice button.active{background:linear-gradient(135deg,#2563eb,#06b6d4);color:#fff;border-color:transparent;box-shadow:0 14px 28px rgba(37,99,235,.18);}
.profile-info-list{display:grid;grid-template-columns:120px minmax(0,1fr);gap:10px 12px;align-items:center;}
.profile-info-list span{color:#64748b;font-size:12px;font-weight:800;text-transform:uppercase;letter-spacing:.04em;}
.profile-info-list b{background:#f8fbff;border:1px solid #e7edf5;border-radius:12px;padding:9px 12px;color:#14213d;word-break:break-word;}
.readonly-card{opacity:.98;}
body.dark .profile-card{background:#0f172a;border-color:#243244;box-shadow:none;}
body.dark .profile-card h2,body.dark .profile-info-list b{color:#e2e8f0;}
body.dark .profile-card p,body.dark .profile-card small,body.dark .profile-help,body.dark .profile-info-list span{color:#94a3b8;}
body.dark .profile-avatar-wrap{background:linear-gradient(135deg,#111c2d,#0f172a);border-color:#243244;}
body.dark .profile-info-list b,body.dark .profile-theme-choice button{background:#111c2d;border-color:#243244;color:#e2e8f0;}
body.dark .profile-upload-btn{background:#102a4c;border-color:#1d4ed8;color:#93c5fd;}
@media(max-width:1100px){.profile-grid{grid-template-columns:1fr}.profile-main-card{grid-row:auto;}}
@media(max-width:720px){.profile-avatar-wrap{flex-direction:column;text-align:center}.profile-form-grid{grid-template-columns:1fr}.profile-form-grid small{grid-column:auto}.profile-actions{justify-content:stretch}.profile-actions button{width:100%;}.profile-info-list{grid-template-columns:1fr}.profile-theme-choice{grid-template-columns:1fr}}


/* v40.5.4 User Profile Professional Layout */
.profile-v4054{padding:0!important;}
.profile-v4054 .profile-shell{display:grid;gap:18px;padding:18px;max-width:1380px;margin:0 auto;}
.profile-v4054 .profile-hero-card{position:relative;overflow:hidden;border:1px solid #dbe7f6;border-radius:28px;background:linear-gradient(135deg,#ffffff 0%,#f4f9ff 58%,#eaf7ff 100%);box-shadow:0 18px 44px rgba(15,23,42,.07);padding:24px;display:flex;align-items:center;justify-content:space-between;gap:20px;}
.profile-v4054 .profile-hero-card::after{content:"";position:absolute;right:-80px;top:-120px;width:360px;height:360px;border-radius:999px;background:radial-gradient(circle,rgba(37,99,235,.16),rgba(6,182,212,.06) 55%,transparent 70%);pointer-events:none;}
.profile-v4054 .profile-hero-main{display:flex;align-items:center;gap:20px;min-width:0;position:relative;z-index:1;}
.profile-v4054 .profile-avatar-preview{width:112px;height:112px;border-radius:32px;font-size:38px;box-shadow:0 18px 38px rgba(37,99,235,.22);}
.profile-v4054 .profile-hero-copy{min-width:0;display:grid;gap:6px;}
.profile-v4054 .profile-eyebrow{font-size:12px;font-weight:900;text-transform:uppercase;letter-spacing:.08em;color:#2563eb;}
.profile-v4054 .profile-hero-copy h1{margin:0;color:#14213d;font-size:34px;line-height:1.05;letter-spacing:-.04em;}
.profile-v4054 .profile-hero-copy p{margin:0;color:#64748b;font-size:14px;word-break:break-word;}
.profile-v4054 .profile-hero-badges{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin-top:6px;}
.profile-v4054 .profile-status-pill{display:inline-flex;align-items:center;border-radius:999px;padding:8px 12px;font-size:11px;font-weight:900;letter-spacing:.04em;background:#dcfce7;color:#047857;border:1px solid #bbf7d0;}
.profile-v4054 .profile-hero-note{position:relative;z-index:1;max-width:360px;background:rgba(255,255,255,.72);border:1px solid rgba(219,231,246,.9);border-radius:22px;padding:16px 18px;display:grid;gap:4px;color:#475569;backdrop-filter:blur(10px);}
.profile-v4054 .profile-hero-note b{color:#14213d;font-size:14px;}
.profile-v4054 .profile-hero-note span{font-size:13px;line-height:1.5;}
.profile-v4054 .profile-layout{display:grid;grid-template-columns:minmax(0,1.12fr) minmax(380px,.88fr);gap:18px;align-items:start;}
.profile-v4054 .profile-main-card{grid-row:auto;}
.profile-v4054 .profile-card{border-radius:24px;padding:22px;gap:16px;box-shadow:0 12px 32px rgba(15,23,42,.055);}
.profile-v4054 .profile-card-head{display:flex;align-items:flex-start;justify-content:space-between;gap:14px;padding-bottom:12px;border-bottom:1px solid #e7edf5;}
.profile-v4054 .profile-card-head h2{font-size:19px;margin:0 0 4px;letter-spacing:-.02em;}
.profile-v4054 .profile-card-head p{margin:0;font-size:13px;}
.profile-v4054 .profile-upload-zone{display:flex;align-items:center;justify-content:space-between;gap:14px;background:#f8fbff;border:1px dashed #cfe0f5;border-radius:18px;padding:14px;}
.profile-v4054 .profile-upload-zone small{font-size:12px;}
.profile-v4054 .profile-upload-large{margin:0;padding:11px 15px;border-radius:14px;}
.profile-v4054 .profile-form-modern{grid-template-columns:150px minmax(0,1fr);gap:14px 16px;}
.profile-v4054 .profile-form-modern label,.profile-v4054 .profile-field-stack label{font-size:12px;font-weight:900;text-transform:uppercase;letter-spacing:.04em;color:#64748b;}
.profile-v4054 .profile-field-stack{display:grid;gap:10px;}
.profile-v4054 .profile-field-stack input{margin-bottom:4px;}
.profile-v4054 .profile-actions{margin-top:0;padding-top:4px;}
.profile-v4054 .profile-actions .primary{min-width:158px;height:42px;border-radius:14px;}
.profile-v4054 .profile-theme-choice{grid-template-columns:1fr 1fr;gap:12px;}
.profile-v4054 .profile-theme-choice button{min-height:82px;display:grid;place-items:center;gap:4px;padding:12px;text-align:center;}
.profile-v4054 .profile-theme-choice button span{font-size:20px;}
.profile-v4054 .profile-theme-choice button b{font-size:13px;}
.profile-v4054 .profile-theme-choice button small{font-size:11px;color:inherit;opacity:.75;}
.profile-v4054 .profile-access-card{grid-column:1 / -1;}
.profile-v4054 .profile-info-list{grid-template-columns:repeat(6,minmax(0,1fr));gap:10px;}
.profile-v4054 .profile-info-list span{display:none;}
.profile-v4054 .profile-info-list b{position:relative;min-height:56px;padding:24px 12px 10px;border-radius:16px;font-size:13px;}
.profile-v4054 .profile-info-list b:nth-of-type(1)::before{content:"Role"}.profile-v4054 .profile-info-list b:nth-of-type(2)::before{content:"Status"}.profile-v4054 .profile-info-list b:nth-of-type(3)::before{content:"Departemen"}.profile-v4054 .profile-info-list b:nth-of-type(4)::before{content:"Tim"}.profile-v4054 .profile-info-list b:nth-of-type(5)::before{content:"Shift"}.profile-v4054 .profile-info-list b:nth-of-type(6)::before{content:"Posisi"}
.profile-v4054 .profile-info-list b::before{position:absolute;left:12px;top:8px;font-size:10px;font-weight:900;text-transform:uppercase;letter-spacing:.06em;color:#7b8aa0;}
body.dark .profile-v4054 .profile-hero-card{background:linear-gradient(135deg,#0f172a 0%,#111c2d 58%,#102a4c 100%);border-color:#243244;box-shadow:none;}
body.dark .profile-v4054 .profile-hero-copy h1,body.dark .profile-v4054 .profile-hero-note b{color:#e2e8f0;}
body.dark .profile-v4054 .profile-hero-copy p,body.dark .profile-v4054 .profile-hero-note span{color:#94a3b8;}
body.dark .profile-v4054 .profile-hero-note{background:rgba(15,23,42,.74);border-color:#243244;}
body.dark .profile-v4054 .profile-card-head{border-color:#243244;}
body.dark .profile-v4054 .profile-upload-zone{background:#111c2d;border-color:#243244;}
body.dark .profile-v4054 .profile-form-modern label,body.dark .profile-v4054 .profile-field-stack label{color:#94a3b8;}
@media(max-width:1180px){.profile-v4054 .profile-layout{grid-template-columns:1fr}.profile-v4054 .profile-info-list{grid-template-columns:repeat(3,minmax(0,1fr));}}
@media(max-width:760px){.profile-v4054 .profile-shell{padding:12px}.profile-v4054 .profile-hero-card{flex-direction:column;align-items:flex-start;border-radius:22px;padding:18px}.profile-v4054 .profile-hero-main{align-items:flex-start}.profile-v4054 .profile-avatar-preview{width:82px;height:82px;border-radius:24px;font-size:30px}.profile-v4054 .profile-hero-copy h1{font-size:26px}.profile-v4054 .profile-hero-note{max-width:none;width:100%}.profile-v4054 .profile-form-modern{grid-template-columns:1fr}.profile-v4054 .profile-form-modern small{grid-column:auto}.profile-v4054 .profile-upload-zone{flex-direction:column;align-items:flex-start}.profile-v4054 .profile-theme-choice{grid-template-columns:1fr}.profile-v4054 .profile-info-list{grid-template-columns:1fr}.profile-v4054 .profile-actions{justify-content:stretch}.profile-v4054 .profile-actions .primary{width:100%;}}


/* v40.5.5 User Profile spacing fix */
.profile-page.v39-page{display:block!important;}
.profile-page .v39-page-head{margin-bottom:14px!important;}
.profile-page .profile-grid{display:grid!important;grid-template-columns:minmax(0,1.18fr) minmax(360px,.82fr)!important;gap:16px!important;align-items:start!important;}
.profile-page .profile-card{margin:0!important;}
.profile-page .profile-main-card{grid-column:1!important;grid-row:1 / span 2!important;align-self:start!important;}
.profile-page #passwordForm{grid-column:2!important;grid-row:1!important;}
.profile-page .profile-card:has(.profile-theme-choice){grid-column:2!important;grid-row:2!important;}
.profile-page .readonly-card{grid-column:1 / -1!important;grid-row:3!important;margin-top:0!important;}
.profile-page .profile-main-card + .profile-card + .profile-card + .readonly-card{margin-top:0!important;}
.profile-page .profile-form-grid{margin-bottom:0!important;}
.profile-page .profile-actions{margin-bottom:0!important;}
.profile-page .profile-v4054 .profile-layout{gap:16px!important;}
.profile-v4054 .profile-layout{gap:16px!important;}
.profile-v4054 .profile-card{margin:0!important;}
.profile-v4054 .profile-access-card{margin-top:0!important;}
.profile-v4054 .profile-shell{gap:14px!important;}
.profile-v4054 .profile-layout{align-items:start!important;}
@supports not selector(:has(*)){
  .profile-page .profile-grid{display:flex!important;flex-direction:column!important;gap:16px!important;}
}
@media(max-width:1100px){
  .profile-page .profile-grid{grid-template-columns:1fr!important;}
  .profile-page .profile-main-card,.profile-page #passwordForm,.profile-page .profile-card:has(.profile-theme-choice),.profile-page .readonly-card{grid-column:auto!important;grid-row:auto!important;}
}


/* v40.5.7 Notification click routing polish */
.notification-click{cursor:pointer;transition:transform .16s ease,border-color .16s ease,box-shadow .16s ease;}
.notification-click:hover{transform:translateY(-1px);border-color:rgba(37,99,235,.28)!important;box-shadow:0 14px 28px rgba(15,23,42,.07)!important;}
.notification-click .v39-card-actions{position:relative;z-index:2;}
.notif-destination{display:inline-flex;align-items:center;width:max-content;margin-top:8px;padding:5px 10px;border-radius:999px;background:#eef6ff;color:#2563eb;font-style:normal;font-size:11px;font-weight:850;border:1px solid #d8e8ff;}
.notif-link-line{cursor:pointer;border-radius:14px;transition:background .16s ease,transform .16s ease;}
.notif-link-line:hover{background:#f3f8ff;transform:translateY(-1px);}
body.dark .notif-destination{background:#10233e;color:#93c5fd;border-color:#1e3a5f;}
body.dark .notif-link-line:hover{background:#111c2d;}

/* v40.5.9 - Fixed size Mail Alias Management card */
.view-admin .um-mail-alias-card.professional{
  min-height:620px!important;
  max-height:760px!important;
  height:clamp(620px, 72vh, 760px)!important;
  overflow:hidden!important;
  display:flex!important;
  flex-direction:column!important;
}
.view-admin .um-mail-alias-card.professional .um-mail-alias-head,
.view-admin .um-mail-alias-card.professional .um-mail-alias-stats,
.view-admin .um-mail-alias-card.professional .mail-tools-row,
.view-admin .um-mail-alias-card.professional .mail-filter-tabs,
.view-admin .um-mail-alias-card.professional .mail-alias-note{
  flex:0 0 auto!important;
}
.view-admin .um-mail-alias-card.professional .mail-alias-table-card{
  flex:1 1 auto!important;
  min-height:260px!important;
  overflow:hidden!important;
  display:flex!important;
  flex-direction:column!important;
}
.view-admin .um-mail-alias-card.professional .mail-alias-table-head{
  flex:0 0 auto!important;
  position:sticky!important;
  top:0!important;
  z-index:2!important;
}
.view-admin .um-mail-alias-card.professional .mail-alias-table-body{
  flex:1 1 auto!important;
  overflow-y:auto!important;
  overflow-x:hidden!important;
  min-height:0!important;
}
.view-admin .um-mail-alias-card.professional .mail-alias-table-row{
  min-height:58px!important;
}
.view-admin .um-mail-alias-card.professional .mail-alias-note{
  margin-top:0!important;
  padding:10px 12px!important;
  border:1px dashed var(--border,#dbe5f3)!important;
  border-radius:14px!important;
  background:rgba(148,163,184,.08)!important;
}
@media(max-width:1100px){
  .view-admin .um-mail-alias-card.professional{
    height:auto!important;
    min-height:0!important;
    max-height:none!important;
    overflow:visible!important;
  }
  .view-admin .um-mail-alias-card.professional .mail-alias-table-card{
    max-height:520px!important;
  }
  .view-admin .um-mail-alias-card.professional .mail-alias-table-body{
    max-height:520px!important;
  }
}


/* v40.5.10 - merge User Management search/filter into Pengguna card */
.view-admin .um-filters-card{display:none!important;}
.view-admin .um-user-card-list{padding:20px!important;overflow:hidden!important;}
.view-admin .um-list-head{display:flex!important;align-items:flex-start!important;justify-content:space-between!important;gap:16px!important;padding:4px 2px 16px!important;border-bottom:1px solid #e7edf5!important;margin-bottom:16px!important;}
.view-admin .um-list-count{display:inline-flex;align-items:center;justify-content:center;min-height:34px;padding:0 12px;border-radius:999px;background:#eef6ff;border:1px solid #d7e8ff;color:#2563eb;font-size:12px;font-weight:900;white-space:nowrap;}
.view-admin .um-users-toolbar{display:grid;grid-template-columns:minmax(280px,1fr) 220px 220px auto;gap:14px;align-items:center;margin:0 0 18px;padding:14px;border:1px solid #e7edf5;border-radius:18px;background:linear-gradient(180deg,#fbfdff,#f7faff);}
.view-admin .um-users-toolbar .um-filter-search,.view-admin .um-users-toolbar .um-select-wrap{height:48px!important;background:#fff!important;border:1px solid #dbe5f3!important;border-radius:14px!important;box-shadow:none!important;}
.view-admin .um-users-toolbar .um-filter-search input{height:100%!important;}
.view-admin .um-users-toolbar .um-reset-btn{height:48px!important;border-radius:14px!important;white-space:nowrap!important;}
body.dark .view-admin .um-list-head{border-color:#233145!important;}
body.dark .view-admin .um-list-count{background:#10233f;border-color:#1d4ed8;color:#93c5fd;}
body.dark .view-admin .um-users-toolbar{background:#0b1220;border-color:#243244;}
body.dark .view-admin .um-users-toolbar .um-filter-search,body.dark .view-admin .um-users-toolbar .um-select-wrap{background:#111827!important;border-color:#334155!important;}
@media (max-width:1280px){.view-admin .um-users-toolbar{grid-template-columns:minmax(220px,1fr) 1fr 1fr auto;}}
@media (max-width:1080px){.view-admin .um-users-toolbar{grid-template-columns:1fr;}.view-admin .um-list-head{flex-direction:column;align-items:flex-start!important;}.view-admin .um-list-count{align-self:flex-start;}}
@media (max-width:640px){.view-admin .um-user-card-list{padding:14px!important;}.view-admin .um-users-toolbar{padding:12px;gap:10px;border-radius:16px;}}

/* v40.5.11 - Employee sensitive data management in User Management */
.view-admin .employee-meta b{color:#0f766e!important;}
.view-admin .employee-action-btn{border-color:#99f6e4!important;color:#0f766e!important;background:#ecfdf5!important;}
body.dark .view-admin .employee-action-btn{background:#052e2b!important;border-color:#115e59!important;color:#5eead4!important;}
.employee-security-card{border-color:#99f6e4!important;background:linear-gradient(135deg,#f0fdfa,#fff)!important;}
body.dark .employee-security-card{background:linear-gradient(135deg,#052e2b,#0b1220)!important;border-color:#115e59!important;}
.employee-preview-v40511,.employee-edit-v40511{display:flex;flex-direction:column;gap:18px;}
.employee-preview-head{display:flex;align-items:flex-start;justify-content:space-between;gap:14px;padding:16px;border:1px solid #dbe5f3;border-radius:18px;background:linear-gradient(135deg,#f8fafc,#eefdf8);}
.employee-preview-head h3{margin:0 0 4px;font-size:20px;}
.employee-preview-head p{margin:0;color:#64748b;font-size:13px;}
.employee-preview-head>span{display:inline-flex;align-items:center;padding:8px 12px;border-radius:999px;background:#ccfbf1;color:#0f766e;font-size:12px;font-weight:900;white-space:nowrap;}
.employee-preview-section,.employee-form-section{padding:16px;border:1px solid #e5edf6;border-radius:18px;background:#fff;}
.employee-preview-section h4,.employee-form-section h3{margin:0 0 14px;font-size:16px;}
.employee-read-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;}
.employee-read-item{padding:12px;border:1px solid #eef2f7;border-radius:14px;background:#f8fafc;min-width:0;}
.employee-read-item span{display:block;font-size:11px;font-weight:900;color:#64748b;text-transform:uppercase;letter-spacing:.04em;margin-bottom:4px;}
.employee-read-item b{display:block;color:#0f172a;font-size:13px;word-break:break-word;}
.employee-doc-row{display:flex;flex-wrap:wrap;gap:10px;margin-top:14px;}
.employee-doc-link,.employee-doc-empty{display:inline-flex;align-items:center;min-height:38px;padding:0 12px;border-radius:999px;font-size:12px;font-weight:900;text-decoration:none;}
.employee-doc-link{background:#eff6ff;color:#2563eb;border:1px solid #bfdbfe;}
.employee-doc-empty{background:#f8fafc;color:#94a3b8;border:1px dashed #cbd5e1;}
.employee-warning-v40511{display:flex;flex-direction:column;gap:4px;padding:14px 16px;border:1px solid #fde68a;border-radius:16px;background:#fffbeb;color:#92400e;}
.employee-warning-v40511 small{font-size:12px;color:#a16207;}
.employee-form-grid{display:grid;grid-template-columns:190px minmax(0,1fr);gap:12px 14px;align-items:center;}
.employee-form-grid label{font-size:12px;font-weight:900;color:#475569;text-transform:uppercase;letter-spacing:.03em;}
.employee-form-grid small{grid-column:2;color:#64748b;font-size:12px;margin-top:-6px;}
.employee-form-grid textarea.modal-input{min-height:78px;resize:vertical;}
body.dark .employee-preview-head{background:linear-gradient(135deg,#0b1220,#052e2b);border-color:#1f3a45;}
body.dark .employee-preview-head p{color:#94a3b8;}
body.dark .employee-preview-section,body.dark .employee-form-section{background:#0b1220;border-color:#243244;}
body.dark .employee-read-item{background:#111827;border-color:#243244;}
body.dark .employee-read-item b{color:#e5e7eb;}
body.dark .employee-doc-empty{background:#111827;border-color:#334155;color:#64748b;}
body.dark .employee-warning-v40511{background:#2a1f08;border-color:#854d0e;color:#fde68a;}
@media(max-width:760px){.employee-read-grid{grid-template-columns:1fr;}.employee-form-grid{grid-template-columns:1fr;}.employee-form-grid small{grid-column:1}.employee-preview-head{flex-direction:column;}.view-admin .um-actions{align-items:stretch}.view-admin .um-actions button{width:100%;}}

/* v40.5.12 Visa urgent reminder */
.visa-urgent-banner-v40512{display:flex;align-items:center;justify-content:space-between;gap:14px;padding:16px 18px;border:1px solid #fecaca;border-radius:20px;background:linear-gradient(135deg,#fff1f2,#fffbeb);box-shadow:0 14px 34px rgba(239,68,68,.12);}
.visa-urgent-banner-v40512 b{display:block;color:#991b1b;font-size:16px;}
.visa-urgent-banner-v40512 span{display:block;color:#7f1d1d;font-size:13px;margin-top:3px;}
.visa-alert-modal-v40512{display:flex;flex-direction:column;gap:10px;max-height:60vh;overflow:auto;padding-right:4px;}
.visa-alert-row-v40512{display:grid;grid-template-columns:minmax(0,1fr) auto auto;align-items:center;gap:12px;padding:13px 14px;border:1px solid #fed7aa;border-radius:16px;background:#fff7ed;}
.visa-alert-row-v40512.expired{border-color:#fecaca;background:#fef2f2;}
.visa-alert-row-v40512 b{display:block;color:#111827;}
.visa-alert-row-v40512 small{display:block;color:#64748b;margin-top:3px;}
.visa-alert-row-v40512 span{padding:7px 10px;border-radius:999px;background:#fee2e2;color:#991b1b;font-size:12px;font-weight:900;white-space:nowrap;}
.visa-alert-row-v40512 em{font-style:normal;color:#475569;font-size:12px;white-space:nowrap;}
body.dark .visa-urgent-banner-v40512{background:linear-gradient(135deg,#2a0f13,#2a1f08);border-color:#7f1d1d;box-shadow:none;}
body.dark .visa-urgent-banner-v40512 b{color:#fecaca;}
body.dark .visa-urgent-banner-v40512 span{color:#fca5a5;}
body.dark .visa-alert-row-v40512{background:#1f1408;border-color:#854d0e;}
body.dark .visa-alert-row-v40512.expired{background:#2a0f13;border-color:#7f1d1d;}
body.dark .visa-alert-row-v40512 b{color:#f8fafc;}
body.dark .visa-alert-row-v40512 small,body.dark .visa-alert-row-v40512 em{color:#cbd5e1;}
@media(max-width:760px){.visa-urgent-banner-v40512{flex-direction:column;align-items:stretch}.visa-alert-row-v40512{grid-template-columns:1fr}.visa-alert-row-v40512 span,.visa-alert-row-v40512 em{width:max-content}}

/* v40.5.13 Employee contract access/freeze polish */
.visa-alert-modal-v40512 h3{margin:10px 0 8px;font-size:14px;letter-spacing:.02em;color:var(--text,#111827)}
.employee-meta b{line-height:1.35}
.employee-form-section small{display:block;color:var(--muted,#64748b);line-height:1.35}


/* =========================================================
   v40.5.16 — Professional Pending Approval Popup
   ========================================================= */
.pending-approval-modal-v40516{display:grid!important;gap:14px!important;width:min(920px,86vw)!important;max-width:920px!important;}
.pending-approval-hero-v40516{display:flex!important;justify-content:space-between!important;gap:16px!important;align-items:center!important;padding:18px!important;border-radius:22px!important;border:1px solid rgba(245,158,11,.28)!important;background:linear-gradient(135deg,rgba(255,251,235,.98),rgba(239,246,255,.96))!important;box-shadow:0 16px 42px rgba(15,23,42,.08)!important;}
.pending-approval-hero-v40516>div:first-child{display:flex!important;align-items:center!important;gap:12px!important;min-width:0!important;}.pending-hero-icon-v40516{width:46px!important;height:46px!important;border-radius:16px!important;display:grid!important;place-items:center!important;background:#f59e0b!important;color:#fff!important;font-size:22px!important;box-shadow:0 10px 24px rgba(245,158,11,.28)!important;}
.pending-approval-hero-v40516 b{display:block!important;font-size:18px!important;line-height:1.2!important;color:var(--v39-text,#14213d)!important;}.pending-approval-hero-v40516 small{display:block!important;margin-top:4px!important;color:var(--v39-muted,#64748b)!important;font-size:12px!important;}
.pending-hero-stats-v40516{display:flex!important;gap:10px!important;flex-wrap:wrap!important;justify-content:flex-end!important;}.pending-hero-stats-v40516 span{min-width:120px!important;padding:10px 12px!important;border-radius:16px!important;border:1px solid rgba(148,163,184,.28)!important;background:rgba(255,255,255,.78)!important;}.pending-hero-stats-v40516 b{font-size:14px!important;}.pending-hero-stats-v40516 small{font-size:10.5px!important;text-transform:uppercase!important;letter-spacing:.04em!important;}
.pending-approval-note-v40516{display:flex!important;gap:10px!important;align-items:flex-start!important;padding:12px 14px!important;border-radius:16px!important;background:rgba(37,99,235,.06)!important;border:1px solid rgba(37,99,235,.14)!important;color:var(--v39-text,#14213d)!important;}.pending-approval-note-v40516 b{white-space:nowrap!important;font-size:12px!important;}.pending-approval-note-v40516 span{font-size:12px!important;line-height:1.55!important;color:var(--v39-muted,#64748b)!important;}
.pending-approval-list-v40516{display:grid!important;gap:10px!important;max-height:min(58vh,620px)!important;overflow:auto!important;padding-right:3px!important;}.pending-approval-row-v40516{display:grid!important;grid-template-columns:minmax(230px,.92fr) minmax(330px,1.35fr) auto!important;gap:14px!important;align-items:center!important;padding:14px!important;border-radius:20px!important;border:1px solid var(--v39-line,#dbe5f3)!important;background:#fff!important;box-shadow:0 10px 28px rgba(15,23,42,.045)!important;}
.pending-user-main-v40516{display:flex!important;align-items:center!important;gap:12px!important;min-width:0!important;}.pending-avatar-v40516{width:44px!important;height:44px!important;border-radius:16px!important;display:grid!important;place-items:center!important;background:linear-gradient(135deg,#2563eb,#7c3aed)!important;color:#fff!important;font-weight:900!important;font-size:16px!important;box-shadow:0 10px 24px rgba(37,99,235,.22)!important;}.pending-identity-v40516{min-width:0!important;}.pending-identity-v40516 b,.pending-identity-v40516 small,.pending-identity-v40516 em{display:block!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important;}.pending-identity-v40516 b{font-size:14px!important;color:var(--v39-text,#14213d)!important;}.pending-identity-v40516 small{font-size:12px!important;color:var(--v39-muted,#64748b)!important;margin-top:2px!important;}.pending-identity-v40516 em{font-style:normal!important;font-size:10px!important;color:#94a3b8!important;margin-top:2px!important;}
.pending-user-meta-v40516{display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:8px!important;}.pending-user-meta-v40516 span{padding:8px 10px!important;border-radius:14px!important;border:1px solid var(--v39-line,#dbe5f3)!important;background:#f8fbff!important;min-width:0!important;}.pending-user-meta-v40516 small,.pending-user-meta-v40516 b{display:block!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important;}.pending-user-meta-v40516 small{font-size:9.5px!important;text-transform:uppercase!important;letter-spacing:.04em!important;color:var(--v39-muted,#64748b)!important;margin-bottom:2px!important;}.pending-user-meta-v40516 b{font-size:11.5px!important;color:var(--v39-text,#14213d)!important;}
.pending-actions-v40516{display:flex!important;flex-direction:column!important;gap:8px!important;min-width:118px!important;}.pending-btn{width:100%!important;min-height:36px!important;border-radius:12px!important;padding:0 14px!important;font-weight:900!important;font-size:11.5px!important;}.pending-btn.approve{box-shadow:0 10px 22px rgba(37,99,235,.18)!important;}.pending-protected-v40516{padding:8px 10px!important;border-radius:12px!important;background:#f1f5f9!important;color:#64748b!important;font-weight:800!important;text-align:center!important;font-size:11px!important;}
.pending-empty-v40516{min-height:210px!important;display:grid!important;place-items:center!important;text-align:center!important;border:1px dashed var(--v39-line,#dbe5f3)!important;border-radius:22px!important;background:#f8fbff!important;padding:24px!important;}.pending-empty-v40516 span{width:48px!important;height:48px!important;border-radius:999px!important;display:grid!important;place-items:center!important;background:#dcfce7!important;color:#16a34a!important;font-size:22px!important;font-weight:900!important;margin-bottom:8px!important;}.pending-empty-v40516 b{font-size:16px!important;color:var(--v39-text,#14213d)!important;}.pending-empty-v40516 small{display:block!important;margin-top:6px!important;color:var(--v39-muted,#64748b)!important;}
body.dark .pending-approval-hero-v40516{background:linear-gradient(135deg,rgba(30,41,59,.98),rgba(15,23,42,.98))!important;border-color:rgba(245,158,11,.22)!important;}body.dark .pending-hero-stats-v40516 span,body.dark .pending-approval-row-v40516,body.dark .pending-user-meta-v40516 span,body.dark .pending-empty-v40516{background:var(--panel,#111827)!important;border-color:var(--border,#334155)!important;}body.dark .pending-approval-note-v40516{background:rgba(37,99,235,.12)!important;border-color:rgba(96,165,250,.22)!important;}body.dark .pending-approval-hero-v40516 b,body.dark .pending-identity-v40516 b,body.dark .pending-user-meta-v40516 b,body.dark .pending-empty-v40516 b{color:var(--text,#e5e7eb)!important;}
@media(max-width:900px){.pending-approval-hero-v40516,.pending-approval-row-v40516{grid-template-columns:1fr!important;display:grid!important}.pending-actions-v40516{flex-direction:row!important;min-width:0!important}.pending-user-meta-v40516{grid-template-columns:repeat(2,minmax(0,1fr))!important}}@media(max-width:560px){.pending-approval-modal-v40516{width:92vw!important}.pending-user-meta-v40516{grid-template-columns:1fr!important}.pending-actions-v40516{flex-direction:column!important}.pending-hero-stats-v40516 span{min-width:100%!important}}


/* =========================================================
   v40.5.17 — Pending Approval Popup Proportional Layout Fix
   Fix horizontal scrolling, cramped content, and oversized empty-state.
   ========================================================= */
.pending-approval-modal-v40517,
.pending-approval-modal-v40516{
  width:100%!important;
  max-width:100%!important;
  min-width:0!important;
  box-sizing:border-box!important;
  display:grid!important;
  gap:12px!important;
  overflow:hidden!important;
}
.app-modal-v4045 .pending-approval-modal-v40517,
.app-modal-v4045 .pending-approval-modal-v40516,
.modal-body-v4045 .pending-approval-modal-v40517,
.modal-body-v4045 .pending-approval-modal-v40516{
  max-width:100%!important;
}
.modal-body-v4045:has(.pending-approval-modal-v40517),
.modal-body-v4045:has(.pending-approval-modal-v40516){
  overflow-x:hidden!important;
  padding:18px 20px!important;
}
.app-modal-v4045:has(.pending-approval-modal-v40517),
.app-modal-v4045:has(.pending-approval-modal-v40516){
  width:min(820px,calc(100vw - 32px))!important;
}
.pending-approval-hero-v40516{
  width:100%!important;
  max-width:100%!important;
  box-sizing:border-box!important;
  display:grid!important;
  grid-template-columns:minmax(0,1fr) auto!important;
  gap:12px!important;
  padding:14px!important;
  border-radius:18px!important;
}
.pending-approval-hero-v40516>div:first-child{
  min-width:0!important;
}
.pending-hero-icon-v40516{
  width:42px!important;
  height:42px!important;
  border-radius:14px!important;
  font-size:20px!important;
  flex:0 0 42px!important;
}
.pending-approval-hero-v40516 b{
  font-size:16px!important;
}
.pending-approval-hero-v40516 small{
  font-size:11.5px!important;
  line-height:1.35!important;
}
.pending-hero-stats-v40516{
  display:grid!important;
  grid-template-columns:repeat(2,minmax(86px,1fr))!important;
  gap:8px!important;
  min-width:0!important;
  justify-content:stretch!important;
}
.pending-hero-stats-v40516 span{
  min-width:0!important;
  padding:8px 10px!important;
  border-radius:14px!important;
}
.pending-hero-stats-v40516 b{
  font-size:12px!important;
  white-space:nowrap!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
}
.pending-hero-stats-v40516 small{
  font-size:9.5px!important;
}
.pending-approval-note-v40516{
  width:100%!important;
  box-sizing:border-box!important;
  display:grid!important;
  grid-template-columns:auto minmax(0,1fr)!important;
  gap:8px!important;
  padding:10px 12px!important;
  border-radius:14px!important;
  overflow:hidden!important;
}
.pending-approval-note-v40516 b{
  font-size:11.5px!important;
  white-space:nowrap!important;
}
.pending-approval-note-v40516 span{
  min-width:0!important;
  font-size:11.5px!important;
  line-height:1.45!important;
  overflow-wrap:anywhere!important;
}
.pending-approval-list-v40516{
  width:100%!important;
  max-width:100%!important;
  overflow-y:auto!important;
  overflow-x:hidden!important;
  padding-right:0!important;
  box-sizing:border-box!important;
}
.pending-approval-row-v40516{
  width:100%!important;
  max-width:100%!important;
  min-width:0!important;
  box-sizing:border-box!important;
  grid-template-columns:minmax(0,1fr)!important;
  gap:10px!important;
  padding:12px!important;
  border-radius:16px!important;
}
.pending-user-main-v40516,
.pending-identity-v40516,
.pending-user-meta-v40516,
.pending-actions-v40516{
  min-width:0!important;
  max-width:100%!important;
}
.pending-user-meta-v40516{
  grid-template-columns:repeat(3,minmax(0,1fr))!important;
  gap:7px!important;
}
.pending-user-meta-v40516 span{
  padding:7px 9px!important;
  border-radius:12px!important;
}
.pending-user-meta-v40516 small{
  font-size:9px!important;
}
.pending-user-meta-v40516 b{
  font-size:11px!important;
}
.pending-actions-v40516{
  display:grid!important;
  grid-template-columns:repeat(3,minmax(0,1fr))!important;
  gap:8px!important;
  width:100%!important;
}
.pending-btn{
  min-height:36px!important;
  width:100%!important;
  padding:0 10px!important;
  font-size:11px!important;
  border-radius:12px!important;
}
.pending-empty-v40516{
  width:100%!important;
  max-width:100%!important;
  min-height:150px!important;
  box-sizing:border-box!important;
  padding:20px!important;
  border-radius:18px!important;
  display:flex!important;
  flex-direction:column!important;
  align-items:center!important;
  justify-content:center!important;
  gap:8px!important;
}
.pending-empty-v40516 span{
  width:46px!important;
  height:46px!important;
  margin:0!important;
}
.pending-empty-v40516 b{
  font-size:15px!important;
}
.pending-empty-v40516 small{
  font-size:11px!important;
  margin:0!important;
}
@media(max-width:760px){
  .app-modal-v4045:has(.pending-approval-modal-v40517),
  .app-modal-v4045:has(.pending-approval-modal-v40516){
    width:min(96vw,calc(100vw - 18px))!important;
    border-radius:22px!important;
  }
  .modal-backdrop-v4045{padding:9px!important;}
  .modal-head-v4045{padding:14px!important;}
  .modal-body-v4045:has(.pending-approval-modal-v40517),
  .modal-body-v4045:has(.pending-approval-modal-v40516){padding:14px!important;}
  .modal-actions-v4045{padding:12px 14px!important;}
  .pending-approval-hero-v40516{
    grid-template-columns:1fr!important;
  }
  .pending-hero-stats-v40516{
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
  }
  .pending-user-meta-v40516{
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
  }
  .pending-actions-v40516{
    grid-template-columns:1fr!important;
  }
}
@media(max-width:480px){
  .pending-hero-stats-v40516,
  .pending-user-meta-v40516{
    grid-template-columns:1fr!important;
  }
  .pending-approval-note-v40516{
    grid-template-columns:1fr!important;
  }
}

/* v40.5.19 Login / Request Access proportional layout fix
   - Makes Request Access form compact and fully visible
   - Prevents clipped Login link/button area
   - Keeps the existing Savaya Note split-panel design */
.auth-panel-v405{
  width:min(920px,calc(100vw - 56px))!important;
  min-height:550px!important;
  max-height:calc(100vh - 48px)!important;
}
.auth-panel-v405.active .auth-register-side{
  align-items:center!important;
}
.auth-register-side{
  padding:26px 54px 24px 58px!important;
}
.auth-login-side{
  padding:34px 58px 32px 48px!important;
}
.auth-register-side .auth-form-inner,
.auth-login-side .auth-form-inner{
  max-width:350px!important;
  margin:0 auto!important;
}
.auth-register-side .auth-mini-brand,
.auth-login-side .auth-mini-brand{
  margin-bottom:12px!important;
}
.auth-register-side .auth-mini-brand span,
.auth-login-side .auth-mini-brand span{
  width:34px!important;
  height:34px!important;
  border-radius:12px!important;
  font-size:13px!important;
}
.auth-register-side .auth-mini-brand b,
.auth-login-side .auth-mini-brand b{
  font-size:15px!important;
}
.auth-register-side .auth-form-inner h2,
.auth-login-side .auth-form-inner h2{
  font-size:30px!important;
  line-height:1.08!important;
  margin-bottom:0!important;
}
.auth-register-side .auth-subtitle,
.auth-login-side .auth-subtitle{
  font-size:13px!important;
  line-height:1.45!important;
  margin:8px 0 14px!important;
  max-width:320px!important;
}
.auth-register-side .auth-form-v405,
.auth-login-side .auth-form-v405{
  gap:10px!important;
}
.auth-register-side .auth-field,
.auth-login-side .auth-field{
  height:48px!important;
  margin-top:0!important;
}
.auth-register-side .auth-field input,
.auth-login-side .auth-field input{
  font-size:14px!important;
  padding:15px 38px 4px 0!important;
}
.auth-register-side .auth-field span,
.auth-login-side .auth-field span{
  font-size:13px!important;
}
.auth-register-side .auth-field input:focus ~ span,
.auth-register-side .auth-field input:not(:placeholder-shown) ~ span,
.auth-login-side .auth-field input:focus ~ span,
.auth-login-side .auth-field input:not(:placeholder-shown) ~ span{
  top:2px!important;
  font-size:10px!important;
}
.auth-register-side .auth-btn,
.auth-login-side .auth-btn{
  height:46px!important;
  margin-top:6px!important;
  border-radius:14px!important;
  font-size:13px!important;
}
.auth-register-side .auth-switch-text,
.auth-login-side .auth-switch-text{
  font-size:13px!important;
  line-height:1.35!important;
  margin-top:8px!important;
}
.auth-register-side .auth-switch-text button,
.auth-login-side .auth-switch-text button{
  padding:6px 12px!important;
  margin-top:5px!important;
}
.auth-register-info,
.auth-login-info{
  padding-top:0!important;
  padding-bottom:0!important;
}
.auth-register-info h2,
.auth-login-info h2{
  font-size:32px!important;
}
.auth-register-info p,
.auth-login-info p{
  font-size:14px!important;
  line-height:1.58!important;
  max-width:310px!important;
}
@media (max-width:900px){
  .auth-panel-v405{
    width:min(460px,calc(100vw - 28px))!important;
    max-height:none!important;
    min-height:auto!important;
  }
  .auth-form-side{
    min-height:auto!important;
    padding:28px 26px!important;
  }
  .auth-register-side .auth-form-inner,
  .auth-login-side .auth-form-inner{
    max-width:100%!important;
  }
}
@media (max-width:460px){
  .auth-v405{padding:14px!important;}
  .auth-panel-v405{width:100%!important;border-radius:24px!important;}
  .auth-form-side{padding:24px 20px!important;border-radius:22px!important;}
  .auth-register-side .auth-form-inner h2,
  .auth-login-side .auth-form-inner h2{font-size:27px!important;}
  .auth-register-side .auth-field,
  .auth-login-side .auth-field{height:46px!important;}
  .auth-register-side .auth-btn,
  .auth-login-side .auth-btn{height:44px!important;}
}


/* v40.5.21 admin edit user modal fix */
.user-edit-modal-v520{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:14px 16px!important;align-items:start!important}
.user-edit-modal-v520 .modal-section-title-v396{grid-column:1/-1!important;margin-top:0!important}
.user-edit-modal-v520 .user-field-v520{display:flex!important;flex-direction:column!important;gap:6px!important;min-width:0!important}
.user-edit-modal-v520 .user-field-v520.full{grid-column:1/-1!important}
.user-edit-modal-v520 .user-field-v520 label{margin:0!important;font-size:12px!important;font-weight:800!important;color:var(--muted)!important;display:block!important}
.user-edit-modal-v520 .user-field-v520 .modal-input{width:100%!important;min-width:0!important}
.user-edit-modal-v520 .user-field-v520 textarea.modal-input{min-height:96px!important;resize:vertical!important}
.user-edit-modal-v520 .user-field-v520 small{margin:0!important;line-height:1.45!important;display:block!important}
.user-edit-modal-v520 .security-check-v396{margin:0!important;display:flex!important;align-items:center!important;gap:8px!important;width:100%!important}
.user-edit-modal-v520 .security-check-v396 input{margin:0!important}
.app-modal:has(.user-edit-modal-v520){width:min(920px,calc(100vw - 32px))!important}
@media (max-width: 760px){
  .user-edit-modal-v520{grid-template-columns:1fr!important;gap:12px!important}
}


/* v40.5.22 User Profile UI/UX redesign */
.profile-pro-v40522{padding:18px!important;max-width:1500px!important;margin:0 auto!important;display:block!important}
.profile-pro-v40522 .profile-pro-head{display:flex!important;align-items:flex-start!important;justify-content:space-between!important;gap:16px!important;margin:0 0 18px!important}
.profile-pro-v40522 .profile-pro-head h1{margin:0!important;color:#0f2142!important;font-size:30px!important;line-height:1.05!important;letter-spacing:-.04em!important;font-weight:950!important}
.profile-pro-v40522 .profile-pro-head p{margin:6px 0 0!important;color:#64748b!important;font-size:13px!important}
.profile-pro-v40522 .profile-role-pill{background:#eef5ff!important;color:#2563eb!important;border-color:#cfe0ff!important;padding:9px 15px!important;box-shadow:0 12px 28px rgba(37,99,235,.08)!important}
.profile-pro-v40522 .profile-pro-grid{display:grid!important;grid-template-columns:minmax(0,1.04fr) minmax(390px,.96fr)!important;gap:18px!important;align-items:start!important}
.profile-pro-v40522 .profile-pro-card{background:#fff!important;border:1px solid #dbe5f3!important;border-radius:22px!important;box-shadow:0 16px 42px rgba(15,23,42,.06)!important;padding:20px!important;display:grid!important;gap:16px!important;min-width:0!important;margin:0!important}
.profile-pro-v40522 .profile-pro-main{grid-column:1!important;grid-row:1 / span 2!important;padding:0!important;overflow:hidden!important}
.profile-pro-v40522 .profile-pro-gradient{position:relative!important;display:flex!important;align-items:center!important;gap:24px!important;padding:34px!important;background:linear-gradient(135deg,#2563eb 0%,#0ea5e9 52%,#16c6d8 100%)!important;color:#fff!important;overflow:hidden!important}
.profile-pro-v40522 .profile-pro-gradient::after{content:"";position:absolute;right:-42px;top:-52px;width:250px;height:250px;border-radius:999px;background:radial-gradient(circle,rgba(255,255,255,.22),rgba(255,255,255,.06) 56%,transparent 66%);pointer-events:none}
.profile-pro-v40522 .profile-avatar-preview{width:126px!important;height:126px!important;border-radius:28px!important;background:linear-gradient(135deg,#2563eb,#06b6d4)!important;border:2px solid rgba(255,255,255,.48)!important;box-shadow:0 20px 42px rgba(15,23,42,.22)!important;font-size:52px!important;color:#fff!important;flex:0 0 auto!important;z-index:1!important}
.profile-pro-v40522 .profile-pro-identity{position:relative!important;z-index:1!important;display:grid!important;gap:8px!important;min-width:0!important}
.profile-pro-v40522 .profile-pro-identity h2{margin:0!important;font-size:32px!important;line-height:1.05!important;color:#fff!important;letter-spacing:-.04em!important}
.profile-pro-v40522 .profile-pro-identity p{margin:0!important;color:rgba(255,255,255,.92)!important;font-weight:750!important;word-break:break-word!important}
.profile-pro-v40522 .profile-verified-dot{display:inline-grid!important;place-items:center!important;width:20px!important;height:20px!important;border-radius:999px!important;background:rgba(255,255,255,.26)!important;font-size:13px!important;vertical-align:middle!important}
.profile-pro-v40522 .profile-upload-row{display:flex!important;align-items:center!important;gap:14px!important;flex-wrap:wrap!important;margin-top:8px!important}
.profile-pro-v40522 .profile-upload-row small{color:rgba(255,255,255,.9)!important;max-width:280px!important;line-height:1.45!important}
.profile-pro-v40522 .profile-upload-btn{margin:0!important;background:#fff!important;border-color:rgba(255,255,255,.75)!important;color:#2563eb!important;border-radius:14px!important;padding:12px 16px!important;box-shadow:0 14px 28px rgba(15,23,42,.16)!important;display:inline-flex!important;align-items:center!important;gap:8px!important}
.profile-pro-v40522 .ui-icon{width:18px;height:18px;flex:0 0 auto}
.profile-pro-v40522 .profile-pro-fields{display:grid!important;gap:16px!important;padding:28px 34px 8px!important}
.profile-pro-v40522 .profile-pro-field{display:grid!important;grid-template-columns:160px minmax(0,1fr)!important;gap:16px!important;align-items:center!important;margin:0!important;color:#0f2142!important;font-weight:900!important;font-size:13px!important}
.profile-pro-v40522 .profile-pro-field span{display:flex!important;align-items:center!important;gap:10px!important;color:#334155!important;min-width:0!important}
.profile-pro-v40522 .profile-pro-field span .ui-icon{color:#2563eb!important;background:#f3f8ff!important;border:1px solid #dbeafe!important;border-radius:12px!important;padding:8px!important;width:38px!important;height:38px!important;box-sizing:border-box!important}
.profile-pro-v40522 .modal-input{height:46px!important;border-radius:13px!important;border:1px solid #cfdaea!important;background:#fbfdff!important;box-shadow:inset 0 1px 0 rgba(255,255,255,.65)!important;font-weight:750!important;color:#0f2142!important}
.profile-pro-v40522 .profile-help{margin:0!important;color:#64748b!important;line-height:1.55!important;font-size:12px!important;padding-left:176px!important}
.profile-pro-v40522 .profile-actions{display:flex!important;justify-content:flex-end!important;align-items:center!important;padding:8px 34px 28px!important;margin:0!important}
.profile-pro-v40522 .profile-actions .primary{height:46px!important;border-radius:14px!important;padding:0 20px!important;display:inline-flex!important;align-items:center!important;gap:8px!important;box-shadow:0 14px 28px rgba(37,99,235,.20)!important;background:linear-gradient(135deg,#2563eb,#06b6d4)!important}
.profile-pro-v40522 .profile-pro-side-card{grid-column:2!important}
.profile-pro-v40522 .profile-card-title{display:flex!important;align-items:flex-start!important;gap:14px!important;margin-bottom:2px!important}
.profile-pro-v40522 .profile-card-icon{display:grid!important;place-items:center!important;width:52px!important;height:52px!important;border-radius:16px!important;background:linear-gradient(135deg,#2563eb,#06b6d4)!important;color:#fff!important;box-shadow:0 14px 28px rgba(37,99,235,.18)!important;flex:0 0 auto!important}
.profile-pro-v40522 .profile-card-title h2{margin:0 0 5px!important;font-size:22px!important;letter-spacing:-.03em!important;color:#0f2142!important}
.profile-pro-v40522 .profile-card-title p{margin:0!important;color:#64748b!important;font-size:13px!important;line-height:1.45!important}
.profile-pro-v40522 .profile-pro-side-card>label{font-size:13px!important;font-weight:900!important;color:#334155!important;margin:2px 0 -8px!important}
.profile-pro-v40522 #passwordForm .profile-actions{padding:4px 0 0!important}
.profile-pro-v40522 .profile-theme-choice{display:grid!important;grid-template-columns:1fr 1fr!important;gap:18px!important}
.profile-pro-v40522 .profile-theme-choice button{min-height:76px!important;border-radius:16px!important;background:#fbfdff!important;border:1px solid #dbe5f3!important;color:#334155!important;box-shadow:none!important;display:grid!important;place-items:center!important;gap:4px!important;font-weight:900!important}
.profile-pro-v40522 .profile-theme-choice button span{font-size:25px!important;line-height:1!important;color:#2563eb!important}
.profile-pro-v40522 .profile-theme-choice button.active{background:linear-gradient(135deg,#f8fbff,#eef7ff)!important;border:2px solid #2563eb!important;color:#2563eb!important;box-shadow:0 14px 28px rgba(37,99,235,.10)!important}
.profile-pro-v40522 .profile-access-card{grid-column:1 / -1!important;grid-row:auto!important}
.profile-pro-v40522 .profile-access-grid{display:grid!important;grid-template-columns:repeat(6,minmax(0,1fr))!important;gap:14px!important}
.profile-pro-v40522 .profile-access-item{min-height:116px!important;border:1px solid #dbe5f3!important;border-radius:16px!important;background:linear-gradient(180deg,#fbfdff,#f8fbff)!important;display:grid!important;place-items:center!important;text-align:center!important;padding:18px 12px!important;gap:8px!important}
.profile-pro-v40522 .profile-access-item .access-icon{display:grid!important;place-items:center!important;width:34px!important;height:34px!important;border-radius:12px!important;color:#2563eb!important;background:#eff6ff!important;border:1px solid #dbeafe!important}
.profile-pro-v40522 .profile-access-item small{font-size:12px!important;font-weight:950!important;text-transform:uppercase!important;letter-spacing:.05em!important;color:#64748b!important}
.profile-pro-v40522 .profile-access-item b{font-size:14px!important;color:#0f2142!important;word-break:break-word!important}
.profile-pro-v40522 .profile-access-item.success b{color:#16a34a!important}
body.dark .profile-pro-v40522 .profile-pro-head h1,body.dark .profile-pro-v40522 .profile-card-title h2,body.dark .profile-pro-v40522 .profile-pro-field,body.dark .profile-pro-v40522 .profile-access-item b{color:#e5e7eb!important}
body.dark .profile-pro-v40522 .profile-pro-head p,body.dark .profile-pro-v40522 .profile-card-title p,body.dark .profile-pro-v40522 .profile-help,body.dark .profile-pro-v40522 .profile-access-item small,body.dark .profile-pro-v40522 .profile-pro-side-card>label{color:#94a3b8!important}
body.dark .profile-pro-v40522 .profile-pro-card,body.dark .profile-pro-v40522 .profile-access-item,body.dark .profile-pro-v40522 .profile-theme-choice button{background:#0f172a!important;border-color:#243244!important;box-shadow:none!important}
body.dark .profile-pro-v40522 .modal-input{background:#111827!important;border-color:#334155!important;color:#e5e7eb!important}
@media(max-width:1120px){.profile-pro-v40522 .profile-pro-grid{grid-template-columns:1fr!important}.profile-pro-v40522 .profile-pro-main,.profile-pro-v40522 .profile-pro-side-card,.profile-pro-v40522 .profile-access-card{grid-column:1!important;grid-row:auto!important}.profile-pro-v40522 .profile-access-grid{grid-template-columns:repeat(3,minmax(0,1fr))!important}}
@media(max-width:720px){.profile-pro-v40522{padding:12px!important}.profile-pro-v40522 .profile-pro-head{flex-direction:column!important}.profile-pro-v40522 .profile-pro-gradient{padding:22px!important;flex-direction:column!important;text-align:center!important}.profile-pro-v40522 .profile-avatar-preview{width:104px!important;height:104px!important;font-size:42px!important}.profile-pro-v40522 .profile-upload-row{justify-content:center!important}.profile-pro-v40522 .profile-pro-fields{padding:22px!important}.profile-pro-v40522 .profile-pro-field{grid-template-columns:1fr!important;gap:8px!important}.profile-pro-v40522 .profile-help{padding-left:0!important}.profile-pro-v40522 .profile-actions{padding:0 22px 22px!important;justify-content:stretch!important}.profile-pro-v40522 .profile-actions .primary{width:100%!important;justify-content:center!important}.profile-pro-v40522 .profile-theme-choice{grid-template-columns:1fr!important}.profile-pro-v40522 .profile-access-grid{grid-template-columns:1fr!important}}


/* v40.5.23 User Profile proportional input typography fix */
.profile-pro-v40522 .profile-pro-field{grid-template-columns:168px minmax(0,1fr)!important;gap:18px!important;font-size:14px!important;}
.profile-pro-v40522 .profile-pro-field span{font-size:14px!important;line-height:1.25!important;}
.profile-pro-v40522 .profile-pro-field span .ui-icon{width:40px!important;height:40px!important;padding:9px!important;border-radius:13px!important;}
.profile-pro-v40522 .modal-input{height:54px!important;min-height:54px!important;padding:0 18px!important;font-size:14px!important;line-height:1.35!important;font-weight:750!important;border-radius:15px!important;}
.profile-pro-v40522 input.modal-input::placeholder{font-size:13px!important;color:#8b9ab1!important;font-weight:700!important;}
.profile-pro-v40522 .profile-pro-side-card>label{font-size:14px!important;margin:6px 0 -6px!important;line-height:1.3!important;}
.profile-pro-v40522 #passwordForm .modal-input{height:56px!important;min-height:56px!important;font-size:15px!important;padding:0 18px!important;}
.profile-pro-v40522 .profile-help{font-size:13px!important;padding-left:186px!important;}
.profile-pro-v40522 .profile-actions .primary{height:50px!important;font-size:14px!important;font-weight:900!important;padding:0 24px!important;}
.profile-pro-v40522 .profile-upload-row small{font-size:12px!important;line-height:1.45!important;}
.profile-pro-v40522 .profile-upload-btn{font-size:13px!important;font-weight:900!important;min-height:46px!important;padding:0 18px!important;}
.profile-pro-v40522 .profile-theme-choice button b{font-size:14px!important;}
@media(max-width:720px){
  .profile-pro-v40522 .profile-pro-field{grid-template-columns:1fr!important;gap:9px!important;}
  .profile-pro-v40522 .modal-input,.profile-pro-v40522 #passwordForm .modal-input{height:52px!important;min-height:52px!important;font-size:14px!important;}
  .profile-pro-v40522 .profile-help{padding-left:0!important;font-size:12px!important;}
}



/* v40.5.25 profile photo in chat and user management */
.avatar-img{width:100%;height:100%;display:block;object-fit:cover;border-radius:inherit}
.avatar-initial{width:100%;height:100%;display:grid;place-items:center;border-radius:inherit}
.chat-row.mine .chat-avatar{display:grid!important;order:2;margin-left:2px;margin-right:0}
.chat-row.theirs .chat-avatar{display:grid!important;order:0;margin-right:2px}
.chat-avatar{overflow:hidden!important;border:1px solid rgba(37,99,235,.18)!important;box-shadow:0 6px 16px rgba(15,23,42,.08)!important;background:linear-gradient(135deg,#2563eb,#06b6d4)!important;color:#fff!important}
.chat-avatar .avatar-img{border-radius:50%!important}
.chat-avatar .avatar-initial{font-size:11px!important;font-weight:900!important;color:#fff!important;background:linear-gradient(135deg,#2563eb,#06b6d4)!important}
.view-admin .um-user-col.user-identity .um-avatar{overflow:hidden!important;border:1px solid rgba(37,99,235,.18)!important;box-shadow:0 8px 20px rgba(37,99,235,.12)!important;background:linear-gradient(135deg,#2563eb,#06b6d4)!important;color:#fff!important}
.view-admin .um-user-col.user-identity .um-avatar .avatar-img{border-radius:50%!important}
.view-admin .um-user-col.user-identity .um-avatar .avatar-initial{font-size:16px!important;font-weight:900!important;color:#fff!important;background:linear-gradient(135deg,#2563eb,#06b6d4)!important}
body.dark .chat-avatar,body.dark .view-admin .um-user-col.user-identity .um-avatar{border-color:rgba(96,165,250,.28)!important;box-shadow:0 8px 22px rgba(0,0,0,.25)!important}



/* v40.5.26 global form typography normalization */
:root{
  --form-font-size:14px;
  --form-label-size:13px;
  --form-helper-size:12px;
  --form-input-height:44px;
  --form-input-padding-x:14px;
  --form-input-radius:13px;
}
input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not(.title-input),
select,
textarea,
.modal-input,
.form-card input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
.form-card select,
.form-card textarea,
.inline-form input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
.inline-form select,
.inline-form textarea,
.search-grid input,
.search-grid select,
.search-grid textarea,
.meta-grid input,
.meta-grid select,
.meta-grid textarea,
.admin-filter-grid input,
.admin-filter-grid select,
.admin-filter-grid textarea,
.view-admin input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
.view-admin select,
.view-admin textarea,
.profile-pro-v40522 .modal-input{
  font-size:var(--form-font-size)!important;
  line-height:1.45!important;
  font-weight:650!important;
  min-height:var(--form-input-height)!important;
  padding:10px var(--form-input-padding-x)!important;
  border-radius:var(--form-input-radius)!important;
  letter-spacing:0!important;
}
select,
.modal-input:is(select),
.profile-pro-v40522 select.modal-input{
  height:var(--form-input-height)!important;
  padding-top:0!important;
  padding-bottom:0!important;
}
textarea,
textarea.modal-input,
.view-admin textarea,
.profile-pro-v40522 textarea.modal-input{
  min-height:96px!important;
  padding-top:12px!important;
  padding-bottom:12px!important;
  line-height:1.55!important;
  resize:vertical!important;
}
input::placeholder,
textarea::placeholder,
.modal-input::placeholder{
  font-size:13px!important;
  font-weight:600!important;
  color:#8a99ad!important;
  opacity:1!important;
}
label,
.modal-grid label,
.modal-label,
.form-card label,
.view-admin label,
.profile-pro-v40522 .profile-pro-field,
.profile-pro-v40522 .profile-pro-side-card>label,
.user-edit-modal-v520 .user-field-v520 label{
  font-size:var(--form-label-size)!important;
  line-height:1.35!important;
  font-weight:850!important;
  letter-spacing:0!important;
}
small,
.muted,
.modal-grid small,
.form-card small,
.view-admin small,
.profile-pro-v40522 .profile-help,
.profile-pro-v40522 .profile-card-title p{
  font-size:var(--form-helper-size)!important;
  line-height:1.5!important;
}
button.primary,
button.secondary,
button.danger,
.primary,
.secondary,
.danger,
.modal-actions .primary,
.modal-actions .secondary,
.modal-actions .danger{
  font-size:13px!important;
  line-height:1.2!important;
}
.title-input{
  font-size:28px!important;
  line-height:1.2!important;
  font-weight:900!important;
}
.profile-pro-v40522 #passwordForm .modal-input,
.profile-pro-v40522 .profile-pro-fields .modal-input{
  height:48px!important;
  min-height:48px!important;
  font-size:14px!important;
  padding:0 16px!important;
}
.profile-pro-v40522 .profile-actions .primary{
  height:46px!important;
  min-height:46px!important;
  font-size:13px!important;
  padding:0 20px!important;
}
.auth-register-side .auth-field input,
.auth-login-side .auth-field input,
.auth-register-side .auth-field,
.auth-login-side .auth-field{
  font-size:14px!important;
  line-height:1.45!important;
}
@media(max-width:720px){
  :root{--form-font-size:14px;--form-label-size:12.5px;--form-input-height:44px;}
  .title-input{font-size:23px!important;}
  .profile-pro-v40522 #passwordForm .modal-input,
  .profile-pro-v40522 .profile-pro-fields .modal-input{height:46px!important;min-height:46px!important;font-size:14px!important;}
}


/* v40.5.27 mail redesign */
.mail-reader-layout-v527{display:grid;grid-template-columns:390px minmax(0,1fr);gap:18px;min-height:calc(100vh - 132px)}
.mail-sidebar-card-v527,.mail-detail-card-v527{border:1px solid var(--border);border-radius:24px;background:var(--panel);box-shadow:0 8px 24px rgba(15,23,42,.04)}
.mail-reader-head-v527{align-items:center;gap:16px;padding-bottom:2px}
.mail-title-block-v527{display:flex;align-items:center;gap:14px;min-width:0}
.mail-title-icon-v527{width:52px;height:52px;border-radius:16px;display:grid;place-items:center;font-size:24px;background:linear-gradient(135deg,#2563eb 0%,#06b6d4 100%);color:#fff;box-shadow:0 10px 24px rgba(37,99,235,.22)}
.mail-title-block-v527 h2{margin:0 0 4px;font-size:28px;line-height:1.05}
.mail-title-block-v527 p{margin:0;font-size:13px;line-height:1.55}
.mail-sync-btn-v527{padding:12px 18px!important;border-radius:14px!important;font-size:14px!important;font-weight:800!important;min-width:124px;box-shadow:0 10px 24px rgba(37,99,235,.18)}
.mail-summary-grid-v527{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;margin:14px 0 10px}
.mail-summary-card-v527{padding:12px 14px;border-radius:16px;background:linear-gradient(180deg,#f8fbff 0%,#f2f7ff 100%);border:1px solid #dbe9ff;display:grid;gap:4px}
.mail-summary-card-v527 span{font-size:12px;font-weight:700;color:#64748b;text-transform:uppercase;letter-spacing:.02em}
.mail-summary-card-v527 b{font-size:22px;line-height:1;color:#14213d}
.mail-tools-row-v527{margin:12px 0 10px;align-items:stretch}
.mail-tools-row-v527 .mail-search-input,.mail-tools-row-v527 .mail-owner-filter{min-height:46px;border-radius:14px;background:var(--soft)}
.mail-filter-tabs-v527{margin:10px 0 14px}
.mail-filter-tabs-v527 .secondary{border-radius:12px;padding:10px 14px;font-weight:700}
.mail-reader-list-v527{max-height:calc(100vh - 360px);padding-right:4px}
.mail-reader-row{border-radius:16px;padding:14px}
.mail-reader-row.active,.mail-reader-row:hover{box-shadow:0 6px 18px rgba(15,23,42,.05)}
.mail-empty-state{padding:28px 18px;background:var(--soft);border-style:solid}
.mail-empty-state h3{margin:0 0 6px;font-size:18px;color:var(--text)}
.mail-empty-state p{margin:0;color:var(--muted);line-height:1.6}
.mail-detail-card-v527{padding:20px 22px}
.mail-detail-head-v527{margin-bottom:0;border-bottom:none;padding-bottom:0}
.mail-detail-title-v527{display:grid;gap:10px;width:100%}
.mail-detail-badges-v527{display:flex;gap:8px;flex-wrap:wrap}
.mail-folder-chip-v527{display:inline-flex;align-items:center;justify-content:center;padding:7px 12px;border-radius:999px;background:#eff6ff;border:1px solid #bfdbfe;color:#1d4ed8;font-weight:800;font-size:12px;letter-spacing:.02em}
.mail-folder-chip-v527.spam{background:#fff7ed;border-color:#fed7aa;color:#c2410c}
.mail-detail-meta-grid-v527{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px 16px;margin-top:2px}
.mail-detail-meta-grid-v527 p{margin:0;display:grid;gap:4px}
.mail-detail-meta-grid-v527 b{font-size:12px;color:#64748b;text-transform:uppercase;letter-spacing:.02em}
.mail-detail-meta-grid-v527 span{font-size:14px;color:var(--text);word-break:break-word}
.mail-detail-actions-v527{padding:16px 0 14px;margin-bottom:14px;border-top:1px solid var(--border);border-bottom:1px solid var(--border)}
.mail-body-v527{padding:18px;border:1px solid var(--border);border-radius:18px;background:linear-gradient(180deg,#fff 0%,#fbfdff 100%);max-height:calc(100vh - 330px)}
.mail-detail-empty{min-height:100%;display:grid;place-items:center;text-align:center;padding:40px 24px}
.mail-empty-illustration{width:72px;height:72px;border-radius:20px;display:grid;place-items:center;font-size:30px;margin:0 auto 12px;background:linear-gradient(135deg,#2563eb 0%,#06b6d4 100%);color:#fff;box-shadow:0 12px 30px rgba(37,99,235,.2)}
.mail-detail-empty h2{margin:0 0 8px}
.mail-detail-empty p{max-width:420px;line-height:1.6}
body.dark .mail-sidebar-card-v527,body.dark .mail-detail-card-v527{box-shadow:none}
body.dark .mail-summary-card-v527{background:rgba(30,41,59,.55);border-color:var(--border)}
body.dark .mail-summary-card-v527 b{color:var(--text)}
body.dark .mail-folder-chip-v527{background:rgba(37,99,235,.16);border-color:rgba(59,130,246,.35);color:#93c5fd}
body.dark .mail-folder-chip-v527.spam{background:rgba(194,65,12,.12);border-color:rgba(251,146,60,.3);color:#fdba74}
body.dark .mail-body-v527{background:rgba(15,23,42,.35)}
@media (max-width:1100px){.mail-reader-layout-v527{grid-template-columns:1fr}.mail-summary-grid-v527{grid-template-columns:repeat(2,minmax(0,1fr))}.mail-reader-list-v527{max-height:320px}.mail-detail-meta-grid-v527{grid-template-columns:1fr}}
@media (max-width:640px){.mail-reader-head-v527{flex-direction:column;align-items:stretch}.mail-title-block-v527{align-items:flex-start}.mail-sync-btn-v527{width:100%}.mail-summary-grid-v527{grid-template-columns:repeat(2,minmax(0,1fr))}.mail-filter-tabs-v527{gap:6px}.mail-filter-tabs-v527 .secondary{flex:1 1 calc(50% - 6px)}.mail-detail-card-v527{padding:16px}.mail-body-v527{padding:14px}}



/* v40.5.28 mail header proportional title fix */
.mail-reader-head-v527{padding:2px 0 6px!important;align-items:center!important}
.mail-title-icon-v527{width:64px!important;height:64px!important;border-radius:20px!important;font-size:30px!important;flex:0 0 64px!important}
.mail-title-block-v527{gap:16px!important;align-items:center!important}
.mail-title-text-v528{display:grid!important;gap:4px!important;min-width:0!important}
.mail-title-kicker-v528{font-size:12px!important;font-weight:900!important;text-transform:uppercase!important;letter-spacing:.12em!important;color:#2563eb!important;line-height:1!important}
.mail-title-block-v527 h2{margin:0!important;font-size:36px!important;line-height:.95!important;letter-spacing:.02em!important;font-weight:950!important;color:var(--text)!important}
.mail-title-block-v527 p{display:none!important}
@media (max-width:640px){
  .mail-reader-head-v527{align-items:stretch!important}
  .mail-title-icon-v527{width:56px!important;height:56px!important;flex-basis:56px!important;font-size:26px!important}
  .mail-title-block-v527 h2{font-size:32px!important}
}



/* v40.5.32 employee preview redesign */
.employee-preview-v532{display:flex;flex-direction:column;gap:18px}
.employee-preview-head-v532{padding:18px 20px;border-radius:22px;background:linear-gradient(135deg,#f8fbff 0%,#eefbf8 100%);border:1px solid #d8e7f7;display:grid;grid-template-columns:minmax(0,1fr) 320px;gap:18px;align-items:center}
.employee-preview-identity-v532{display:flex;align-items:center;gap:16px;min-width:0}
.employee-profile-photo-v532{width:96px;height:96px;border-radius:24px;overflow:hidden;display:grid;place-items:center;background:linear-gradient(135deg,#2563eb 0%,#06b6d4 100%);color:#fff;font-size:42px;font-weight:900;flex:0 0 auto;box-shadow:0 18px 30px rgba(37,99,235,.18)}
.employee-profile-photo-v532 img{width:100%;height:100%;object-fit:cover;display:block}
.employee-preview-title-v532{min-width:0}
.employee-preview-title-v532 h3{margin:0 0 6px;font-size:30px;line-height:1.05;color:#10213d}
.employee-preview-title-v532 p{margin:0 0 10px;color:#64748b;font-size:14px}
.employee-head-badges-v532{display:flex;flex-wrap:wrap;gap:10px}
.employee-status-badge-v532{display:inline-flex;align-items:center;padding:8px 12px;border-radius:999px;background:#d1fae5;color:#0f766e;font-size:12px;font-weight:900;line-height:1.5}
.employee-preview-metrics-v532{display:grid;grid-template-columns:1fr;gap:10px}
.employee-metric-card{padding:14px 16px;border-radius:18px;background:#fff;border:1px solid #dbeafe;display:grid;gap:6px;box-shadow:0 8px 18px rgba(15,23,42,.04)}
.employee-metric-card span{font-size:12px;font-weight:800;text-transform:uppercase;letter-spacing:.04em;color:#64748b}
.employee-metric-card b{font-size:16px;color:#10213d;line-height:1.35;word-break:break-word}
.employee-metric-teal{border-color:#99f6e4;background:#f0fdfa}
.employee-metric-amber{border-color:#fde68a;background:#fffbeb}
.employee-preview-section.v2{padding:18px;border:1px solid #dbe5f3;border-radius:22px;background:linear-gradient(180deg,#ffffff 0%,#fbfdff 100%);box-shadow:0 8px 24px rgba(15,23,42,.035)}
.employee-section-head{display:flex;align-items:flex-start;justify-content:space-between;gap:10px;margin-bottom:14px}
.employee-section-head h4{margin:0 0 4px;font-size:20px;color:#13233f}
.employee-section-head p{margin:0;color:#64748b;font-size:13px;line-height:1.55}
.employee-doc-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}
.employee-doc-card{display:grid;grid-template-columns:140px minmax(0,1fr);gap:14px;padding:14px;border:1px solid #dce9f7;border-radius:18px;background:#fff;min-width:0}
.employee-doc-card.empty{background:#f8fafc;border-style:dashed}
.employee-doc-thumb{display:block;width:140px;height:112px;border-radius:16px;overflow:hidden;background:#eef5ff;border:1px solid #dbeafe;text-decoration:none;color:#2563eb;display:grid;place-items:center;font-size:36px;font-weight:900}
.employee-doc-thumb img{width:100%;height:100%;object-fit:cover;display:block}
.employee-doc-thumb.file{background:linear-gradient(135deg,#eff6ff 0%,#dbeafe 100%)}
.employee-doc-thumb.empty{background:#f8fafc;color:#94a3b8;border-style:dashed}
.employee-doc-info{min-width:0;display:flex;flex-direction:column;gap:6px;justify-content:center}
.employee-doc-info h5{margin:0;font-size:16px;color:#10213d}
.employee-doc-info p{margin:0;color:#64748b;font-size:13px;line-height:1.5}
.employee-doc-info small{color:#64748b;font-size:12px;line-height:1.5}
.employee-doc-actions{display:flex;flex-wrap:wrap;gap:8px;padding-top:4px}
.employee-doc-link,.employee-doc-empty{display:inline-flex;align-items:center;justify-content:center;min-height:40px;padding:0 14px;border-radius:12px;font-size:12px;font-weight:900;text-decoration:none}
.employee-doc-link{background:#eff6ff;color:#2563eb;border:1px solid #bfdbfe}
.employee-read-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
.employee-read-item{padding:14px;border-radius:16px;background:#f8fbff;border:1px solid #dbe7f5}
.employee-read-item span{display:block;font-size:12px;font-weight:800;text-transform:uppercase;letter-spacing:.04em;color:#64748b;margin-bottom:8px}
.employee-read-item b{display:block;font-size:16px;line-height:1.5;color:#10213d;word-break:break-word}
.app-modal-v4045:has(.employee-preview-v532){width:min(1180px,calc(100vw - 32px))!important}
body.dark .employee-preview-head-v532{background:linear-gradient(135deg,#0f172a 0%,#0b2d36 100%);border-color:#203346}
body.dark .employee-preview-title-v532 h3,body.dark .employee-metric-card b,body.dark .employee-section-head h4,body.dark .employee-doc-info h5,body.dark .employee-read-item b{color:#f8fafc}
body.dark .employee-status-badge-v532{background:#083344;color:#99f6e4}
body.dark .employee-metric-card,body.dark .employee-doc-card,body.dark .employee-read-item,body.dark .employee-preview-section.v2{background:rgba(15,23,42,.75);border-color:#243244;box-shadow:none}
body.dark .employee-metric-teal{background:rgba(19,78,74,.45)}
body.dark .employee-metric-amber{background:rgba(120,53,15,.32)}
body.dark .employee-doc-thumb{background:rgba(30,41,59,.75);border-color:#243244}
body.dark .employee-doc-thumb.file{background:rgba(37,99,235,.18)}
body.dark .employee-doc-thumb.empty{background:#111827;color:#64748b;border-color:#334155}
body.dark .employee-doc-info p,body.dark .employee-doc-info small,body.dark .employee-section-head p,body.dark .employee-preview-title-v532 p,body.dark .employee-read-item span,body.dark .employee-metric-card span{color:#94a3b8}
body.dark .employee-doc-link{background:rgba(37,99,235,.14);border-color:rgba(59,130,246,.35);color:#93c5fd}
@media(max-width:980px){.employee-preview-head-v532{grid-template-columns:1fr}.employee-preview-metrics-v532{grid-template-columns:repeat(3,minmax(0,1fr))}.employee-doc-grid{grid-template-columns:1fr}.app-modal-v4045:has(.employee-preview-v532){width:min(980px,calc(100vw - 24px))!important}}
@media(max-width:760px){.employee-preview-identity-v532{flex-direction:column;align-items:flex-start}.employee-preview-title-v532 h3{font-size:24px}.employee-preview-metrics-v532{grid-template-columns:1fr}.employee-doc-card{grid-template-columns:1fr}.employee-doc-thumb{width:100%;height:180px}.employee-read-grid{grid-template-columns:1fr}}



/* v40.8.8 - Floating mini view readability fix
   Mini viewer now follows the same readable typography direction as Reading Mode. */
.floating-note{
  min-width:min(560px,calc(100vw - 24px))!important;
  max-width:calc(100vw - 24px)!important;
  max-height:calc(100vh - 32px)!important;
  border-radius:18px!important;
  box-shadow:0 24px 70px rgba(15,23,42,.22)!important;
}
.floating-head{
  min-height:48px!important;
  padding:12px 14px!important;
}
.floating-head b{
  font-size:14px!important;
  line-height:1.25!important;
  font-weight:900!important;
}
.floating-head button{
  min-width:30px!important;
  height:30px!important;
  display:inline-grid!important;
  place-items:center!important;
}
.floating-body.note-mini-reader-v4088{
  padding:22px 24px!important;
  background:var(--panel)!important;
  color:var(--text)!important;
  font-size:16px!important;
  line-height:1.75!important;
  letter-spacing:normal!important;
  overflow:auto!important;
}
.floating-body.note-mini-reader-v4088 .note-mini-content-v4088,
.floating-body.note-mini-reader-v4088 .note-mini-content-v4088 *{
  font-size:16px!important;
  line-height:1.75!important;
  color:inherit!important;
}
.floating-body.note-mini-reader-v4088 p,
.floating-body.note-mini-reader-v4088 div{
  margin-top:0!important;
  margin-bottom:10px!important;
}
.floating-body.note-mini-reader-v4088 h1{font-size:28px!important;line-height:1.25!important;margin:0 0 16px!important;}
.floating-body.note-mini-reader-v4088 h2{font-size:24px!important;line-height:1.3!important;margin:0 0 14px!important;}
.floating-body.note-mini-reader-v4088 h3{font-size:20px!important;line-height:1.35!important;margin:0 0 12px!important;}
.floating-body.note-mini-reader-v4088 ul,
.floating-body.note-mini-reader-v4088 ol{
  padding-left:24px!important;
  margin:10px 0 14px!important;
}
.floating-body.note-mini-reader-v4088 li{
  margin:4px 0!important;
}
.floating-body.note-mini-reader-v4088 table{
  width:100%!important;
  border-collapse:collapse!important;
  margin:12px 0!important;
  font-size:14px!important;
}
.floating-body.note-mini-reader-v4088 td,
.floating-body.note-mini-reader-v4088 th{
  border:1px solid var(--border)!important;
  padding:8px 10px!important;
  vertical-align:top!important;
}
.floating-body.note-mini-reader-v4088 img{
  max-width:100%!important;
  height:auto!important;
  border-radius:12px!important;
}
.floating-body.note-mini-reader-v4088 pre{
  white-space:pre-wrap!important;
  font-family:inherit!important;
  font-size:15px!important;
  line-height:1.7!important;
}
body.dark .floating-body.note-mini-reader-v4088{
  background:var(--panel)!important;
  color:var(--text)!important;
}
@media(max-width:720px){
  .floating-note{left:10px!important;right:10px!important;width:auto!important;min-width:0!important;}
  .floating-body.note-mini-reader-v4088{padding:18px!important;font-size:15px!important;}
  .floating-body.note-mini-reader-v4088 .note-mini-content-v4088,
  .floating-body.note-mini-reader-v4088 .note-mini-content-v4088 *{font-size:15px!important;line-height:1.7!important;}
}
