.sidebar{width:var(--sidebar-width);height:100dvh;background:var(--bg-sidebar);border-left:1px solid var(--border);display:none;flex-direction:column;overflow-y:auto;overflow-x:hidden;flex-shrink:0;position:fixed;top:0;right:0;z-index:var(--z-topbar);transform:translateX(100%);transition:transform var(--ease-slow);box-shadow:-4px 0 24px rgba(15,23,42,.08)}
.sidebar.open{display:flex;transform:translateX(0)}
.sidebar__header{display:flex;align-items:center;justify-content:space-between;padding:16px 14px;border-bottom:1px solid var(--border);flex-shrink:0;background:var(--bg-sidebar)}
.sidebar__brand{display:flex;align-items:center;gap:10px}
.sidebar__logo-img{width:34px;height:34px;object-fit:contain;border-radius:8px;flex-shrink:0;filter:drop-shadow(0 2px 6px rgba(37,99,235,.25))}
.sidebar__brand-text{display:flex;flex-direction:column;gap:1px}
.sidebar__app-name{font-size:13.5px;font-weight:700;color:var(--text-primary);line-height:1.2;letter-spacing:-.01em}
.sidebar__version{font-size:10px;color:var(--text-muted);font-weight:500;letter-spacing:.02em}
.sidebar__close-btn{width:36px;height:36px;display:flex;align-items:center;justify-content:center;color:var(--text-secondary);border-radius:var(--radius);transition:background var(--ease)}
.sidebar__close-btn:hover{background:var(--gray-100)}
.sidebar__nav{flex:1;padding:10px 10px;display:flex;flex-direction:column;gap:1px;overflow-y:auto}
.sidebar__group-label{font-size:10.5px;font-weight:700;color:var(--text-muted);text-transform:uppercase;letter-spacing:.06em;padding:14px 12px 6px}
.sidebar__nav-item{display:flex;align-items:center;gap:10px;padding:10px 12px;border-radius:var(--radius);color:var(--text-secondary);font-size:13.5px;font-weight:500;transition:all var(--ease);min-height:44px;position:relative;text-decoration:none}
.sidebar__nav-item:hover{background:var(--gray-100);color:var(--text-primary)}
.sidebar__nav-item.active{background:var(--primary-50);color:var(--primary);font-weight:600}
.sidebar__nav-item.active::before{content:'';position:absolute;right:0;top:22%;bottom:22%;width:3px;background:var(--primary);border-radius:999px 0 0 999px}
.sidebar__nav-icon{width:18px;height:18px;flex-shrink:0;stroke-width:1.8}
.sidebar__divider{height:1px;background:var(--border);margin:6px 4px}
.sidebar__footer{display:flex;align-items:center;gap:10px;padding:12px 14px;border-top:1px solid var(--border);flex-shrink:0;background:var(--gray-50)}
[data-theme="dark"] .sidebar__footer{background:transparent}
.sidebar__app-footer{display:flex;align-items:center;gap:8px;flex:1;min-width:0}
.sidebar__app-logo{width:28px;height:28px;border-radius:6px;object-fit:contain;flex-shrink:0;opacity:.85}
.sidebar__app-info{flex:1;min-width:0}
.sidebar__app-name-footer{font-size:12px;font-weight:700;color:var(--text-secondary);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.sidebar__app-version{font-size:10px;color:var(--text-muted);margin-top:1px}
.sidebar__logo-wrap{flex-shrink:0}
.user-avatar{width:34px;height:34px;border-radius:50%;background:linear-gradient(135deg,var(--primary) 0%,var(--primary-700) 100%);color:#fff;font-size:13px;font-weight:700;display:flex;align-items:center;justify-content:center;flex-shrink:0;box-shadow:0 2px 8px rgba(37,99,235,.35)}
.user-info{flex:1;min-width:0}
.user-name{font-size:13px;font-weight:600;color:var(--text-primary);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.user-role{font-size:10px;color:var(--text-muted);margin-top:1px}
@media (min-width:768px){.sidebar{display:flex;position:static;transform:none;box-shadow:none;height:auto}}

.topbar{height:var(--topbar-height);background:var(--bg-surface);border-bottom:1px solid var(--border);display:flex;align-items:center;gap:8px;padding:0 14px;position:sticky;top:0;z-index:var(--z-topbar);flex-shrink:0}
.topbar__menu-btn,.topbar__action-btn{width:42px;height:42px;display:flex;align-items:center;justify-content:center;color:var(--text-secondary);border-radius:var(--radius);transition:all var(--ease);flex-shrink:0}
.topbar__menu-btn:hover,.topbar__action-btn:hover{background:var(--gray-100);color:var(--text-primary)}
.topbar__menu-btn:active,.topbar__action-btn:active{transform:scale(.95)}
.topbar__title{font-size:17px;font-weight:700;color:var(--text-primary);flex:1;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.topbar__actions{display:flex;align-items:center;gap:2px}
.conn-badge{display:flex;align-items:center;gap:6px;padding:4px 10px;border-radius:99px;font-size:11px;font-weight:600;background:var(--gray-100);color:var(--text-muted)}
.conn-dot{width:8px;height:8px;border-radius:50%;background:var(--gray-400)}
.conn-badge--online .conn-dot{background:var(--success)}
.conn-badge--online{background:var(--success-bg);color:var(--text-success)}
.conn-badge--offline .conn-dot{background:var(--danger)}
.conn-badge--offline{background:var(--danger-bg);color:var(--text-danger)}
@media (max-width:480px){.conn-badge{display:none}}

.workspace{flex:1;overflow-y:auto;overflow-x:hidden;padding:16px 14px 100px;background:var(--bg-app)}
@media (min-width:768px){.workspace{padding:24px 28px 32px}}
.workspace__inner{max-width:1100px;margin:0 auto;animation:fadeInUp 240ms cubic-bezier(.4,0,.2,1)}
.workspace__inner > * + *{margin-top:16px}

.bottom-nav{position:fixed;bottom:0;left:0;right:0;height:var(--bottom-nav-height);background:var(--bg-surface);border-top:1px solid var(--border);display:flex;align-items:center;justify-content:space-around;z-index:var(--z-sticky);padding:6px 8px env(safe-area-inset-bottom,0);box-shadow:0 -4px 16px rgba(15,23,42,.06)}
.bottom-nav__item{display:flex;flex-direction:column;align-items:center;gap:3px;flex:1;color:var(--text-muted);font-size:11px;font-weight:500;padding:6px 4px;border-radius:var(--radius);transition:color var(--ease);min-height:44px;justify-content:center}
.bottom-nav__item.active{color:var(--primary)}
.bottom-nav__icon{width:22px;height:22px;stroke-width:1.8}
.bottom-nav__item--fab{flex:0 0 auto}
.bottom-nav__fab{width:54px;height:54px;border-radius:50%;background:linear-gradient(135deg,var(--primary) 0%,var(--primary-700) 100%);color:#fff;display:flex;align-items:center;justify-content:center;box-shadow:0 6px 16px rgba(37,99,235,.45);margin-top:-22px;transition:transform var(--ease)}
.bottom-nav__fab:active{transform:scale(.92)}
@media (min-width:768px){.bottom-nav{display:none}}

.fab{position:fixed;bottom:calc(var(--bottom-nav-height) + 16px);left:50%;transform:translateX(-50%);width:60px;height:60px;border-radius:50%;background:linear-gradient(135deg,var(--primary) 0%,var(--primary-700) 100%);color:#fff;display:flex;align-items:center;justify-content:center;box-shadow:0 8px 20px rgba(37,99,235,.45);z-index:var(--z-sticky);transition:transform var(--ease)}
.fab:active{transform:translateX(-50%) scale(.92)}
@media (min-width:768px){.fab{display:none}}

.more-sheet{position:fixed;bottom:0;left:0;right:0;background:var(--bg-surface);border-radius:var(--radius-2xl) var(--radius-2xl) 0 0;box-shadow:0 -12px 32px rgba(15,23,42,.18);z-index:calc(var(--z-dialog) + 1);transform:translateY(100%);transition:transform var(--ease-slow);padding:8px 16px env(safe-area-inset-bottom,12px);max-height:80vh;overflow-y:auto;display:none}
.more-sheet.open{display:block;transform:translateY(0);animation:slideInUp var(--ease-slow)}
.more-sheet__handle{width:40px;height:4px;background:var(--gray-300);border-radius:99px;margin:4px auto 8px}
.more-sheet__header{display:flex;align-items:center;justify-content:space-between;padding:8px 0 12px;border-bottom:1px solid var(--border);margin-bottom:12px}
.more-sheet__title{font-size:16px;font-weight:700;color:var(--text-primary)}
.more-sheet__grid{display:grid;grid-template-columns:repeat(3,1fr);gap:12px;padding-bottom:12px}
.more-sheet__item{display:flex;flex-direction:column;align-items:center;gap:8px;padding:14px 8px;border-radius:var(--radius-lg);background:var(--bg-muted);text-decoration:none;color:var(--text-primary);font-size:12.5px;font-weight:600;transition:all var(--ease);min-height:90px;justify-content:center;text-align:center}
.more-sheet__item:hover,.more-sheet__item:active{background:var(--primary-50);color:var(--primary);transform:scale(.97)}
.more-sheet__icon{width:44px;height:44px;border-radius:var(--radius);display:flex;align-items:center;justify-content:center;flex-shrink:0}
@media (min-width:768px){.more-sheet{display:none!important}#more-sheet-overlay{display:none!important}}
