/* 띠용 메인 스타일 */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji';
    line-height: 1.5715;
    color: rgba(0, 0, 0, 0.85);
    background-color: #f0f2f5;
}

#app {
    height: 100vh;
    overflow: hidden;
    display: flex;
}

/* Layout */
.ant-layout {
    display: flex;
    flex: auto;
    flex-direction: row;
    height: 100vh;
}

.ant-layout.ant-layout-has-sider {
    flex-direction: row;
}

.main-layout {
    display: flex;
    flex: 1;
    flex-direction: column;
    height: 100vh;
}

.ant-layout-sider {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    min-width: 0;
    background: #001529;
    transition: all 0.2s;
    width: 200px;
    z-index: 100;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.ant-layout-sider.collapsed {
    width: 80px;
}

.ant-layout-sider.collapsed + .main-layout .ant-layout-header {
    left: 80px;
}

.ant-layout-sider.collapsed + .main-layout .ant-layout-content {
    margin-left: 80px;
}

.ant-layout-sider.collapsed + .main-layout .ant-layout-footer {
    left: 80px;
}

/* 접힌 상태 - 로고 아이콘 중앙 정렬 */
.ant-layout-sider.collapsed .logo {
    justify-content: center;
    padding: 16px;
}
.ant-layout-sider.collapsed .logo i {
    margin-right: 0;
}

/* 접힌 상태 - 메뉴 아이콘 중앙 정렬 */
.ant-layout-sider.collapsed .ant-menu-item,
.ant-layout-sider.collapsed .ant-menu-submenu-title {
    padding: 0;
    justify-content: center;
}
.ant-layout-sider.collapsed .ant-menu-item > a {
    justify-content: center;
    width: 100%;
}
/* 접힌 상태 - 텍스트·화살표 숨김 */
.ant-layout-sider.collapsed .ant-menu-item > a > span,
.ant-layout-sider.collapsed .ant-menu-submenu-title > span,
.ant-layout-sider.collapsed .ant-menu-submenu-arrow {
    display: none;
}
/* 접힌 상태 - 아이콘 margin 제거 */
.ant-layout-sider.collapsed .ant-menu-item > a > i,
.ant-layout-sider.collapsed .ant-menu-submenu-title > i:first-child {
    margin-right: 0;
    font-size: 16px;
    width: auto;
}
/* 접힌 상태 - 서브메뉴 강제 닫기 */
.ant-layout-sider.collapsed .ant-menu-sub {
    display: none !important;
}

.ant-layout-header {
    position: fixed;
    top: 0;
    left: 200px;
    right: 0;
    background: #fff;
    padding: 0;
    height: 64px;
    line-height: 64px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 1px 4px rgba(0,21,41,.08);
    z-index: 99;
}

.ant-layout-content {
    margin-left: 200px;
    margin-top: 64px;
    margin-bottom: 64px;
    padding: 20px;
    overflow-y: auto;
    height: calc(100vh - 128px);
    background: #f0f2f5;
}

.ant-layout-footer {
    position: fixed;
    bottom: 0;
    left: 200px;
    right: 0;
    background: #fff;
    border-top: 1px solid #f0f0f0;
    height: 64px;
    display: flex;
    align-items: center;
    z-index: 99;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 0 24px;
    color: rgba(0, 0, 0, 0.65);
    font-size: 14px;
}

.main-content {
    min-height: 100%;
}

/* Logo */
.logo {
    height: 64px;
    padding: 16px 24px;
    display: flex;
    align-items: center;
    /* background: rgba(255, 255, 255, 0.3); */
    margin-bottom: 1px;
}

.logo i {
    color: #1890ff;
    font-size: 24px;
    margin-right: 12px;
}

.logo-text {
    color: #fff;
    font-size: 18px;
    font-weight: bold;
}

.ant-layout-sider.collapsed .logo-text {
    display: none;
}

/* Menu */
.ant-menu {
    list-style: none;
    padding: 0;
    margin: 0;
    line-height: 0;
    border: none;
    box-shadow: none;
    background: transparent;
}

.ant-menu-dark {
    background: #001529;
    color: rgba(255, 255, 255, 0.65);
}

.ant-menu-item,
.ant-menu-submenu-title {
    margin: 0;
    padding: 0 24px;
    height: 40px;
    line-height: 40px;
    display: flex;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
}

.ant-menu-item a,
.ant-menu-submenu-title {
    color: rgba(255, 255, 255, 0.65);
    text-decoration: none;
    display: flex;
    align-items: center;
    width: 100%;
}

.ant-menu-item:hover,
.ant-menu-submenu-title:hover {
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.85);
}

.ant-menu-item:hover a {
    color: rgba(255, 255, 255, 0.85);
}

.ant-menu-item.ant-menu-item-selected {
    background: #1890ff;
    color: #fff;
}

.ant-menu-item.ant-menu-item-selected a {
    color: #fff;
}

.ant-menu-item i,
.ant-menu-submenu-title i {
    margin-right: 12px;
    font-size: 14px;
    width: 14px;
    text-align: center;
}

.ant-menu-submenu-arrow {
    margin-left: auto;
    margin-right: 0;
    transition: transform 0.3s;
}

.ant-menu-submenu.open .ant-menu-submenu-arrow {
    transform: rotate(90deg);
}

/* Submenu */
.ant-menu-sub {
    display: none;
    background: rgba(0, 0, 0, 0.1);
    padding: 0;
}

.ant-menu-submenu.open .ant-menu-sub {
    display: block;
}

.ant-menu-sub .ant-menu-item {
    padding-left: 48px;
    height: 36px;
    line-height: 36px;
}

.ant-menu-sub .ant-menu-item a {
    font-size: 13px;
}

/* Menu Item Group */
.ant-menu-item-group {
    margin: 8px 0;
}

.ant-menu-item-group-title {
    padding: 0 24px 0 48px;
    font-size: 12px;
    line-height: 24px;
    color: rgba(255, 255, 255, 0.45);
    font-weight: 500;
}

.ant-menu-item-group-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.ant-menu-item-group-list .ant-menu-item {
    padding-left: 60px;
    height: 32px;
    line-height: 32px;
}

.ant-menu-item-group-list .ant-menu-item a {
    font-size: 13px;
}

/* Header */
.header-left {
    display: flex;
    align-items: center;
}

.header-right {
    display: flex;
    align-items: center;
}

.ant-btn {
    line-height: 1.5715;
    position: relative;
    display: inline-block;
    font-weight: 400;
    white-space: nowrap;
    text-align: center;
    background-image: none;
    border: 1px solid transparent;
    box-shadow: 0 2px 0 rgba(0, 0, 0, 0.015);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.645, 0.045, 0.355, 1);
    user-select: none;
    touch-action: manipulation;
    height: 32px;
    padding: 4px 15px;
    font-size: 14px;
    border-radius: 6px;
    outline: 0;
}

.ant-btn-text {
    color: rgba(0, 0, 0, 0.85);
    background: transparent;
    border-color: transparent;
    box-shadow: none;
}

.ant-btn-text:hover {
    color: #40a9ff;
    background: rgba(0, 0, 0, 0.018);
}

#sidebarToggle {
    margin-right: 16px;
    border: none;
    background: none;
    font-size: 16px;
}

/* Breadcrumb */
.ant-breadcrumb {
    color: rgba(0, 0, 0, 0.75);
    font-size: 21px;
    font-weight: 700;
}

.ant-breadcrumb-link {
    color: rgba(0, 0, 0, 0.75);
}

.ant-breadcrumb-separator {
    color: rgba(0, 0, 0, 0.35);
    font-weight: 400;
}

/* Dropdown */
.ant-dropdown {
    position: relative;
}

.ant-dropdown-trigger {
    color: rgba(0, 0, 0, 0.65);
    text-decoration: none;
    display: flex;
    align-items: center;
    padding: 0 12px;
    transition: all 0.3s;
}

.ant-dropdown-trigger:hover {
    color: #1890ff;
    background: rgba(0, 0, 0, 0.025);
}

.ant-dropdown-trigger i {
    margin: 0 4px;
}

.ant-dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    z-index: 1050;
    display: none;
    float: left;
    min-width: 160px;
    padding: 4px 0;
    margin: 8px 0 0;
    list-style: none;
    background-color: #fff;
    background-clip: padding-box;
    border-radius: 6px;
    box-shadow: 0 3px 6px -4px rgba(0, 0, 0, 0.12), 0 6px 16px 0 rgba(0, 0, 0, 0.08), 0 9px 28px 8px rgba(0, 0, 0, 0.05);
}

.ant-dropdown.show .ant-dropdown-menu {
    display: block;
}

.ant-dropdown-menu-item {
    clear: both;
    color: rgba(0, 0, 0, 0.85);
    font-weight: normal;
    line-height: 22px;
    padding: 5px 12px;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    display: flex;
    align-items: center;
}

.ant-dropdown-menu-item:hover {
    background-color: #f5f5f5;
}

.ant-dropdown-menu-item i {
    margin-right: 8px;
}

.ant-dropdown-menu-divider {
    height: 1px;
    margin: 4px 0;
    overflow: hidden;
    background-color: #f0f0f0;
}

/* Main Content */
.main-content {
    background: #fff;
    padding: 24px;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24);
    height: 100%;
    overflow-y: auto;
}

/* 화면 상단 Tip 배너 (메뉴별 간단 안내) */
.page-tip {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #e6f7ff;
    border: 1px solid #91d5ff;
    border-radius: 6px;
    padding: 10px 16px;
    margin-bottom: 16px;
    font-size: 13px;
    line-height: 1.5;
    color: rgba(0, 0, 0, 0.75);
    flex-shrink: 0;
}
.page-tip i {
    color: #1890ff;
    font-size: 14px;
    flex-shrink: 0;
}

/* Cards */
.ant-card {
    position: relative;
    background: #fff;
    border-radius: 6px;
    border: 1px solid #f0f0f0;
    margin-bottom: 16px;
}

.ant-card-head {
    padding: 0 24px;
    border-bottom: 1px solid #f0f0f0;
    border-radius: 6px 6px 0 0;
    min-height: 48px;
    display: flex;
    align-items: center;
}

.ant-card-head-title {
    font-size: 16px;
    font-weight: 500;
    color: rgba(0, 0, 0, 0.85);
}

.ant-card-body {
    padding: 24px;
}

/* Responsive */
@media (max-width: 768px) {
    .ant-layout-sider {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        z-index: 999;
        transform: translateX(-100%);
        transition: transform 0.3s;
    }
    
    .ant-layout-sider.mobile-open {
        transform: translateX(0);
    }
    
    .ant-layout-header {
        left: 0;
        padding: 0 16px;
    }
    
    .ant-layout-content {
        margin-left: 0;
        padding: 16px;
    }
    
    .ant-layout-footer {
        left: 0;
    }
    
    .main-content {
        padding: 16px;
    }
}

/* Utility Classes */
.text-center { text-align: center; }
.text-right { text-align: right; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }

/* Colors */
.text-primary { color: #1890ff; }
.text-success { color: #52c41a; }
.text-warning { color: #faad14; }
.text-error { color: #ff4d4f; }
.text-secondary { color: rgba(0, 0, 0, 0.45); }

/* Grid System */
.row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -8px;
}

.col {
    padding: 0 8px;
    margin-bottom: 16px;
}

.col-6 { flex: 0 0 25%; }
.col-8 { flex: 0 0 33.333333%; }
.col-12 { flex: 0 0 50%; }
.col-16 { flex: 0 0 66.666667%; }
.col-18 { flex: 0 0 75%; }
.col-24 { flex: 0 0 100%; }

/* Card Component */
.card {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.card-head {
    padding: 16px 24px;
    border-bottom: 1px solid #f0f0f0;
}

.card-head-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-head-title {
    font-size: 16px;
    font-weight: 500;
    color: rgba(0, 0, 0, 0.85);
}

.card-extra {
    font-size: 14px;
}

.card-body {
    padding: 24px;
}

@media (max-width: 768px) {
    .col-6, .col-8, .col-12, .col-16, .col-18 {
        flex: 0 0 100%;
    }
}

/* =============================================
   사이드바 플라이아웃 메뉴 (접힌 상태 hover)
   ============================================= */
.sidebar-flyout {
    position: fixed;
    left: 80px;
    top: 0;
    background: #001529;
    min-width: 180px;
    box-shadow: 4px 0 10px rgba(0, 0, 0, 0.4);
    z-index: 200;
    display: none;
    border-radius: 0 4px 4px 0;
    overflow: hidden;
}
.sidebar-flyout.show {
    display: block;
}
.sidebar-flyout-title {
    padding: 10px 16px;
    color: rgba(255, 255, 255, 0.9);
    font-size: 13px;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.06);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    white-space: nowrap;
}
.sidebar-flyout-item {
    display: block;
    padding: 8px 16px;
    color: rgba(255, 255, 255, 0.65);
    font-size: 13px;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}
.sidebar-flyout-item:hover {
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
}
.sidebar-flyout-item.active {
    color: #1890ff;
}
.sidebar-flyout-item.sidebar-flyout-single {
    padding: 10px 16px;
    font-weight: 500;
}
.sidebar-flyout-group-title {
    padding: 8px 16px 4px;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.4);
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    white-space: nowrap;
}

/* =============================================
   Utility
   ============================================= */
.d-none { display: none !important; }

/* =============================================
   헤더 중앙 바로가기 바
   ============================================= */
.ant-layout-header {
    justify-content: space-between;
    gap: 0;
}
.header-left  { flex-shrink: 0; display: flex; align-items: center; gap: 8px; }
.header-right { flex-shrink: 0; display: flex; align-items: center; gap: 6px; }

/* 슈퍼관리자 회사 전환 스위처 */
.company-switcher {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-right: 10px;
    padding-right: 10px;
    border-right: 1px solid rgba(0, 0, 0, 0.08);
    color: rgba(0, 0, 0, 0.45);
}

.company-switcher select {
    height: 32px;
    max-width: 180px;
    line-height: normal;
}

/* 스크롤 컨테이너 + + 버튼 묶음 */
.sc-bar {
    display: flex;
    align-items: center;
    gap: 0;
    position: relative;
}

.header-shortcuts {
    position: relative;
    display: flex;
    align-items: center;
    overflow-x: auto;
    overflow-y: hidden;
    max-width: 640px;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.header-shortcuts::-webkit-scrollbar { display: none; }

/* 오른쪽에 더 있음을 나타내는 페이드 */
.header-shortcuts::after {
    content: '';
    position: sticky;
    right: 0;
    top: 0;
    flex-shrink: 0;
    width: 32px;
    height: 100%;
    background: linear-gradient(to right, transparent, #fff);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s;
}
.header-shortcuts.has-more::after { opacity: 1; }

.shortcut-items {
    display: flex;
    align-items: center;
    gap: 3px;
    flex-wrap: nowrap;
    flex-shrink: 0;
    padding-right: 4px;
}

.shortcut-item {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 10px;
    color: rgba(0,0,0,.55);
    text-decoration: none;
    border: 1px solid #e8e8e8;
    background: #fafafa;
    white-space: nowrap;
    transition: all 0.15s;
    position: relative;
    line-height: 1.2;
    min-width: 40px;
}
.shortcut-item:hover {
    border-color: #1890ff;
    color: #1890ff;
    background: #e6f7ff;
    text-decoration: none;
}
.shortcut-item i { font-size: 15px; }

/* + 버튼: sc-bar 우측 고정 */
.shortcut-add-btn {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 1px dashed #d9d9d9;
    background: #fff;
    color: rgba(0,0,0,.35);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    transition: all 0.15s;
    margin-left: 4px;
    opacity: 0.5;
}
.sc-bar:hover .shortcut-add-btn,
.shortcut-add-btn:hover {
    opacity: 1;
    border-color: #1890ff;
    color: #1890ff;
}

.shortcut-item.sc-dragging {
    opacity: 0.35;
    cursor: grabbing;
}
.shortcut-item.sc-dragover {
    border-color: #1890ff;
    background: #bae7ff;
    color: #096dd9;
}
.shortcut-item[draggable="true"] { cursor: grab; }

/* =============================================
   바로가기 모달
   ============================================= */
.shortcut-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}
.shortcut-modal.d-none { display: none !important; }

.shortcut-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,.45);
}

.shortcut-modal-box {
    position: relative;
    background: #fff;
    border-radius: 8px;
    width: 520px;
    max-width: 90vw;
    box-shadow: 0 8px 32px rgba(0,0,0,.18);
    z-index: 1;
}

.shortcut-modal-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #f0f0f0;
    font-size: 15px;
    font-weight: 600;
}
.shortcut-modal-head i { color: #faad14; margin-right: 6px; }

.shortcut-modal-close {
    background: none;
    border: none;
    font-size: 16px;
    color: rgba(0,0,0,.45);
    cursor: pointer;
    padding: 0 4px;
}
.shortcut-modal-close:hover { color: rgba(0,0,0,.85); }

.shortcut-modal-desc {
    padding: 10px 20px 4px;
    font-size: 12px;
    color: rgba(0,0,0,.45);
}

.shortcut-menu-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    padding: 16px 20px 20px;
    max-height: 360px;
    overflow-y: auto;
}

.shortcut-menu-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 12px 8px;
    border: 1px solid #f0f0f0;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s;
    font-size: 12px;
    color: rgba(0,0,0,.65);
    background: #fafafa;
}
.shortcut-menu-item:hover {
    border-color: #1890ff;
    color: #1890ff;
    background: #e6f7ff;
}
.shortcut-menu-item.is-added {
    border-color: #b7eb8f;
    background: #f6ffed;
    color: #52c41a;
}
.shortcut-menu-item i { font-size: 20px; }
.shortcut-menu-item span { text-align: center; line-height: 1.3; }

/* 내 프로필 사이드바 항목 (메뉴 테이블 외, 하단 고정) */
#sideMenu {
    display: block;
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    min-height: 0;
}
.side-profile-item {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    height: 44px;
    padding: 0 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.5);
    text-decoration: none;
    font-size: 14px;
    transition: all 0.3s;
    cursor: pointer;
}
.side-profile-item i {
    margin-right: 12px;
    font-size: 14px;
    width: 14px;
    text-align: center;
}
.side-profile-item:hover {
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.85);
}
.side-profile-item.active {
    background: #1890ff;
    color: #fff;
}
/* 접힌 상태에서 프로필 �시 */
.ant-layout-sider.collapsed .side-profile-item {
    padding: 0;
    justify-content: center;
}
.ant-layout-sider.collapsed .side-profile-item i {
    margin-right: 0;
    font-size: 18px;
    width: auto;
}
.ant-layout-sider.collapsed .side-profile-item span {
    display: none;
}
}