/* ====== Dashboard Layout ====== */
.dashboard-layout { display: flex; height: 100vh; overflow: hidden; }

/* ====== Sidebar ====== */
.sidebar {
    width: 280px; min-width: 280px; background: #18181b;
    border-right: 1px solid #27272a; display: flex; flex-direction: column;
    height: 100vh; overflow: hidden;
}
.sidebar-brand {
    padding: 20px 20px 16px; border-bottom: 1px solid transparent;
    border-image: linear-gradient(90deg, #3b82f6, #a855f7, transparent) 1;
    display: flex; align-items: center; gap: 12px;
}
.sidebar-brand-logo {
    line-height: 0;
}
.sidebar-brand-sub { font-size: 11px; color: #71717a; text-transform: uppercase; letter-spacing: 1px; font-weight: 500; }
.sidebar-header {
    padding: 16px 20px 12px; font-size: 11px; text-transform: uppercase; color: #71717a;
    letter-spacing: 1px; font-weight: 600; display: flex; align-items: center; justify-content: space-between;
}
.date-list { flex: 1; overflow-y: auto; padding-bottom: 20px; }

.date-item {
    padding: 10px 20px; cursor: pointer; transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex; justify-content: space-between; align-items: center;
    border-left: 3px solid transparent; user-select: none;
}
.date-item:hover { background: rgba(59,130,246,0.05); }
.date-item .date-left { display: flex; align-items: center; gap: 8px; }
.date-item .date-chevron { width: 16px; height: 16px; color: #71717a; transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1); flex-shrink: 0; }
.date-item.expanded .date-chevron { transform: rotate(90deg); }
.date-item .date-text { font-size: 13px; color: #a1a1aa; font-weight: 500; }
.date-item:hover .date-text { color: #fafafa; }
.date-item .date-count {
    font-size: 11px; background: #27272a; color: #71717a; padding: 2px 8px;
    border-radius: 10px; min-width: 24px; text-align: center; font-weight: 500;
    font-family: 'JetBrains Mono', monospace;
}

.session-list { overflow: hidden; transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1); }
.session-list.collapsed { max-height: 0 !important; }

.session-item {
    padding: 10px 16px 10px 28px; cursor: pointer; transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex; align-items: center; gap: 10px; border-left: 3px solid transparent;
    opacity: 0; animation: sessionSlideIn 0.2s cubic-bezier(0.4, 0, 0.2, 1) forwards; position: relative;
}
.session-item:hover { background: rgba(59,130,246,0.05); }
.session-item.active { background: rgba(59,130,246,0.08); border-left-color: #3b82f6; }
@keyframes sessionSlideIn {
    from { opacity: 0; transform: translateX(-8px); }
    to { opacity: 1; transform: translateX(0); }
}

.session-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.session-dot.active-data { background: #22c55e; box-shadow: 0 0 6px rgba(34,197,94,0.4); }
.session-dot.idle-data { background: #3f3f46; }

.session-item .session-info { flex: 1; min-width: 0; cursor: pointer; }
.session-item .session-time { color: #fafafa; font-weight: 500; font-family: 'JetBrains Mono', monospace; font-size: 12px; }
.session-item.active .session-time { color: #3b82f6; }
.session-item .session-meta { font-size: 11px; color: #71717a; margin-top: 2px; }
.session-item .session-actions { display: flex; gap: 2px; flex-shrink: 0; opacity: 0; transition: opacity 0.15s; }
.session-item:hover .session-actions { opacity: 1; }

.session-tooltip {
    display: none; position: absolute; left: calc(100% + 8px); top: 50%; transform: translateY(-50%);
    background: rgba(24,24,27,0.95); border: 1px solid #3f3f46; border-radius: 8px;
    padding: 8px 12px; font-size: 11px; color: #a1a1aa; white-space: nowrap;
    z-index: 60; pointer-events: none; box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    font-family: 'JetBrains Mono', monospace;
}
.session-item:hover .session-tooltip { display: block; }

.btn-icon {
    background: none; border: none; color: #71717a; cursor: pointer;
    padding: 5px; border-radius: 6px; line-height: 1;
    transition: all 0.15s; display: flex; align-items: center; justify-content: center; text-decoration: none;
}
.btn-icon:hover { background: #27272a; color: #fafafa; }
.btn-icon.danger:hover { background: rgba(239,68,68,0.1); color: #ef4444; }
.btn-icon svg { width: 15px; height: 15px; }
.sidebar-empty { padding: 30px 20px; text-align: center; color: #71717a; font-size: 13px; line-height: 1.6; }

/* Sidebar footer */
.sidebar-footer { padding: 12px 16px; border-top: 1px solid #27272a; display: flex; align-items: center; gap: 10px; position: relative; }
.sidebar-avatar {
    width: 32px; height: 32px; border-radius: 50%;
    background: linear-gradient(135deg, #3b82f6, #a855f7);
    display: flex; align-items: center; justify-content: center;
    font-size: 13px; font-weight: 600; color: #fff; flex-shrink: 0;
}
.sidebar-user-info { flex: 1; min-width: 0; }
.sidebar-user-name { font-size: 13px; font-weight: 500; color: #fafafa; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user-email { font-size: 11px; color: #71717a; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-footer .btn-icon { color: #71717a; }
.sidebar-footer .btn-icon:hover { color: #fafafa; }

.user-popup {
    display: none; position: absolute; bottom: calc(100% + 8px); left: 12px; right: 12px;
    background: #18181b; border: 1px solid #3f3f46; border-radius: 12px; overflow: hidden;
    z-index: 100; box-shadow: 0 -8px 30px rgba(0,0,0,0.4);
    animation: popupSlideUp 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.user-popup.show { display: block; }
@keyframes popupSlideUp {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}
.user-popup .popup-item {
    display: flex; align-items: center; gap: 10px; padding: 10px 16px; color: #a1a1aa;
    font-size: 13px; font-weight: 500; cursor: pointer; transition: all 0.15s;
    border: none; background: none; width: 100%; text-align: left; font-family: 'Inter', sans-serif;
}
.user-popup .popup-item:hover { background: rgba(59,130,246,0.05); color: #fafafa; }
.user-popup .popup-item.danger { color: #ef4444; }
.user-popup .popup-item.danger:hover { background: rgba(239,68,68,0.05); }
.user-popup .popup-item svg { width: 16px; height: 16px; flex-shrink: 0; }
.user-popup .popup-divider { height: 1px; background: #27272a; margin: 4px 0; }

/* ====== Main Content ====== */
.main-content { flex: 1; overflow-y: auto; overflow-x: hidden; background: #09090b; height: 100vh; }
.main-header { padding: 20px 28px 0; display: flex; align-items: center; justify-content: space-between; }
.main-title { font-size: 20px; font-weight: 600; color: #fafafa; }
.main-title-sub { font-size: 13px; color: #71717a; font-weight: 400; margin-left: 8px; }
.container { max-width: 1440px; margin: 0 auto; padding: 20px 28px 28px; }

/* Compare + sidebar highlight */
.session-item.compare-a { border-left: 3px solid #3b82f6; }
.session-item.compare-b { border-left: 3px solid #f59e0b; }
