/* Taskly v12: distinct team/personal navigation and iOS-inspired *light* glass only.
   Dark glass intentionally inherits all v11 values unchanged. */

/* 1. Reposition sidebar collapse INSIDE the sidebar and reverse direction. */
.sidebar #collapseSidebar,
.sidebar-collapsed .sidebar #collapseSidebar {
  top:21px!important;left:12px!important;right:auto!important;
  margin:0!important;width:35px!important;height:35px!important;
  z-index:51!important;transform:none!important;
  border-radius:11px!important;
  display:grid;place-items:center;
}
.sidebar #collapseSidebar .collapse-direction {transform:rotate(-90deg)!important;transition:transform .28s ease!important;}
.sidebar-collapsed .sidebar #collapseSidebar{top:83px!important;left:19px!important;}
.sidebar-collapsed .sidebar #collapseSidebar .collapse-direction{transform:rotate(90deg)!important;}
.sidebar #collapseSidebar:hover{transform:none!important;}
@media(max-width:780px){.sidebar #collapseSidebar,.sidebar-collapsed .sidebar #collapseSidebar{display:none!important;}}

/* 2. Two independently visible workspaces, without shared action controls. */
body[data-space="team"] .personal-only-control,
body[data-space="personal"] .team-only-control {display:none!important;}
body[data-space="team"] #personalNavigation,
body[data-space="personal"] #teamNavigation {display:none!important;}
.workspace-segment{
  display:grid;grid-template-columns:1fr 1fr;gap:5px;margin:2px 0 22px;
  padding:5px;border-radius:14px;min-width:0;
}
.workspace-segment-btn{
  border:1px solid transparent;border-radius:10px;padding:9px 7px;min-height:39px;
  font:inherit;font-size:12px;font-weight:800;line-height:1.4;
  transition:background .25s,border-color .25s,color .25s,box-shadow .25s;
}
html[data-theme="dark"] .workspace-segment{background:#11182a;border:1px solid #26304b;}
html[data-theme="dark"] .workspace-segment-btn{background:transparent;color:#aebbd4;}
html[data-theme="dark"] .workspace-segment-btn.selected{background:linear-gradient(135deg,#4532d7,#5e4af0);border-color:#7a6af5;color:#fff;box-shadow:inset 0 1px 0 #ffffff2a,0 5px 16px #4f39f628;}
html[data-theme="light"] .workspace-segment{background:#eff2fa;border:1px solid #e4e8f5;}
html[data-theme="light"] .workspace-segment-btn{background:transparent;color:#64738f;}
html[data-theme="light"] .workspace-segment-btn.selected{background:#fff;color:#4f39e2;border-color:#e6e7fa;box-shadow:0 4px 14px #26365c13;}

#personalNavigation{display:flex;flex-direction:column;gap:10px;min-height:0;}
#personalNavigation .personal-all-link{display:flex;gap:10px;align-items:center;min-height:43px;}
#personalNavigation .personal-all-link .nav-count{margin-inline-start:auto;}
.project-tree-heading{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:13px 6px 8px;margin-top:4px;}
.project-tree-heading>div{display:flex;align-items:center;gap:9px;min-width:0;font-size:12px;}
.project-tree-heading svg{width:17px;height:17px;}
.project-add-btn{display:grid;place-items:center;flex:none;width:30px;height:30px;border-radius:10px;border:1px solid transparent;background:transparent;color:inherit;transition:background .2s ease;}
.project-add-btn svg{height:16px;width:16px;}
.project-tree{display:flex;flex-direction:column;gap:5px;padding-inline-start:7px;}
.project-tree-item{display:flex;align-items:center;gap:9px;width:100%;padding:11px 9px 11px 10px;border-radius:11px;border:1px solid transparent;background:transparent;min-width:0;text-align:right;font-size:11.5px;font-weight:700;line-height:1.5;position:relative;}
.project-tree-rail{position:absolute;inset-inline-start:-8px;top:0;bottom:0;border-inline-start:1px solid currentColor;opacity:.13;pointer-events:none;}
.project-tree-folder{width:17px;height:17px;flex:none;}
.project-tree-name{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.project-tree-count{border-radius:8px;padding:2px 6px;line-height:1.3;font-weight:800;font-size:10px;}
.project-tree-item:hover{transform:none!important;}
.project-tree-empty{display:grid;justify-items:center;gap:4px;padding:18px 9px;text-align:center;border-radius:14px;font-size:11px;}
.project-tree-empty svg{height:24px;width:24px;opacity:.65;}
.project-tree-empty p{margin:3px 0 0;font-weight:800;}
.project-tree-empty small{opacity:.75;line-height:1.8;}
html[data-theme="dark"] .project-tree-heading{color:#d6def3;}
html[data-theme="dark"] .project-add-btn{background:#1e2844;border-color:#344362;color:#cfcaff;}
html[data-theme="dark"] .project-add-btn:hover{background:#30275c;border-color:#6957ba;color:white;}
html[data-theme="dark"] .project-tree-item{color:#b8c4df;}
html[data-theme="dark"] .project-tree-item:hover{background:#1c2540;color:#eef0ff;}
html[data-theme="dark"] .project-tree-item.active{background:linear-gradient(125deg,#373073,#2d2854);border-color:#6259a0;color:#f5f4ff;box-shadow:inset 3px 0 0 #8172fb;}
html[data-theme="dark"] .project-tree-count{background:#252d47;color:#cbc7ff;}
html[data-theme="dark"] .project-tree-empty{background:#151d34;border:1px dashed #34405c;color:#c0c9e0;}
html[data-theme="light"] .project-tree-heading{color:#495879;}
html[data-theme="light"] .project-add-btn{background:#f5f4ff;border-color:#dedafb;color:#513fea;}
html[data-theme="light"] .project-add-btn:hover{background:#ebe8ff;color:#4934de;}
html[data-theme="light"] .project-tree-item{color:#5f6e8d;}
html[data-theme="light"] .project-tree-item:hover{background:#f2f3fe;color:#4235b8;}
html[data-theme="light"] .project-tree-item.active{background:#eeebff;border-color:#d8d1ff;color:#4430c9;box-shadow:inset 3px 0 0 #6651f8;}
html[data-theme="light"] .project-tree-count{background:#f0f1f9;color:#6558ae;}
html[data-theme="light"] .project-tree-empty{background:#f9faff;border:1px dashed #d8dfef;color:#556788;}

.inline-project-form{display:grid;gap:8px;padding:12px;border-radius:14px;min-width:0;}
.inline-project-form label{font-size:11px;font-weight:800;}
.inline-project-form input{width:100%;min-width:0;border-radius:9px;border:1px solid;outline:0;padding:10px;font-size:12px;}
.inline-project-actions{display:grid;grid-template-columns:1fr 1fr;gap:6px;}
.inline-project-actions button{border:1px solid transparent;border-radius:9px;min-height:33px;font-weight:800;font-size:11px;padding:6px 4px;}
.inline-project-save{background:linear-gradient(125deg,#4f39f6,#725ff7);color:white;}
.inline-project-error{font-size:11px;color:#e45d6b;min-height:0;line-height:1.6;}
html[data-theme="dark"] .inline-project-form{background:#161e35;border:1px solid #364160;color:#e4e9fa;}
html[data-theme="dark"] .inline-project-form input{background:#10182b;border-color:#465171;color:#f4f6ff;}
html[data-theme="dark"] .inline-project-cancel{background:#283149;color:#dce3f7;}
html[data-theme="light"] .inline-project-form{background:#f8f9ff;border:1px solid #dce2f4;color:#374361;}
html[data-theme="light"] .inline-project-form input{background:#fff;border-color:#d8deee;color:#293957;}
html[data-theme="light"] .inline-project-cancel{background:#edf0f8;color:#52637e;}
.personal-secure-label{display:inline-flex;align-items:center;gap:5px;font-size:11px;font-weight:800;border-radius:999px;padding:7px 10px;white-space:nowrap;}
.personal-secure-label svg{width:14px;height:14px;}
html[data-theme="dark"] .personal-secure-label{background:#1e4139;color:#a1efd8;}
html[data-theme="light"] .personal-secure-label{background:#e5f6ef;color:#0c8061;}
body[data-space="personal"] .personal-toolbar{margin-top:16px;}

@media(min-width:781px){
  .sidebar-collapsed .workspace-segment{grid-template-columns:1fr;gap:4px;padding:3px;margin-bottom:14px;}
  .sidebar-collapsed .workspace-segment-btn{font-size:10px;padding:9px 0;min-height:33px;}
  .sidebar-collapsed #personalNavigation .personal-all-link{justify-content:center;font-size:0!important;padding:10px 3px;}
  .sidebar-collapsed #personalNavigation .personal-all-link>span{display:none!important;}
  .sidebar-collapsed .project-tree-heading{padding:5px 0;justify-content:center;}
  .sidebar-collapsed .project-tree-heading>div{display:none!important;}
  .sidebar-collapsed .project-tree-item{justify-content:center;padding:11px 0;gap:0;}
  .sidebar-collapsed .project-tree-item .project-tree-name,
  .sidebar-collapsed .project-tree-item .project-tree-count,
  .sidebar-collapsed .project-tree-item .project-tree-rail{display:none!important;}
  .sidebar-collapsed .inline-project-form{display:none!important;}
  .sidebar-collapsed .project-tree-empty{padding:8px 3px;}
  .sidebar-collapsed .project-tree-empty p,.sidebar-collapsed .project-tree-empty small{display:none;}
}
@media(max-width:780px){
  .workspace-segment{margin-top:12px;}
  #personalNavigation .project-tree{max-height:35dvh;overflow:auto;}
  .personal-secure-label{font-size:10px;padding:5px 8px;}
}

/* 3. LIGHT only: legible, milky iOS frosted glass instead of violet haze. */
html[data-theme="light"] .topbar-popover-wrap .glass-popover{
  background:rgba(249,251,255,.86)!important;
  background-image:linear-gradient(145deg,rgba(255,255,255,.45),rgba(238,244,255,.09))!important;
  border:1px solid rgba(255,255,255,.96)!important;
  color:#24314c!important;
  backdrop-filter:blur(30px) saturate(135%)!important;
  -webkit-backdrop-filter:blur(30px) saturate(135%)!important;
  box-shadow:0 18px 52px rgba(26,37,65,.18),inset 0 1px 0 rgba(255,255,255,1),inset 0 -1px 0 rgba(207,219,240,.62)!important;
}
html[data-theme="light"] .topbar-popover-wrap .glass-popover::before{
  background:linear-gradient(180deg,rgba(255,255,255,.52),rgba(255,255,255,0) 90%)!important;
  height:30%;
}
html[data-theme="light"] .glass-popover-head{border-color:rgba(177,187,207,.4)!important;color:#23314d!important;}
html[data-theme="light"] .notice-item{
  background:rgba(255,255,255,.82)!important;
  border:1px solid rgba(214,223,238,.88)!important;
  box-shadow:0 1px 3px rgba(39,57,88,.055)!important;
  color:#2e3d5a!important;
}
html[data-theme="light"] .notice-item:hover{background:#fff!important;border-color:#c8d4ee!important;}
html[data-theme="light"] #profilePanel .profile-note,
html[data-theme="light"] #profilePanel .profile-head small{color:#596780!important;opacity:1!important;}
html[data-theme="light"] .space-btn:not(.active){
  background:#fff!important;border:1px solid #dce4f3!important;color:#354769!important;
  box-shadow:0 1px 4px rgba(39,57,88,.05)!important;
}
html[data-theme="light"] .profile-logout{
  background:#eff2fa!important;color:#35415e!important;border-color:#dce4f2!important;
}
html[data-theme="light"] .mini-link{color:#586981!important;opacity:1!important;}
html[data-theme="light"] .glass-empty{color:#60718c!important;opacity:1!important;}
@media(prefers-reduced-motion:reduce){.workspace-segment-btn,.project-tree-item,.project-add-btn{transition:none!important;}}
/* Mobile sidebar must sit above the sticky topbar, including its close button. */
@media(max-width:780px){
 .sidebar.open{z-index:91!important;}
 .sidebar-backdrop.open{z-index:80!important;}
 .sidebar .mobile-close{position:relative;z-index:93!important;}
}
