/* ===== DASHBOARD SHELL ===== */
.dashboard{display:none;flex-direction:row;min-height:100vh}

/* ===== CLOCK POSITIONS (all hidden by default, toggled by setting) ===== */
/* A: Sidebar footer */
.clock-sidebar-footer{
  display:none;
  flex-direction:column;justify-content:center;align-items:center;
  text-align:center;
  padding:8px 10px;
  /* min-height locks the wrapper so the profile + nav above don't jump
     when the date appears/disappears on hover. Equals the natural height
     when both time + date render. */
  min-height:52px;
  border-top:1px solid rgba(255,255,255,.06);
  flex-shrink:0;
}
.clock-sf-time{font-family:var(--fd);font-size:1.1rem;font-weight:500;color:rgba(255,255,255,.7);line-height:1;letter-spacing:-.01em}
.clock-sf-date{font-size:9px;color:rgba(255,255,255,.3);letter-spacing:.5px;margin-top:3px}
/* Date overflows the 56px collapsed bar — drop it from layout when
   collapsed so the time alone is vertically centred (justify-content:
   center on the flex wrapper). The wrapper's min-height keeps the
   total area constant so nothing above shifts on hover. */
.sidebar:not(.open) .clock-sf-date{display:none}
body[data-clock="sidebar-footer"] .clock-sidebar-footer{display:flex}

/* B: Floating pill bottom-right */
.clock-float{
  display:none;position:fixed;bottom:20px;right:20px;z-index:150;
  background:var(--card);border:1px solid var(--border);
  border-radius:var(--r5);padding:8px 16px;
  box-shadow:var(--sh2);text-align:center;
  backdrop-filter:blur(20px);
}
body.dark-mode .clock-float{background:rgba(11,26,42,.85);border-color:rgba(255,255,255,.1)}
.clock-float-time{font-family:var(--fd);font-size:1rem;font-weight:500;color:var(--t1);line-height:1}
.clock-float-date{font-size:9px;color:var(--t3);margin-top:2px;letter-spacing:.3px}
body[data-clock="floating"] .clock-float{display:block}

/* C: Sidebar logo area */
.clock-sidebar-logo{
  display:none;margin-left:auto;
  font-family:var(--fd);font-size:11px;font-weight:500;
  color:rgba(255,255,255,.4);white-space:nowrap;
}
.sidebar.open .clock-sidebar-logo span{opacity:1}
body[data-clock="sidebar-logo"] .clock-sidebar-logo{display:flex;align-items:center}
body:not([data-clock="sidebar-logo"]) .clock-sidebar-logo{display:none!important}

/* E: Content top-right */
.clock-topright{
  display:none;position:fixed;top:14px;right:24px;z-index:150;
  font-family:var(--fd);
  text-align:right;
}
.clock-topright-time{font-size:1rem;font-weight:500;color:var(--t2);letter-spacing:-.01em}
.clock-topright-date{font-size:9px;color:var(--t3);margin-left:8px;letter-spacing:.3px}
body[data-clock="content-topright"] .clock-topright{display:block}

@media(max-width:768px){
  .clock-sidebar-footer,.clock-sidebar-logo{display:none!important}
  body[data-clock="floating"] .clock-float{bottom:68px}
  body[data-clock="content-topright"] .clock-topright{top:8px;right:12px}
  .clock-topright-time{font-size:.85rem}
}

/* ===== CUSTOM THEME EDITOR — floating panel (immune to theme changes) ===== */
.cte-panel{
  display:none;position:fixed;top:50%;right:20px;z-index:26000;
  transform:translateY(-50%);
  width:260px;max-height:80vh;
  background:#1a1a2e;border:1px solid rgba(255,255,255,.12);
  border-radius:16px;
  box-shadow:0 24px 60px rgba(0,0,0,.45),0 8px 20px rgba(0,0,0,.25);
  flex-direction:column;overflow:hidden;
  animation:fadeInUp .3s cubic-bezier(.4,0,.2,1);
  color:#e0e0e8;font-family:'Outfit',sans-serif;
}
.cte-panel.open{display:flex}
.cte-header{
  padding:12px 16px;border-bottom:1px solid rgba(255,255,255,.08);
  display:flex;align-items:center;gap:8px;flex-shrink:0;
  background:rgba(255,255,255,.03);
}
.cte-header h3{font-family:'Plus Jakarta Sans',sans-serif;font-size:1rem;font-weight:600;color:#fff;flex:1}
.cte-close{
  background:none;border:none;color:rgba(255,255,255,.4);
  font-size:18px;cursor:pointer;padding:0 2px;line-height:1;
  transition:color .15s;
}
.cte-close:hover{color:#fff}
.cte-body{padding:10px 14px;overflow-y:auto;overflow-x:hidden;flex:1;min-height:0}
.cte-body::-webkit-scrollbar{width:4px}
.cte-body::-webkit-scrollbar-thumb{background:rgba(255,255,255,.12);border-radius:4px}
.cte-group{margin-bottom:12px}
.cte-group:last-child{margin-bottom:0}
.cte-group-label{
  font-size:8px;font-weight:700;text-transform:uppercase;
  letter-spacing:1.5px;color:#c4a24e;margin-bottom:6px;
  cursor:pointer;display:flex;align-items:center;gap:6px;
}
.cte-group-label::before{content:'›';font-size:12px;transition:transform .2s;display:inline-block}
.cte-group.open .cte-group-label::before{transform:rotate(90deg)}
.cte-group-items{display:none;flex-direction:column;gap:4px}
.cte-group.open .cte-group-items{display:flex}
.cte-item{
  display:flex;align-items:center;gap:8px;
  padding:5px 8px;background:rgba(255,255,255,.04);
  border:1px solid rgba(255,255,255,.08);border-radius:6px;
}
.cte-label{font-size:10px;font-weight:600;color:rgba(255,255,255,.6);flex:1;min-width:0;line-height:1.3;word-break:break-word}
.cte-color{
  width:24px;height:24px;border:2px solid rgba(255,255,255,.15);
  border-radius:6px;cursor:pointer;padding:0;
  background:none;-webkit-appearance:none;appearance:none;flex-shrink:0;
}
.cte-color::-webkit-color-swatch-wrapper{padding:0}
.cte-color::-webkit-color-swatch{border:none;border-radius:3px}
.cte-hex{
  width:62px;padding:3px 5px;font-size:10px;font-family:monospace;
  background:rgba(255,255,255,.06);border:1px solid rgba(255,255,255,.1);
  border-radius:4px;color:#e0e0e8;outline:none;
}
.cte-hex:focus{border-color:#c4a24e}
.cte-reset{
  background:none;border:none;color:rgba(255,255,255,.25);
  font-size:11px;cursor:pointer;padding:2px;line-height:1;
  transition:color .15s;flex-shrink:0;
}
.cte-reset:hover{color:#c4a24e}
/* Color picker inline close button */
.cte-item{position:relative}
.cte-picker-x{
  display:none;position:absolute;top:-6px;right:-6px;z-index:2;
  width:18px;height:18px;border-radius:50%;
  background:#ff453a;border:2px solid #1a1a2e;
  color:#fff;font-size:10px;line-height:1;
  cursor:pointer;align-items:center;justify-content:center;
}
.cte-picker-x.show{display:flex}
.cte-footer{
  padding:10px 14px;border-top:1px solid rgba(255,255,255,.08);
  display:flex;gap:6px;flex-shrink:0;
  background:rgba(255,255,255,.02);
}
.cte-footer button{
  flex:1;padding:8px;border-radius:8px;
  font-size:11px;font-weight:700;font-family:'Outfit',sans-serif;
  cursor:pointer;transition:all .2s;border:none;
}
.cte-btn-save{background:#c4a24e;color:#1a1a2e}
.cte-btn-save:hover{background:#d4b462}
.cte-btn-cancel{background:rgba(255,255,255,.06);color:rgba(255,255,255,.5);border:1px solid rgba(255,255,255,.1)!important}
.cte-btn-cancel:hover{background:rgba(255,255,255,.1);color:#fff}
.cte-panel #cteNameInput{
  background:rgba(255,255,255,.06);border:1px solid rgba(255,255,255,.1);
  color:#e0e0e8;border-radius:6px;font-family:'Outfit',sans-serif;
}
.cte-panel #cteNameInput::placeholder{color:rgba(255,255,255,.25)}
.cte-panel #cteNameInput:focus{border-color:#c4a24e;outline:none}
@media(max-width:768px){
  .cte-panel{right:10px;left:10px;width:auto;max-height:60vh;top:auto;bottom:66px;transform:none}
}

/* ===== USER PHOTO (shared) ===== */
.user-photo{
  width:36px;height:36px;border-radius:50%;
  background:color-mix(in srgb,var(--avatar-color) 12%,transparent);
  border:2px solid var(--avatar-color);
  display:flex;align-items:center;justify-content:center;
  font-size:11px;font-weight:800;color:var(--avatar-color);
  flex-shrink:0;letter-spacing:.5px;
  cursor:pointer;position:relative;overflow:hidden;
  transition:border-color .2s,box-shadow .2s;
  background-size:cover;background-position:center;
}
.user-photo:hover{border-color:color-mix(in srgb,var(--avatar-color),white 20%);box-shadow:0 0 0 3px color-mix(in srgb,var(--avatar-color) 20%,transparent)}
.user-photo:hover::after{
  content:'📷';position:absolute;inset:0;
  background:rgba(0,0,0,.45);
  display:flex;align-items:center;justify-content:center;font-size:12px;
}
#photoInput{display:none}
.role-value-new{color:var(--gold);font-weight:800}

/* ===== AVATAR PICKER POPUP ===== */
.avatar-picker-overlay{
  position:fixed;inset:0;z-index:9999;
  background:rgba(11,26,42,.4);
  display:flex;align-items:center;justify-content:center;
  opacity:0;transition:opacity .2s var(--ease);
}
.avatar-picker-overlay.show{opacity:1}
.avatar-picker{
  background:var(--card);border-radius:var(--r3);
  padding:20px;width:280px;max-width:90vw;
  box-shadow:0 12px 40px rgba(11,26,42,.18);
  border:1px solid var(--border);
}
.avatar-picker h4{
  margin:0 0 14px;font-family:var(--fs);font-size:16px;font-weight:600;color:var(--t1);
  text-align:center;
}
.avatar-picker-grid{
  display:grid;grid-template-columns:repeat(4,1fr);gap:10px;
  margin-bottom:16px;
}
.avatar-picker-item{
  width:100%;aspect-ratio:1;border-radius:50%;
  cursor:pointer;border:2px solid var(--border);
  overflow:hidden;transition:border-color .15s,transform .15s,box-shadow .15s;
  background:#fff;
}
.avatar-picker-item:hover{
  border-color:var(--gold);transform:scale(1.1);
  box-shadow:0 2px 8px rgba(196,162,78,.3);
}
.avatar-picker-item img{width:100%;height:100%;display:block}
.avatar-picker-actions{
  display:flex;gap:8px;
}
.avatar-picker-actions button{
  flex:1;padding:8px 0;border-radius:var(--r1);font-family:var(--f);
  font-size:12px;font-weight:600;cursor:pointer;transition:background .15s,color .15s;
  border:none;
}
.avatar-picker-upload{
  background:var(--gold);color:#fff;
}
.avatar-picker-upload:hover{background:var(--gold-l)}
.avatar-picker-remove{
  background:var(--surface);color:var(--t2);
}
.avatar-picker-remove:hover{background:var(--surface-alt)}
.avatar-picker-cancel{
  background:transparent;color:var(--t3);border:1px solid var(--border) !important;
}
.avatar-picker-cancel:hover{background:var(--surface)}

/* ===== SIDEBAR USER PROFILE ===== */
.sidebar-user{
  display:flex;align-items:center;gap:10px;
  /* padding:12px 11px — 11px horizontal so the 34px user photo centres
     in the 56px collapsed bar (11 + 17 = 28). Stays put on hover. */
  padding:12px 11px;
  border-top:1px solid rgba(255,255,255,.06);
  flex-shrink:0;
}
.sidebar-user .user-photo{width:34px;height:34px;font-size:10px}
.sidebar-user-info{
  display:flex;flex-direction:column;min-width:0;
  opacity:0;transition:opacity .2s var(--ease);
}
.sidebar.open .sidebar-user-info{opacity:1}
.sidebar-user-name{
  font-size:12px;font-weight:600;color:rgba(255,255,255,.85);margin:0;
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
}
.sidebar-user-role{
  font-size:9px;color:rgba(255,255,255,.35);text-transform:uppercase;
  letter-spacing:1.5px;margin-top:1px;font-weight:600;
}
.sidebar-user-role .role-value-new{color:var(--gold);font-weight:700}

/* ===========================
   PILL TAB NAVIGATION
   =========================== */
/* ===== SIDEBAR NAVIGATION ===== */
/* .dashboard flex layout now merged into earlier rule */

.sidebar{
  position:fixed;top:0;left:0;bottom:0;
  width:var(--sidebar-w);
  background:var(--sidebar-bg);
  backdrop-filter:blur(28px) saturate(1.4);
  -webkit-backdrop-filter:blur(28px) saturate(1.4);
  border-right:1px solid rgba(255,255,255,.08);
  display:flex;flex-direction:column;
  z-index:200;
  transition:width .28s var(--ease);
  overflow:hidden;
}
.sidebar.open{width:var(--sidebar-w-open)}

/* Hover-to-expand: when body.sidebar-hover-expand is set, hovering the
   sidebar widens it and reveals labels — same visual end state as
   .sidebar.open. Disabled on touch devices and on the mobile bottom-bar
   layout. The manual toggle (clicking the logo) still pins it open.
   Icon position does NOT change between collapsed and expanded — the
   layout is identical, only the sidebar's width and the label's opacity
   transition. This avoids the icon jitter that conditional padding/gap
   rules would introduce on hover. */
@media(hover:hover) and (min-width:769px) {
  body.sidebar-hover-expand .sidebar:hover{width:var(--sidebar-w-open)}
  body.sidebar-hover-expand .sidebar:hover .sidebar-label,
  body.sidebar-hover-expand .sidebar:hover .sidebar-logo-text,
  body.sidebar-hover-expand .sidebar:hover .sidebar-section-label,
  body.sidebar-hover-expand .sidebar:hover .sidebar-user-info,
  body.sidebar-hover-expand .sidebar:hover .clock-sidebar-logo span{opacity:1}
  body.sidebar-hover-expand .sidebar:hover .clock-sf-date{display:block}
}

.sidebar-logo{
  display:flex;align-items:center;gap:10px;
  padding:16px 14px;
  border-bottom:1px solid rgba(255,255,255,.06);
  min-height:58px;
  flex-shrink:0;
  position:relative;
  overflow:hidden;
}
/* In hover-expand mode the logo click is a no-op (toggleSidebar bails) —
   override the inline cursor:pointer so the cursor doesn't mislead. */
body.sidebar-hover-expand .sidebar-logo{cursor:default!important}
.sidebar-logo img{
  width:28px;height:28px;object-fit:contain;
  filter:brightness(10);opacity:.8;flex-shrink:0;
}
.sidebar-logo-text{
  display:flex;flex-direction:column;
  white-space:nowrap;opacity:0;
  transition:opacity .2s var(--ease);
  min-width:0;
}
.sidebar-logo-text span{
  font-family:var(--fs);font-size:17px;font-weight:400;
  color:#fff;letter-spacing:4px;text-transform:uppercase;
  line-height:1.1;
}
.sidebar-logo-text small{
  font-family:var(--f);font-size:8px;font-weight:600;
  color:rgba(255,255,255,.35);letter-spacing:2px;text-transform:uppercase;
  line-height:1;margin-top:2px;
}
.sidebar.open .sidebar-logo-text{opacity:1}

.sidebar-nav{
  flex:1;overflow-y:auto;overflow-x:hidden;min-height:0;
  padding:8px 0;
  scrollbar-width:none;
}
.sidebar-nav::-webkit-scrollbar{display:none}
/* padding:0 4px — combined with the .sidebar-btn's padding-left:14 and
   icon-width:20, this puts the icon's center at exactly sidebar-width/2
   (4 + 14 + 10 = 28 = 56/2). Stays put when the sidebar widens on hover
   so icons don't jitter. */
.sidebar-nav ul{list-style:none;display:flex;flex-direction:column;gap:2px;padding:0 4px}
/* Keep old IDs working */
.nav-tabs{list-style:none;display:flex;flex-direction:column;gap:2px;padding:0 4px}
.nav-tab{display:block}

.sidebar-btn{
  display:flex;align-items:center;gap:12px;
  width:100%;padding:10px 14px;
  background:none;border:none;
  border-radius:var(--r1);
  color:var(--sidebar-text);
  font-size:13px;font-family:var(--f);font-weight:500;
  cursor:pointer;white-space:nowrap;
  transition:color .18s,background .18s;
  position:relative;
}
.sidebar-btn i{
  width:20px;text-align:center;font-size:15px;flex-shrink:0;
  transition:color .18s;
}
.sidebar-btn .sidebar-label{
  opacity:0;transition:opacity .2s var(--ease);
  overflow:hidden;text-overflow:ellipsis;
}
.sidebar.open .sidebar-label{opacity:1}

.sidebar-btn:hover{color:var(--sidebar-text-hover);background:rgba(255,255,255,.06)}
.sidebar-btn.active{
  color:var(--sidebar-active);background:var(--sidebar-active-bg);
}
.sidebar-btn.active i{color:var(--sidebar-active)}
.sidebar-btn.active::before{
  content:'';position:absolute;left:0;top:50%;transform:translateY(-50%);
  width:3px;height:20px;background:var(--sidebar-active);border-radius:0 3px 3px 0;
}

/* Sidebar badges */
.sidebar-badge{
  position:absolute;top:6px;right:8px;
  min-width:16px;height:16px;
  background:var(--red);color:#fff;
  font-size:9px;font-weight:700;
  border-radius:8px;
  display:flex;align-items:center;justify-content:center;
  padding:0 4px;
  line-height:1;
}
.sidebar-badge.warn{background:var(--amber)}
.sidebar-badge.doc{background:var(--blue)}

.sidebar-section-label{
  font-size:9px;font-weight:600;letter-spacing:2px;text-transform:uppercase;
  color:rgba(255,255,255,.2);padding:16px 14px 6px;
  white-space:nowrap;
  opacity:0;transition:opacity .2s var(--ease);
}
.sidebar.open .sidebar-section-label{opacity:1}

.sidebar-footer{
  border-top:1px solid rgba(255,255,255,.06);
  /* padding:8px 4px — same 4px horizontal as .sidebar-nav ul so the
     Settings / Logout icons sit on the same vertical line as the nav
     icons above them. */
  padding:8px 4px;flex-shrink:0;
  display:flex;flex-direction:column;gap:2px;
  overflow:hidden;
}
.sidebar-footer .sidebar-btn{
  color:var(--sidebar-text);font-size:12px;
}
.sidebar-footer .sidebar-btn:hover{color:var(--sidebar-text-hover)}

/* Sidebar toggle button */
.sidebar-toggle{
  position:fixed;top:12px;left:12px;z-index:210;
  width:36px;height:36px;
  background:var(--sidebar-bg);border:1px solid rgba(255,255,255,.1);
  border-radius:var(--r1);
  color:rgba(255,255,255,.6);font-size:16px;
  cursor:pointer;
  display:flex;align-items:center;justify-content:center;
}

/* ===== DASHBOARD MAIN =====
   height:100vh (not min-height) pins this exactly to the viewport so
   the body NEVER scrolls — only .dashboard-main itself does when a
   tab's content is taller than the available space. This prevents
   phantom body scrollbars caused by sub-pixel overflow, the fadeInUp
   animation briefly pushing content past the viewport, or any child
   element forcing the body 1-2 px taller than 100vh. Tabs that need
   to scroll still scroll normally — the scroll context just lives on
   .dashboard-main instead of on body. min-height:0 is required on
   the flex column so .dashboard-content inside can shrink to allow
   overflow-y:auto to take effect (classic flex-scroll pattern). */
.dashboard-main{
  flex:1;margin-left:var(--sidebar-w);
  transition:margin-left .28s var(--ease);
  height:100vh;min-height:0;
  display:flex;flex-direction:column;
  overflow-y:auto;
}
.sidebar.open ~ .dashboard-main{margin-left:var(--sidebar-w-open)}

/* ===== CONTENT AREA ===== */
.dashboard-content{padding:24px 10px;max-width:1440px;margin:0 auto;width:100%;flex:1;min-height:0}
.tab-content{display:none;animation:fadeInUp .28s var(--ease)}
.tab-content.active{display:block}

/* ===== MOBILE: sidebar → bottom bar ===== */
@media(max-width:768px){
  .sidebar{
    position:fixed;top:auto;bottom:0;left:0;right:0;
    width:100%!important;height:56px;
    flex-direction:row;border-right:none;
    border-top:1px solid rgba(255,255,255,.1);
    overflow:visible;
  }
  .sidebar.open{width:100%!important}
  .sidebar-logo,.sidebar-section-label,.sidebar-user{display:none}
  .sidebar-footer{display:flex;flex-direction:row;gap:0;padding:0;border-top:none;position:static;width:auto}
  .sidebar-footer button{font-size:18px;padding:8px 14px;flex-direction:column;gap:2px}
  .sidebar-footer button span{display:none}
  .sidebar-nav{flex:1;overflow-x:auto;overflow-y:hidden;padding:0}
  .sidebar-nav ul,.nav-tabs{
    flex-direction:row;gap:0;padding:0;
    justify-content:space-around;height:100%;
  }
  .nav-tab{flex:0 0 auto}
  .sidebar-btn{
    flex-direction:column;gap:2px;
    padding:8px 12px;font-size:10px;
    border-radius:0;
  }
  .sidebar-btn i{font-size:18px;width:auto}
  .sidebar-label{display:none!important}
  .sidebar-btn.active::before{
    top:auto;bottom:0;left:50%;transform:translateX(-50%);
    width:20px;height:3px;border-radius:999px;
  }
  .sidebar-badge{top:2px;right:2px;min-width:14px;height:14px;font-size:8px}
  .dashboard-main{margin-left:0!important;height:calc(100vh - 56px)}
  .dashboard-content{padding:16px 16px 24px}
}

/* Keep old dropdown IDs from breaking */
.nav-container{display:none}
.nav-dropdown{display:none}
.dropdown-menu{display:none}
@keyframes fadeInUp{from{opacity:0;transform:translateY(10px)}to{opacity:1;transform:translateY(0)}}
/* duplicate dashboard-content padding merged into mobile block above */

