/* ── 데스크톱 사이드바 자동숨김 ──────────────────────── */
@media (min-width: 861px) {
    .sidebar-autohide-trigger {
        position: fixed;
        left: 0;
        top: 0;
        width: 6px;
        height: 100vh;
        z-index: 199;
        cursor: e-resize;
    }

    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        transform: translateX(calc(-100% - 1px));
        transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    }

    /* box-shadow 제거: blur가 사이드바 오른쪽 콘텐츠로 번져 어두운 세로 띠를 만들던 원인.
       사이드바 경계는 base .sidebar 의 border-right 로 충분히 구분됨 */
    .sidebar.autohide-visible {
        transform: translateX(0);
    }

    /* 핀 고정 시 콘텐츠 영역을 사이드바 너비만큼 밀기 */
    .app-container {
        transition: padding-left 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    }
    body.sidebar-pinned .app-container {
        padding-left: 280px;
    }

    /* 핀 미고정 시 업체 상세 뷰: 핀 고정 너비 그대로 가운데 정렬 */
    /* content-panel padding 32px*2=64px 을 더해 사이드바 280px 기준 */
    body:not(.sidebar-pinned) .company-detail {
        max-width: calc(100vw - 344px);
        margin-left: auto;
        margin-right: auto;
    }

    /* 핀 미고정 시 % 너비 뷰들의 오른쪽 기준 고정 (border-box 활용) */
    body:not(.sidebar-pinned) .content-panel.send-results-bg,
    body:not(.sidebar-pinned) .content-panel.personaltodo-bg,
    body:not(.sidebar-pinned) .content-panel.consultation-bg,
    body:not(.sidebar-pinned) .content-panel.blog-auto-bg {
        padding-right: 280px;
        transition: padding-right 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    }
    body.sidebar-pinned .content-panel.send-results-bg,
    body.sidebar-pinned .content-panel.personaltodo-bg,
    body.sidebar-pinned .content-panel.consultation-bg,
    body.sidebar-pinned .content-panel.blog-auto-bg {
        padding-right: 0;
        transition: padding-right 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    }
}
@media (min-width: 861px) and (max-width: 1280px) {
    body.sidebar-pinned .app-container {
        padding-left: 240px;
    }
    body:not(.sidebar-pinned) .content-panel.send-results-bg,
    body:not(.sidebar-pinned) .content-panel.personaltodo-bg,
    body:not(.sidebar-pinned) .content-panel.consultation-bg,
    body:not(.sidebar-pinned) .content-panel.blog-auto-bg {
        padding-right: 240px;
    }
    body:not(.sidebar-pinned) .company-detail {
        max-width: calc(100vw - 304px); /* 240px + 64px */
    }
}
@media (min-width: 861px) and (max-width: 1024px) {
    body.sidebar-pinned .app-container {
        padding-left: 200px;
    }
    body:not(.sidebar-pinned) .content-panel.send-results-bg,
    body:not(.sidebar-pinned) .content-panel.personaltodo-bg,
    body:not(.sidebar-pinned) .content-panel.consultation-bg,
    body:not(.sidebar-pinned) .content-panel.blog-auto-bg {
        padding-right: 200px;
    }
    body:not(.sidebar-pinned) .company-detail {
        max-width: calc(100vw - 264px); /* 200px + 64px */
    }
}

/* ── 반응형 레이아웃 ──────────────────────────────────── */

/* 1280px 이하: 사이드바 축소 + 대시보드 2열 */
@media (max-width: 1280px) {
    .sidebar {
        width: 240px;
    }
    .dashboard-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* 1024px 이하 */
@media (max-width: 1024px) {
    .sidebar {
        width: 200px;
    }
    .content-panel {
        padding: 20px;
    }
    .detail-grid {
        grid-template-columns: 1fr;
    }
    .top-nav {
        padding: 0 20px;
    }
    .dashboard-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* 860px 이하: 사이드바 아이콘만 표시 */
@media (max-width: 860px) {
    .sidebar {
        width: 60px;
        flex-shrink: 0;
    }
    .sidebar-header {
        padding: 16px 8px;
    }
    .logo-area {
        justify-content: center;
    }
    .logo-img {
        width: 28px;
        height: 28px;
    }
    .app-title,
    .user-badge,
    .section-label,
    .sort-filter-wrap,
    .filter-select-wrap,
    .company-list {
        display: none !important;
    }
    .nav-item {
        justify-content: center;
        padding: 12px 0;
        gap: 0;
    }
    .nav-item span {
        display: none;
    }
    .nav-item i {
        font-size: 1.2rem;
        width: auto;
    }
    .sidebar-nav {
        padding: 16px 8px;
    }
    .content-panel {
        padding: 16px;
    }
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    .top-nav {
        padding: 0 16px;
        height: 60px;
    }
    .login-container {
        width: 90%;
        padding: 32px 24px;
    }

}
/* ── 모바일/폴드 전면 (600px 이하): 드로어 사이드바 ────────────────── */
.btn-mobile-menu {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.3rem;
    cursor: pointer;
    padding: 8px 10px;
    border-radius: 8px;
    flex-shrink: 0;
}
.sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 998;
}
@media (max-width: 600px) {
    .btn-mobile-menu {
        display: flex;
        align-items: center;
        color: #ffffff !important;
    }
    .sidebar {
        position: fixed !important;
        left: -300px !important;
        top: 0 !important;
        height: var(--mobile-vh, 100dvh) !important;
        width: 280px !important;
        z-index: 999 !important;
        transition: left 0.3s ease;
        overflow: hidden;
    }
    .sidebar.mobile-open {
        left: 0 !important;
        display: flex;
        flex-direction: column;
        height: var(--mobile-vh, 100dvh);
    }
    .sidebar-backdrop.active {
        display: block;
    }
    /* 860px 규칙에서 숨긴 요소들 모바일 드로어에서 복원 */
    .app-title,
    .user-badge,
    .section-label,
    .sort-filter-wrap,
    .filter-select-wrap,
    .company-list {
        display: block !important;
    }
    .nav-item span {
        display: inline !important;
    }
    .nav-item {
        justify-content: flex-start !important;
        padding: 12px 16px !important;
        gap: 12px !important;
    }
    .main-layout {
        width: 100%;
    }
    .top-nav {
        padding: 0 12px !important;
        min-height: 56px;
        gap: 8px;
    }
    .top-nav.dashboard-header,
    .top-nav.withholding-header,
    .top-nav.cabinet-header,
    .top-nav.consultation-header {
        display: flex !important;
        background: rgba(7, 17, 31, 0.92);
        border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    }
    .top-nav.dashboard-header .btn-mobile-menu,
    .top-nav.withholding-header .btn-mobile-menu,
    .top-nav.cabinet-header .btn-mobile-menu,
    .top-nav.consultation-header .btn-mobile-menu {
        color: #ffffff;
    }
    .top-nav.dashboard-header #currentPageTitle,
    .top-nav.withholding-header #currentPageTitle,
    .top-nav.cabinet-header #currentPageTitle,
    .top-nav.consultation-header #currentPageTitle {
        color: #ffffff;
    }
    .view-title h2 {
        font-size: 1rem;
    }
    .content-panel {
        padding: 12px !important;
        padding-bottom: calc(18px + var(--mobile-safe-bottom)) !important;
    }
    .dashboard-grid {
        grid-template-columns: 1fr !important;
    }
    .detail-grid {
        grid-template-columns: 1fr !important;
    }
    .header-right {
        flex-wrap: nowrap;
        overflow: hidden;
    }
    .btn-premium {
        font-size: 0.8rem;
        padding: 6px 10px;
    }
}


/* ── 펼친화면 (601px~860px) 태블릿·폴드 최적화 ── */
@media (min-width: 601px) and (max-width: 860px) {
    .sidebar {
        width: 220px;
        flex-shrink: 0;
        display: flex;
        flex-direction: column;
        height: var(--mobile-vh, 100dvh);
        overflow: hidden;
    }
    .app-title,
    .user-badge,
    .section-label,
    .sort-filter-wrap,
    .filter-select-wrap,
    .company-list {
        display: block !important;
    }
    .nav-item span {
        display: inline !important;
        font-size: 0.82rem;
    }
    .nav-item {
        justify-content: flex-start !important;
        padding: 9px 10px !important;
        gap: 8px !important;
    }
    .sidebar-header {
        padding: 14px 12px;
    }
    .app-title {
        font-size: 0.9rem;
    }
}

/* ── 600px 이하 모바일 드로어: 사이드바 내부 스크롤 보장 ── */
@media (max-width: 600px) {
    .sidebar.mobile-open .sidebar-nav {
        flex: 1;
        min-height: 0;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
}

/* ── 601~860px 폴드/태블릿: sidebar-nav 스크롤 보장 ── */
@media (min-width: 601px) and (max-width: 860px) {
    .sidebar-nav {
        flex: 1;
        min-height: 0;
        overflow-y: auto;
        padding-bottom: calc(84px + var(--mobile-safe-bottom)) !important;
    }
    .sidebar-nav .nav-item-group {
        padding-bottom: calc(36px + var(--mobile-safe-bottom)) !important;
    }
}

/* ── 터치기기 601~860px (폴드 펼침 등): 드로어 강제 ── */
@media (min-width: 601px) and (max-width: 860px) {
    html.is-touch .sidebar-autohide-trigger { display: none !important; }
    html.is-touch .sidebar {
        position: fixed !important;
        left: -300px !important;
        top: 0 !important;
        height: var(--mobile-vh, 100dvh) !important;
        width: 280px !important;
        z-index: 999 !important;
        transition: left 0.3s ease !important;
        overflow: hidden;
    }
    html.is-touch .sidebar.mobile-open { left: 0 !important; }
    html.is-touch body.sidebar-pinned .app-container { padding-left: 0 !important; }
    html.is-touch .sidebar-backdrop.active { display: block; }
    html.is-touch .btn-mobile-menu {
        display: flex !important;
        align-items: center;
        color: #ffffff !important;
    }
    html.is-touch .top-nav.dashboard-header,
    html.is-touch .top-nav.withholding-header,
    html.is-touch .top-nav.cabinet-header,
    html.is-touch .top-nav.consultation-header {
        display: flex !important;
        background: rgba(7, 17, 31, 0.92) !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.12) !important;
    }
    html.is-touch .main-layout { width: 100%; }
}

/* ── 모바일 전용 로그아웃 하단 고정 (JS로 이동된 요소) ── */
.mobile-sidebar-footer {
    flex-shrink: 0 !important;
    padding: 12px 16px calc(16px + var(--mobile-safe-bottom)) 16px !important;
    border-top: 1px solid var(--border-light) !important;
    background: var(--bg-sidebar) !important;
    margin-top: 0 !important;
    /* 원래 inline 스타일 덮어쓰기 */
    border-top: 1px solid rgba(255,255,255,0.15) !important;
}

/* ── blog-auto 뷰 ── */
.content-panel.blog-auto-bg {
    padding: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background: transparent;
}
.top-nav.blog-auto-header {
    background: transparent;
    border-bottom: none;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}
.top-nav.blog-auto-header #currentPageTitle {
    color: #ffffff;
    text-shadow: 0 1px 6px rgba(0,0,0,0.75);
}

/* ── blog-auto 배경 (ddh19) ── */
.main-layout.blog-auto-main {
    background: url('../assets/ddj0201.webp?v=1') right center / cover no-repeat;
    background-color: #0a1628;
}

/* ── 터치기기 (861px+): autohide 무력화, 드로어 강제 (JS가 html.is-touch 부여) ── */
@media (min-width: 861px) {
    html.is-touch .sidebar-autohide-trigger { display: none !important; }
    html.is-touch .sidebar {
        left: -300px !important;
        transform: none !important;
        transition: left 0.3s ease !important;
        height: var(--mobile-vh, 100dvh) !important;
        width: 280px !important;
        z-index: 999 !important;
    }
    html.is-touch .sidebar.mobile-open { left: 0 !important; }
    html.is-touch .sidebar.autohide-visible { transform: none !important; }
    html.is-touch body.sidebar-pinned .app-container { padding-left: 0 !important; }
    html.is-touch .btn-mobile-menu {
        display: flex !important;
        align-items: center;
        color: #ffffff !important;
    }
    html.is-touch .sidebar-backdrop.active { display: block; }
    html.is-touch .top-nav.dashboard-header,
    html.is-touch .top-nav.withholding-header,
    html.is-touch .top-nav.cabinet-header,
    html.is-touch .top-nav.consultation-header {
        display: flex !important;
        background: rgba(7, 17, 31, 0.92) !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.12) !important;
    }
}

/* ── 클래식 배경 테마 오버라이드 (더블클릭 토글) ── */
body.bg-classic .content-panel.dashboard-bg {
    background:
        linear-gradient(90deg, rgba(4,12,25,0.96) 0%, rgba(6,18,37,0.90) 48%, rgba(7,23,48,0.14) 70%, transparent 84%),
        url("../assets/ddh07.webp?v=2") no-repeat right center / cover;
}
body.bg-classic .main-layout.calendar-main {
    background:
        linear-gradient(90deg, rgba(7,17,31,0.92) 0%, rgba(10,23,40,0.86) 50%, rgba(10,23,40,0.14) 70%, transparent 82%),
        url("../assets/dda01.webp?v=2") no-repeat right center / cover;
    background-color: #07111f;
}
@media (max-width: 1180px) {
    body.bg-classic .content-panel.calendar-bg {
        background:
            linear-gradient(90deg, rgba(7,17,31,0.90) 0%, rgba(10,23,40,0.78) 70%, rgba(10,23,40,0.46) 100%),
            url("../assets/dda01.webp?v=2") no-repeat right center / cover;
    }
}
body.bg-classic .main-layout.personaltodo-main {
    background:
        linear-gradient(90deg, rgba(7,17,31,0.92) 0%, rgba(10,22,38,0.86) 50%, rgba(10,22,38,0.14) 70%, transparent 82%),
        url("../assets/dds06.webp?v=1") no-repeat right center / cover;
    background-color: #07111f;
}
body.bg-classic .main-layout.mynotes-main {
    background: url("../assets/dds05.webp?v=1") right center / cover no-repeat;
    background-color: #13224e;
}
body.bg-classic .content-panel.withholding-bg {
    background:
        linear-gradient(90deg, rgba(7,17,31,0.92) 0%, rgba(10,22,38,0.86) 50%, rgba(10,22,38,0.14) 70%, transparent 82%),
        url("../assets/dda0104.webp?v=1") no-repeat right center / cover;
}
body.bg-classic .main-layout.consultation-main {
    background:
        radial-gradient(circle at 80% 18%, rgba(96,120,156,0.16), transparent 35%),
        linear-gradient(90deg, rgba(7,17,31,0.78) 0%, rgba(10,22,38,0.54) 56%, rgba(10,22,38,0.14) 82%, rgba(10,22,38,0.04) 100%),
        url("../assets/dda02.webp?v=1") right center / cover no-repeat;
    background-color: #07111f;
}
body.bg-classic .main-layout.gifttax-main {
    background:
        linear-gradient(90deg, rgba(7,17,31,1.00) 0%, rgba(10,22,38,0.90) 8%, rgba(10,22,38,0.55) 22%, rgba(10,22,38,0.18) 38%, rgba(10,22,38,0.00) 54%),
        url("../assets/ddi07.webp?v=1") right center / cover no-repeat;
}
body.bg-classic .main-layout.taxopinion-main {
    background:
        linear-gradient(90deg, rgba(7,17,31,1.00) 0%, rgba(10,22,38,0.90) 8%, rgba(10,22,38,0.55) 22%, rgba(10,22,38,0.18) 38%, rgba(10,22,38,0.00) 54%),
        url("../assets/ddi04.webp?v=1") 100% center / cover no-repeat;
}
body.bg-classic .main-layout.smart-consult-main {
    background:
        linear-gradient(90deg, rgba(7,17,31,1.00) 0%, rgba(10,22,38,0.90) 8%, rgba(10,22,38,0.55) 22%, rgba(10,22,38,0.18) 38%, rgba(10,22,38,0.00) 54%),
        url("../assets/chul019.webp?v=1") right center / cover no-repeat;
}
body.bg-classic .main-layout.send-results-main {
    background: url("../assets/dda0401.webp?v=1") right center / cover no-repeat;
    background-color: #0d1b2e;
}
body.bg-classic .main-layout.contract-main {
    background: url("../assets/dda0105.webp?v=1") right center / cover no-repeat;
    background-color: #0a1428;
}
body.bg-classic .main-layout.secretary-main {
    background: url("../assets/ddp0102.webp?v=1") right center / cover no-repeat;
    background-color: #0d1520;
}
body.bg-classic .main-layout.staff-mgmt-main {
    background: url("../assets/ddp01.webp?v=1") no-repeat right center / cover;
    background-color: #0f2442;
}
body.bg-classic #emailReaderContainer.email-reader-placeholder {
    background: url("../assets/ddh13.jpg?v=1") calc(100% + 160px) center / cover no-repeat !important;
}
body.bg-classic .login-overlay {
    background-image: url('../assets/bg_custom.webp') !important;
}

/* ── 로봇 배경 테마 사이드 메뉴 ── */
body.robot-wallpaper-sidebar .sidebar {
    width: 306px;
    padding: 10px 10px 8px;
    background:
        linear-gradient(180deg, rgba(17, 29, 48, 0.58), rgba(7, 16, 29, 0.74)),
        rgba(5, 13, 25, 0.72);
    border-right: 1px solid rgba(125, 205, 255, 0.34);
    /* 외부 짙은 그림자(14px 0 42px) 제거: 사이드바 오른쪽 콘텐츠로 번져
       업체 상세/수신함 왼쪽에 어두운 세로 띠를 만들던 진짜 원인. 안쪽 글로우만 유지 */
    box-shadow:
        inset 0 0 0 1px rgba(200, 235, 255, 0.13),
        inset -1px 0 18px rgba(58, 174, 255, 0.18);
    backdrop-filter: blur(13px) saturate(1.16);
    -webkit-backdrop-filter: blur(13px) saturate(1.16);
}

@media (min-width: 861px) {
    body.robot-wallpaper-sidebar.sidebar-pinned .app-container {
        padding-left: 306px;
    }
}

body.robot-wallpaper-sidebar .sidebar::before,
body.robot-wallpaper-sidebar .sidebar::after {
    content: '';
    position: absolute;
    pointer-events: none;
}

body.robot-wallpaper-sidebar .sidebar::before {
    inset: 6px;
    border: 1px solid rgba(165, 218, 255, 0.28);
    border-radius: 22px;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.24),
        inset 0 -1px 0 rgba(30, 130, 220, 0.2),
        0 0 26px rgba(49, 169, 255, 0.16);
}

body.robot-wallpaper-sidebar .sidebar::after {
    top: 0;
    right: 32px;
    width: 70px;
    height: 8px;
    border-radius: 0 0 12px 12px;
    background: linear-gradient(90deg, transparent, rgba(215, 234, 249, 0.74), transparent);
    filter: drop-shadow(0 0 9px rgba(77, 181, 255, 0.6));
}

body.robot-wallpaper-sidebar .sidebar-header {
    position: relative;
    z-index: 1;
    padding: 20px 18px 10px;
}

body.robot-wallpaper-sidebar .logo-area {
    align-items: center;
    margin-bottom: 16px;
}

body.robot-wallpaper-sidebar .logo-img {
    width: 47px;
    height: 47px;
    padding: 7px;
    border-radius: 15px;
    background:
        linear-gradient(145deg, rgba(224, 239, 251, 0.18), rgba(38, 116, 202, 0.18)),
        rgba(8, 19, 34, 0.7);
    border: 1px solid rgba(122, 206, 255, 0.58);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.32),
        0 0 18px rgba(52, 170, 255, 0.42);
}

body.robot-wallpaper-sidebar .app-title {
    color: #f8fbff;
    font-size: 1.36rem;
    font-weight: 850;
    letter-spacing: 0;
    line-height: 1.1;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.72), 0 0 12px rgba(96, 190, 255, 0.24);
}

body.robot-wallpaper-sidebar .app-title .accent {
    color: #39b9ff;
    text-shadow: 0 0 13px rgba(58, 185, 255, 0.58);
}

body.robot-wallpaper-sidebar .user-badge {
    min-height: 70px;
    padding: 10px 78px 10px 72px;
    position: relative;
    gap: 8px;
    color: #162238;
    font-size: 0.88rem;
    font-weight: 830;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.93), rgba(174, 190, 209, 0.92));
    border: 1px solid rgba(225, 239, 255, 0.78);
    border-radius: 18px;
    box-shadow:
        inset 0 2px 0 rgba(255, 255, 255, 0.78),
        inset 0 -8px 18px rgba(57, 75, 101, 0.2),
        0 7px 18px rgba(0, 0, 0, 0.26),
        0 0 14px rgba(80, 187, 255, 0.24);
}

body.robot-wallpaper-sidebar .sidebar-user-name {
    flex: 1;
    line-height: 1;
}

body.robot-wallpaper-sidebar .sidebar-badge-actions {
    position: absolute;
    right: 11px;
    top: 50%;
    transform: translateY(-50%);
    width: 65px;
    height: 29px;
    gap: 5px;
    margin-left: 0;
    align-self: center;
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
}

body.robot-wallpaper-sidebar .user-badge::before {
    content: '';
    position: absolute;
    left: 16px;
    top: 50%;
    width: 43px;
    height: 43px;
    transform: translateY(-50%);
    border-radius: 13px;
    background:
        linear-gradient(145deg, rgba(211, 230, 247, 0.98), rgba(141, 166, 193, 0.96));
    border: 1px solid rgba(255, 255, 255, 0.86);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.9),
        0 0 0 1px rgba(66, 150, 236, 0.28),
        0 4px 10px rgba(15, 27, 45, 0.24);
}

body.robot-wallpaper-sidebar .user-badge > .fa-solid:first-child {
    position: absolute;
    left: 27px;
    top: 50%;
    z-index: 1;
    width: 21px;
    transform: translateY(-50%);
    color: #208def;
    font-size: 1rem;
    text-shadow: 0 0 11px rgba(52, 157, 255, 0.4);
}

body.robot-wallpaper-sidebar .sidebar-pin-btn,
body.robot-wallpaper-sidebar .sidebar-logout-btn {
    position: relative;
    width: 29px;
    height: 29px;
    min-width: 29px;
    margin: 0 !important;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    color: #9be0ff;
    background: linear-gradient(180deg, rgba(27, 42, 61, 0.98), rgba(7, 17, 31, 0.98));
    border: 1px solid rgba(134, 211, 255, 0.48);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 0 12px rgba(60, 178, 255, 0.28);
}

body.robot-wallpaper-sidebar .sidebar-pin-btn i,
body.robot-wallpaper-sidebar .sidebar-logout-btn i {
    width: 1em;
    height: 1em;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

body.robot-wallpaper-sidebar .sidebar-pin-btn.pinned {
    color: #ffffff;
    background:
        radial-gradient(circle at 50% 42%, rgba(129, 220, 255, 0.95) 0%, rgba(43, 153, 255, 0.88) 42%, rgba(10, 38, 79, 0.96) 100%);
    border-color: rgba(188, 237, 255, 0.94);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.5),
        0 0 0 2px rgba(77, 190, 255, 0.22),
        0 0 18px rgba(71, 190, 255, 0.86),
        0 0 34px rgba(37, 135, 255, 0.48);
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.86);
}

body.robot-wallpaper-sidebar .sidebar-pin-btn.pinned i {
    color: #ffffff;
}

body.robot-wallpaper-sidebar .sidebar-logout-btn {
    color: #7dd3ff;
    border-color: rgba(125, 211, 252, 0.44);
    background: linear-gradient(180deg, rgba(31, 48, 70, 0.98), rgba(7, 17, 31, 0.98));
}

body.robot-wallpaper-sidebar .sidebar-nav {
    position: relative;
    z-index: 1;
    padding: 4px 18px 14px;
    gap: 8px;
}

body.robot-wallpaper-sidebar .nav-section {
    margin-bottom: 8px;
}

body.robot-wallpaper-sidebar .section-toggle {
    height: 28px;
    padding: 0 7px;
    margin: 2px 0 5px;
    gap: 7px;
    border-radius: 9px;
    background: linear-gradient(90deg, rgba(19, 35, 57, 0.74), rgba(9, 22, 39, 0.18));
    border-top: 1px solid rgba(145, 218, 255, 0.22);
}

body.robot-wallpaper-sidebar .section-toggle::before {
    content: '';
    width: 9px;
    height: 9px;
    border-radius: 999px;
    background: #42c3ff;
    box-shadow: 0 0 0 3px rgba(66, 195, 255, 0.15), 0 0 12px rgba(66, 195, 255, 0.88);
    flex-shrink: 0;
}

body.robot-wallpaper-sidebar .section-icon-box {
    display: none;
}

body.robot-wallpaper-sidebar .section-title,
body.robot-wallpaper-sidebar .section-label {
    color: #e7f5ff !important;
    font-size: 0.9rem;
    font-weight: 850;
    letter-spacing: 0;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.72);
}

body.robot-wallpaper-sidebar .section-title::after,
body.robot-wallpaper-sidebar .section-label::after {
    content: '  AI ASSISTANT';
    color: rgba(169, 211, 242, 0.56);
    font-size: 0.48rem;
    font-weight: 800;
    letter-spacing: 0.5px;
}

body.robot-wallpaper-sidebar .nav-section:first-child .section-title::after { content: '  WORK MANAGEMENT'; }
body.robot-wallpaper-sidebar .nav-section:nth-child(2) .section-title::after { content: '  AI ASSISTANT'; }
body.robot-wallpaper-sidebar .nav-section:nth-child(3) .section-title::after { content: '  TAX ASSISTANT'; }
body.robot-wallpaper-sidebar .nav-section:nth-child(4) .section-title::after { content: '  COMMUNICATION'; }
body.robot-wallpaper-sidebar .section-label::after { content: '  CLIENTS'; }

body.robot-wallpaper-sidebar .section-chevron {
    margin-left: auto;
    color: #54c7ff;
    text-shadow: 0 0 8px rgba(84, 199, 255, 0.66);
}

body.robot-wallpaper-sidebar .nav-item {
    min-height: 58px;
    width: calc(100% - 10px);
    margin: 0 5px 7px;
    padding: 8px 11px;
    gap: 12px;
    border: 1px solid rgba(232, 242, 255, 0.48);
    border-radius: 12px;
    color: #18243a;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.52), rgba(176, 190, 209, 0.50));
    box-shadow:
        0 0 12px rgba(61, 187, 255, 0.12);
    position: relative;
}

body.robot-wallpaper-sidebar .section-items {
    padding-top: 4px;
}

body.robot-wallpaper-sidebar .nav-item::after {
    content: '\f105';
    margin-left: auto;
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    color: #1f5d89;
    font-size: 0.95rem;
    text-shadow: 0 0 8px rgba(49, 169, 255, 0.28);
}

body.robot-wallpaper-sidebar .nav-item:hover {
    transform: translateX(0.5px);
    border-color: rgba(114, 207, 255, 0.65);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.55), rgba(183, 198, 218, 0.52));
    box-shadow:
        0 0 0 1px rgba(83, 190, 255, 0.2),
        0 0 10px rgba(61, 187, 255, 0.16);
}

body.robot-wallpaper-sidebar .nav-item:active {
    transform: scale(0.965);
    background:
        linear-gradient(180deg, rgba(190, 212, 238, 0.65), rgba(155, 176, 202, 0.62));
    box-shadow:
        inset 0 2px 6px rgba(0, 25, 60, 0.28),
        0 0 6px rgba(61, 187, 255, 0.12);
    transition: transform 0.08s ease, box-shadow 0.08s ease, background 0.08s ease;
}

body.robot-wallpaper-sidebar .nav-item.active {
    transform: translateX(1px);
    border-color: rgba(114, 207, 255, 0.95);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.58), rgba(190, 207, 229, 0.54));
    box-shadow:
        0 0 0 1px rgba(83, 190, 255, 0.42),
        0 0 18px rgba(61, 187, 255, 0.28);
}

/* 메뉴 선택 시 외곽 형광 테두리선 (정적, 네온 코어) */
body.robot-wallpaper-sidebar .nav-item.active {
    outline: 2px solid rgba(130, 230, 255, 0.95);
    outline-offset: 1px;
}

body.robot-wallpaper-sidebar .nav-section:nth-child(1) {
    --section-glow: rgba(58, 165, 255, 0.46);
    --section-glow-soft: rgba(58, 165, 255, 0.17);
    --section-icon: #178ee9;
}

body.robot-wallpaper-sidebar .nav-section:nth-child(2) {
    --section-glow: rgba(151, 90, 255, 0.43);
    --section-glow-soft: rgba(151, 90, 255, 0.17);
    --section-icon: #7c3ff2;
}

body.robot-wallpaper-sidebar .nav-section:nth-child(3) {
    --section-glow: rgba(42, 184, 118, 0.40);
    --section-glow-soft: rgba(42, 184, 118, 0.16);
    --section-icon: #15985f;
}

body.robot-wallpaper-sidebar .nav-section:nth-child(4) {
    --section-glow: rgba(245, 150, 54, 0.40);
    --section-glow-soft: rgba(245, 150, 54, 0.16);
    --section-icon: #d67617;
}

body.robot-wallpaper-sidebar .nav-section:nth-child(-n+4) .nav-item {
    background:
        radial-gradient(circle at 18% 50%, var(--section-glow-soft) 0%, transparent 38%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.52), rgba(176, 190, 209, 0.50));
    border-color: rgba(232, 242, 255, 0.48);
    box-shadow:
        0 0 12px var(--section-glow-soft);
}

body.robot-wallpaper-sidebar .nav-section:nth-child(-n+4) .nav-item:hover,
body.robot-wallpaper-sidebar .nav-section:nth-child(-n+4) .nav-item.active {
    background:
        radial-gradient(circle at 18% 50%, var(--section-glow) 0%, transparent 42%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.58), rgba(190, 207, 229, 0.54));
    border-color: var(--section-glow);
    box-shadow:
        0 0 0 1px var(--section-glow-soft),
        0 0 18px var(--section-glow);
}

body.robot-wallpaper-sidebar .nav-section:nth-child(-n+4) .nav-item {
    border-width: 1px !important;
    border-style: solid !important;
    border-color: rgba(232, 242, 255, 0.42) !important;
    box-shadow: 0 0 10px var(--section-glow-soft) !important;
}

body.robot-wallpaper-sidebar .nav-section:nth-child(-n+4) .nav-item:hover,
body.robot-wallpaper-sidebar .nav-section:nth-child(-n+4) .nav-item.active {
    border-width: 1px !important;
    border-style: solid !important;
    border-color: var(--section-glow) !important;
    box-shadow: 0 0 16px var(--section-glow) !important;
}

/* active 테두리 형광 글로우(헤일로) — 시인성 강화. 정적이라 CPU 부담 없음 */
body.robot-wallpaper-sidebar .nav-section:nth-child(-n+4) .nav-item.active {
    box-shadow:
        0 0 0 1px var(--section-glow),
        0 0 7px var(--section-glow),
        0 0 15px var(--section-glow),
        0 0 26px var(--section-glow-soft) !important;
}

body.robot-wallpaper-sidebar .nav-section:nth-child(-n+4) .nav-item:active {
    transform: scale(0.965) !important;
    box-shadow:
        inset 0 2px 6px rgba(0, 25, 60, 0.28),
        0 0 8px var(--section-glow-soft) !important;
    transition: transform 0.08s ease, box-shadow 0.08s ease, background 0.08s ease;
}

body.robot-wallpaper-sidebar .nav-icon-box {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    color: #168ced;
    background:
        linear-gradient(145deg, rgba(226, 240, 252, 0.98), rgba(147, 172, 199, 0.96)) !important;
    border: 1px solid rgba(255, 255, 255, 0.88);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.92),
        0 0 0 1px rgba(52, 147, 236, 0.22),
        0 4px 10px rgba(15, 27, 45, 0.2);
}

body.robot-wallpaper-sidebar .nav-icon-box i,
body.robot-wallpaper-sidebar .nav-item i {
    color: #168ced;
}

body.robot-wallpaper-sidebar .nav-section:nth-child(-n+4) .nav-icon-box {
    color: var(--section-icon);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.92),
        inset 0 0 19px var(--section-glow-soft),
        0 0 0 1px var(--section-glow-soft),
        0 0 19px var(--section-glow-soft),
        0 4px 10px rgba(15, 27, 45, 0.2);
}

body.robot-wallpaper-sidebar .nav-section:nth-child(-n+4) .nav-icon-box i,
body.robot-wallpaper-sidebar .nav-section:nth-child(-n+4) .nav-item i,
body.robot-wallpaper-sidebar .nav-section:nth-child(-n+4) .nav-item::after {
    color: var(--section-icon);
}

body.robot-wallpaper-sidebar .nav-name {
    color: #142037 !important;
    font-size: 0.93rem;
    font-weight: 850;
}

body.robot-wallpaper-sidebar .nav-desc {
    color: rgba(24, 36, 58, 0.72) !important;
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: uppercase;
}

body.robot-wallpaper-sidebar #secretaryNavWidget {
    padding: 0 2px 7px !important;
}

body.robot-wallpaper-sidebar .sec-nav-bar {
    margin-left: 0;
    padding: 6px;
    border-radius: 15px;
    background: rgba(6, 17, 31, 0.58);
    border: 1px solid rgba(104, 190, 255, 0.22);
}

body.robot-wallpaper-sidebar .section-header-flex {
    padding: 3px 7px 6px;
}

body.robot-wallpaper-sidebar .search-wrap,
body.robot-wallpaper-sidebar .filter-select-wrap,
body.robot-wallpaper-sidebar .sort-filter-wrap,
body.robot-wallpaper-sidebar #filterManagerWrap {
    padding: 0 2px;
}

body.robot-wallpaper-sidebar .search-wrap {
    background: rgba(7, 20, 36, 0.68);
    border: 1px solid rgba(117, 203, 255, 0.26);
    border-radius: 6px; /* 아래 select(전체직원)와 동일하게 — 과한 라운딩 완화 */
}

body.robot-wallpaper-sidebar .search-wrap input,
body.robot-wallpaper-sidebar .sidebar-select,
body.robot-wallpaper-sidebar .btn-sort {
    color: #e7f5ff;
    background: rgba(7, 20, 36, 0.66);
    border-color: rgba(117, 203, 255, 0.26);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

/* 검색박스 안쪽 input은 투명·테두리 없이 → 바깥 알약(.search-wrap)만 단일 필드로 보이게 */
body.robot-wallpaper-sidebar .search-wrap input {
    background: transparent;
    border: none;
    box-shadow: none;
    color: #e7f5ff;
}

body.robot-wallpaper-sidebar .btn-sort.active {
    color: #ffffff;
    background: linear-gradient(180deg, rgba(59, 147, 235, 0.78), rgba(26, 80, 148, 0.74));
    border-color: rgba(123, 211, 255, 0.64);
}

body.robot-wallpaper-sidebar .btn-add-circle {
    color: #dff6ff;
    background: linear-gradient(180deg, rgba(52, 178, 255, 0.72), rgba(25, 72, 135, 0.74));
    border-color: rgba(151, 224, 255, 0.78);
    box-shadow: 0 0 14px rgba(61, 187, 255, 0.34);
}

body.robot-wallpaper-sidebar .company-list {
    padding: 2px;
}

body.robot-wallpaper-sidebar .company-item {
    color: #dcefff;
    background: rgba(9, 24, 43, 0.58);
    border-color: rgba(113, 197, 255, 0.2);
    border-radius: 12px;
}

body.robot-wallpaper-sidebar .company-item.ready-to-send {
    background:
        linear-gradient(90deg, rgba(34, 197, 94, 0.22), rgba(9, 24, 43, 0.62) 46%, rgba(9, 24, 43, 0.56));
    border-color: rgba(74, 222, 128, 0.32);
    border-left: 6px solid var(--green-indicator);
    box-shadow:
        inset 0 0 16px rgba(34, 197, 94, 0.10),
        0 0 12px rgba(34, 197, 94, 0.14);
}

body.robot-wallpaper-sidebar .company-item.all-sent {
    background:
        linear-gradient(90deg, rgba(239, 68, 68, 0.22), rgba(9, 24, 43, 0.62) 46%, rgba(9, 24, 43, 0.56));
    border-color: rgba(248, 113, 113, 0.32);
    border-left: 6px solid var(--danger);
    box-shadow:
        inset 0 0 16px rgba(239, 68, 68, 0.10),
        0 0 12px rgba(239, 68, 68, 0.14);
}

body.robot-wallpaper-sidebar .company-item:hover,
body.robot-wallpaper-sidebar .company-item.active-company {
    background: rgba(36, 104, 176, 0.50) !important;
    border-color: rgba(117, 203, 255, 0.46) !important;
}

body.robot-wallpaper-sidebar .company-item.ready-to-send:hover,
body.robot-wallpaper-sidebar .company-item.active-company.ready-to-send {
    background:
        linear-gradient(90deg, rgba(34, 197, 94, 0.30), rgba(36, 104, 176, 0.34) 52%, rgba(9, 24, 43, 0.58)) !important;
    border-color: rgba(74, 222, 128, 0.46) !important;
    border-left-color: var(--green-indicator) !important;
}

body.robot-wallpaper-sidebar .company-item.all-sent:hover,
body.robot-wallpaper-sidebar .company-item.active-company.all-sent {
    background:
        linear-gradient(90deg, rgba(239, 68, 68, 0.30), rgba(36, 104, 176, 0.34) 52%, rgba(9, 24, 43, 0.58)) !important;
    border-color: rgba(248, 113, 113, 0.46) !important;
    border-left-color: var(--danger) !important;
}

body.robot-wallpaper-sidebar .mobile-sidebar-footer {
    background: rgba(5, 13, 25, 0.86) !important;
    border-top-color: rgba(125, 205, 255, 0.24) !important;
}

/* Cyber neon sidebar section labels */
.section-toggle[data-section="work"],
.section-toggle[data-section="ai"],
.section-toggle[data-section="tax"],
.section-toggle[data-section="comm"],
body.robot-wallpaper-sidebar .section-toggle[data-section="work"],
body.robot-wallpaper-sidebar .section-toggle[data-section="ai"],
body.robot-wallpaper-sidebar .section-toggle[data-section="tax"],
body.robot-wallpaper-sidebar .section-toggle[data-section="comm"] {
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
}

.section-toggle[data-section="work"] .section-title {
    color: #38d8ff !important;
    text-shadow: 0 1px 0 rgba(2, 8, 18, 0.92), 0 -1px 0 rgba(183, 244, 255, 0.28), 0 0 10px rgba(56, 216, 255, 0.58);
}

.section-toggle[data-section="ai"] .section-title {
    color: #d67cff !important;
    text-shadow: 0 1px 0 rgba(2, 8, 18, 0.92), 0 -1px 0 rgba(244, 214, 255, 0.28), 0 0 10px rgba(214, 124, 255, 0.58);
}

.section-toggle[data-section="tax"] .section-title {
    color: #4cff9b !important;
    text-shadow: 0 1px 0 rgba(2, 8, 18, 0.92), 0 -1px 0 rgba(202, 255, 225, 0.26), 0 0 10px rgba(76, 255, 155, 0.54);
}

.section-toggle[data-section="comm"] .section-title {
    color: #ffb347 !important;
    text-shadow: 0 1px 0 rgba(2, 8, 18, 0.92), 0 -1px 0 rgba(255, 235, 199, 0.28), 0 0 10px rgba(255, 179, 71, 0.56);
}

body.robot-wallpaper-sidebar .section-toggle[data-section="work"]::before {
    background: #38d8ff;
    box-shadow: 0 0 0 3px rgba(56, 216, 255, 0.16), 0 0 14px rgba(56, 216, 255, 0.92);
}

body.robot-wallpaper-sidebar .section-toggle[data-section="ai"]::before {
    background: #d67cff;
    box-shadow: 0 0 0 3px rgba(214, 124, 255, 0.16), 0 0 14px rgba(214, 124, 255, 0.92);
}

body.robot-wallpaper-sidebar .section-toggle[data-section="tax"]::before {
    background: #4cff9b;
    box-shadow: 0 0 0 3px rgba(76, 255, 155, 0.16), 0 0 14px rgba(76, 255, 155, 0.9);
}

body.robot-wallpaper-sidebar .section-toggle[data-section="comm"]::before {
    background: #ffb347;
    box-shadow: 0 0 0 3px rgba(255, 179, 71, 0.16), 0 0 14px rgba(255, 179, 71, 0.92);
}

body.robot-wallpaper-sidebar .section-toggle[data-section="work"] .section-title::after {
    color: rgba(56, 216, 255, 0.68);
    text-shadow: 0 0 8px rgba(56, 216, 255, 0.52);
}

body.robot-wallpaper-sidebar .section-toggle[data-section="ai"] .section-title::after {
    color: rgba(214, 124, 255, 0.68);
    text-shadow: 0 0 8px rgba(214, 124, 255, 0.52);
}

body.robot-wallpaper-sidebar .section-toggle[data-section="tax"] .section-title::after {
    color: rgba(76, 255, 155, 0.66);
    text-shadow: 0 0 8px rgba(76, 255, 155, 0.48);
}

body.robot-wallpaper-sidebar .section-toggle[data-section="comm"] .section-title::after {
    color: rgba(255, 179, 71, 0.68);
    text-shadow: 0 0 8px rgba(255, 179, 71, 0.52);
}

@media (max-width: 860px) {
    body.robot-wallpaper-sidebar .sidebar {
        width: min(306px, 86vw);
    }
}

/* Global quick right-click lookup */
