/* ===== LAYOUT SHELL ===== */
.shell{display:flex;flex-direction:column;height:100vh;position:relative;z-index:1;}

/* --- Header --- */
.hdr{height:50px;display:flex;align-items:center;justify-content:space-between;padding:0 1.25rem;
  background:var(--glass);backdrop-filter:blur(20px) saturate(1.4);-webkit-backdrop-filter:blur(20px) saturate(1.4);
  border-bottom:1px solid var(--glass-border);position:relative;z-index:20;flex-shrink:0;}
.hdr-l{display:flex;align-items:center;gap:1rem;}
.hdr-logo{font-size:1.05rem;font-weight:900;letter-spacing:-.03em;
  background:linear-gradient(135deg,var(--primary),var(--cyan));-webkit-background-clip:text;
  -webkit-text-fill-color:transparent;background-clip:text;cursor:default;}
.hdr-bc{font-size:.72rem;color:var(--text-muted);}
.hdr-bc b{color:var(--text);font-weight:600;}
.hdr-r{display:flex;align-items:center;gap:.65rem;}

.pill{display:flex;background:var(--surface);backdrop-filter:blur(8px);border:1px solid var(--glass-border);
  border-radius:999px;padding:2px;}
.pill button{padding:.22rem .65rem;border-radius:999px;border:none;background:transparent;
  color:var(--text-muted);cursor:pointer;font-size:.6rem;font-weight:600;font-family:inherit;
  transition:all .3s cubic-bezier(.4,0,.2,1);}
.pill button.on{background:var(--primary);color:white;box-shadow:var(--glow-sm);}

.bell{position:relative;width:32px;height:32px;border-radius:10px;border:1px solid var(--glass-border);
  background:var(--surface);backdrop-filter:blur(8px);color:var(--text-muted);cursor:pointer;
  display:flex;align-items:center;justify-content:center;transition:all .2s;}
.bell:hover{border-color:var(--primary);color:var(--primary);box-shadow:var(--glow-sm);}
.bell-dot{position:absolute;top:5px;right:5px;width:7px;height:7px;background:var(--red);border-radius:50%;animation:pdot 2s infinite;}
@keyframes pdot{0%,100%{box-shadow:0 0 0 0 rgba(255,71,87,.4)}50%{box-shadow:0 0 0 5px rgba(255,71,87,0)}}

.admin-btn{position:relative;width:32px;height:32px;border-radius:10px;border:1px solid var(--glass-border);
  background:var(--surface);backdrop-filter:blur(8px);color:var(--text-muted);cursor:pointer;
  display:flex;align-items:center;justify-content:center;transition:all .25s;}
.admin-btn:hover{border-color:var(--primary);color:var(--primary);box-shadow:var(--glow-sm);transform:scale(1.1);}
.admin-btn .admin-label{position:absolute;top:110%;left:50%;transform:translateX(-50%);
  font-size:.52rem;font-weight:600;color:var(--primary);white-space:nowrap;
  opacity:0;transition:opacity .2s,color .2s;pointer-events:none;}
.admin-btn:hover .admin-label{opacity:1;}
.admin-mode .admin-btn .admin-label{color:var(--cyan);}

.avatar-w{position:relative;}
.avatar{width:32px;height:32px;border-radius:50%;background:linear-gradient(135deg,var(--primary),var(--cyan));
  display:flex;align-items:center;justify-content:center;font-size:.7rem;font-weight:700;color:white;
  cursor:pointer;transition:transform .2s,box-shadow .3s;}
.avatar:hover{transform:scale(1.1);box-shadow:var(--glow-sm);}

.avatar-dd{position:absolute;top:calc(100% + 10px);right:0;width:220px;
  background:var(--glass-strong);backdrop-filter:blur(20px) saturate(1.4);-webkit-backdrop-filter:blur(20px) saturate(1.4);
  border:1px solid var(--glass-border);border-radius:16px;padding:.5rem;
  box-shadow:0 12px 40px rgba(0,0,0,0.12),var(--glow-sm);
  opacity:0;transform:translateY(-8px) scale(.96);pointer-events:none;
  transition:all .25s cubic-bezier(.16,1,.3,1);z-index:100;}
.dark .avatar-dd{box-shadow:0 12px 40px rgba(0,0,0,0.5),var(--glow-md);}
.avatar-dd.open{opacity:1;transform:none;pointer-events:auto;}
.avatar-dd .av-profile{display:flex;align-items:center;gap:.6rem;padding:.55rem .6rem;
  border-bottom:1px solid var(--border-subtle);margin-bottom:.35rem;}
.avatar-dd .av-avatar{width:36px;height:36px;border-radius:50%;background:linear-gradient(135deg,var(--primary),var(--cyan));
  display:flex;align-items:center;justify-content:center;font-size:.8rem;font-weight:700;color:white;flex-shrink:0;}
.avatar-dd .av-name{font-size:.78rem;font-weight:700;color:var(--text);}
.avatar-dd .av-email{font-size:.6rem;color:var(--text-muted);margin-top:.1rem;}
.avatar-dd .av-item{display:flex;align-items:center;gap:.5rem;padding:.45rem .6rem;
  border-radius:10px;font-size:.72rem;font-weight:500;color:var(--text-sec);
  cursor:pointer;transition:all .15s;}
.avatar-dd .av-item:hover{background:var(--surface-hover);color:var(--text);transform:translateX(2px);}
.avatar-dd .av-divider{height:1px;background:var(--border-subtle);margin:.3rem .6rem;}
.avatar-dd .av-item.danger{color:var(--red);}
.avatar-dd .av-item.danger:hover{background:rgba(255,71,87,.08);}

/* ===== TABS ===== */
.tabs{height:36px;display:flex;align-items:stretch;padding:0 .5rem;gap:1px;overflow-x:auto;
  background:var(--glass);backdrop-filter:blur(16px);-webkit-backdrop-filter:blur(16px);
  border-bottom:1px solid var(--glass-border);position:relative;z-index:15;flex-shrink:0;}
.tab{display:flex;align-items:center;gap:.4rem;padding:0 .85rem;font-size:.7rem;font-weight:500;
  color:var(--text-muted);cursor:pointer;border-bottom:2px solid transparent;white-space:nowrap;transition:all .25s;}
.tab:hover{color:var(--text-sec);background:var(--surface-hover);}
.tab.on{color:var(--primary);font-weight:600;border-bottom-color:var(--primary);background:var(--surface);}
.tab-x{width:14px;height:14px;border-radius:3px;border:none;background:transparent;color:var(--text-muted);
  font-size:.6rem;cursor:pointer;display:flex;align-items:center;justify-content:center;opacity:0;transition:all .15s;}
.tab:hover .tab-x{opacity:1;}.tab-x:hover{background:rgba(255,71,87,.15);color:var(--red);}

/* ===== BODY ===== */
.body{display:flex;flex:1;overflow:hidden;position:relative;z-index:5;}

/* ===== SIDEBAR ===== */
.side{width:var(--sidebar-w);background:var(--glass);backdrop-filter:blur(20px) saturate(1.3);
  -webkit-backdrop-filter:blur(20px) saturate(1.3);border-right:1px solid var(--glass-border);
  padding:.85rem .6rem;overflow-y:auto;display:flex;flex-direction:column;gap:1px;flex-shrink:0;
  transition:width .4s cubic-bezier(.4,0,.2,1),padding .4s,opacity .25s;}
.side-sec{font-size:.55rem;font-weight:700;text-transform:uppercase;letter-spacing:.12em;
  color:var(--text-muted);padding:1rem .65rem .35rem;}
.side-sec:first-child{padding-top:.25rem;}
.si{padding:.5rem .7rem;border-radius:10px;font-size:.77rem;color:var(--text-sec);cursor:pointer;
  transition:all .25s cubic-bezier(.4,0,.2,1);font-weight:450;display:flex;align-items:center;gap:.6rem;
  position:relative;overflow:hidden;}
.si .ic{width:16px;height:16px;display:flex;align-items:center;justify-content:center;opacity:.65;flex-shrink:0;}
.si:hover{background:var(--surface-hover);color:var(--text);transform:translateX(2px);}
.si.on{background:linear-gradient(135deg,rgba(108,92,231,.12),rgba(108,92,231,.05));
  color:var(--primary);font-weight:600;border:1px solid rgba(108,92,231,.15);box-shadow:var(--glow-sm);}
.si.on .ic{opacity:1;}
.dark .si.on{background:linear-gradient(135deg,rgba(162,155,254,.14),rgba(162,155,254,.05));border-color:rgba(162,155,254,.15);}
.si::before{content:'';position:absolute;left:0;top:0;width:3px;height:100%;background:var(--primary);
  border-radius:0 2px 2px 0;transform:scaleY(0);transition:transform .2s cubic-bezier(.4,0,.2,1);}
.si.on::before{transform:scaleY(1);}

.side-toggle{margin-top:auto;padding:.5rem .7rem;border-radius:10px;border:none;
  background:var(--surface);backdrop-filter:blur(8px);color:var(--text-muted);cursor:pointer;
  display:flex;align-items:center;gap:.6rem;font-size:.7rem;font-weight:500;font-family:inherit;
  transition:all .25s;flex-shrink:0;}
.side-toggle:hover{background:var(--surface-hover);color:var(--primary);}
.side-toggle svg{transition:transform .3s cubic-bezier(.4,0,.2,1);}

/* ── 새 대시보드 추가 버튼 ── */
.side-add-btn{display:flex;align-items:center;gap:.5rem;padding:.45rem .7rem;
  border-radius:10px;border:1px dashed var(--glass-border);background:transparent;
  color:var(--text-muted);cursor:pointer;font-size:.7rem;font-weight:600;font-family:inherit;
  transition:all .2s;margin:.3rem 0;}
.side-add-btn:hover{border-color:var(--primary);color:var(--primary);background:rgba(108,92,231,.04);}
.side-add-btn svg{width:14px;height:14px;}

/* ── 대시보드 메뉴 항목의 우측 액션 (rename / delete) ── */
.si-actions{margin-left:auto;display:flex;gap:.15rem;opacity:0;transition:opacity .15s;}
.si:hover .si-actions{opacity:1;}
.si-act{width:18px;height:18px;border-radius:5px;border:none;background:transparent;
  color:var(--text-muted);cursor:pointer;display:flex;align-items:center;justify-content:center;
  transition:all .15s;font-size:.55rem;}
.si-act:hover{background:var(--surface-hover);color:var(--primary);}
.si-act.danger:hover{background:rgba(255,71,87,.12);color:var(--red);}

/* ── Sidebar Collapsed (invion v5 패턴) ── */
.side{transition:width .35s cubic-bezier(.4,0,.2,1),padding .35s;}
.side.collapsed{width:60px;padding:.85rem .35rem;overflow:visible;}
.side.collapsed .si{justify-content:center;padding:.55rem;border-radius:10px;gap:0;
  position:relative;}
.side.collapsed .si span:not(.ic):not(.si-actions){
  width:0;overflow:hidden;opacity:0;transition:width .2s,opacity .15s;}
.side.collapsed .si .si-actions{display:none;}
.side.collapsed .si .ic{margin:0;opacity:.7;}
.side.collapsed .si.on .ic{opacity:1;}
.side.collapsed .si:hover{transform:none;background:var(--surface-hover);}
.side.collapsed .side-sec{height:0;overflow:hidden;padding:0;margin:0;opacity:0;
  transition:height .25s,opacity .15s,padding .25s,margin .25s;}
.side.collapsed .side-add-btn{justify-content:center;padding:.55rem;}
.side.collapsed .side-add-btn span{width:0;overflow:hidden;opacity:0;}
.side:not(.collapsed) .si span:not(.ic):not(.si-actions){opacity:1;transition:opacity .3s .15s;}
.side:not(.collapsed) .side-sec{opacity:1;transition:opacity .3s .1s,height .3s,padding .3s;}

.side.collapsed .side-toggle{justify-content:center;padding:.55rem;}
.side.collapsed .side-toggle span{width:0;overflow:hidden;opacity:0;}
.side.collapsed .side-toggle svg{transform:rotate(180deg);}

/* Tooltip on collapsed sidebar items */
.side.collapsed .si::after{content:attr(data-name);position:absolute;left:calc(100% + 12px);
  top:50%;transform:translateY(-50%);background:var(--glass-strong);
  backdrop-filter:blur(20px) saturate(1.4);border:1px solid var(--glass-border);
  padding:.35rem .65rem;border-radius:8px;font-size:.65rem;font-weight:600;color:var(--text);
  white-space:nowrap;opacity:0;pointer-events:none;transition:opacity .15s;
  box-shadow:0 8px 24px rgba(0,0,0,.12),var(--glow-sm);z-index:200;}
.side.collapsed .si:hover::after{opacity:1;}

/* Empty dashboard placeholder */
.canvas-empty{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);
  display:flex;flex-direction:column;align-items:center;gap:.6rem;color:var(--text-muted);
  text-align:center;}
.canvas-empty .ce-icon{font-size:3rem;opacity:.25;}
.canvas-empty .ce-title{font-size:.95rem;font-weight:700;color:var(--text-sec);}
.canvas-empty .ce-desc{font-size:.65rem;color:var(--text-muted);max-width:280px;line-height:1.5;}
.canvas-empty .ce-btn{margin-top:.4rem;padding:.5rem 1.2rem;border-radius:10px;border:none;
  background:linear-gradient(135deg,var(--primary),var(--primary-light));color:white;
  font-size:.7rem;font-weight:700;cursor:pointer;font-family:inherit;
  box-shadow:var(--glow-sm);transition:all .2s;}
.canvas-empty .ce-btn:hover{transform:translateY(-1px);box-shadow:var(--glow-md);}

/* ===== ADMIN MODE accents ===== */
.admin-mode .hdr{border-bottom-color:var(--primary);}
.admin-mode .hdr::after{content:'';position:absolute;bottom:-1px;left:0;right:0;height:2px;
  background:linear-gradient(90deg,var(--primary),var(--cyan));}
.admin-badge{display:none;align-items:center;gap:.4rem;padding:.2rem .6rem;border-radius:999px;
  background:linear-gradient(135deg,rgba(108,92,231,.12),rgba(0,206,201,.08));
  border:1px solid rgba(108,92,231,.2);font-size:.58rem;font-weight:700;color:var(--primary);}
.dark .admin-badge{background:linear-gradient(135deg,rgba(162,155,254,.12),rgba(85,239,196,.08));
  border-color:rgba(162,155,254,.2);color:var(--primary-light);}
.admin-mode .admin-badge{display:flex;}
.admin-badge .badge-dot{width:6px;height:6px;border-radius:50%;background:var(--cyan);box-shadow:0 0 8px var(--cyan-glow);}
.admin-side .si.on{background:linear-gradient(135deg,rgba(0,206,201,.12),rgba(0,206,201,.05));
  color:var(--cyan);border-color:rgba(0,206,201,.2);}
.admin-side .si::before{background:var(--cyan);}
.dark .admin-side .si.on{background:linear-gradient(135deg,rgba(85,239,196,.12),rgba(85,239,196,.05));
  border-color:rgba(85,239,196,.15);}
.admin-mode .admin-btn{border-color:var(--cyan);color:var(--cyan);background:rgba(0,206,201,.08);
  box-shadow:0 0 15px var(--cyan-glow);}
