@charset "UTF-8";
/* ==============================================================
   오메가 ERP 공통 스타일
   - 헤더 / 사이드바 / 콘텐츠 / 상태바 전체 레이아웃
   - 디자인 톤: 네이비 + 화이트, Noto Sans KR + Bootstrap 5.3
   ============================================================== */

/* ===== 1. 디자인 토큰 ===== */
:root {
    --c-primary:        #2c3e7a;   /* 진한 네이비 (헤더 텍스트, 활성 강조) */
    --c-primary-mid:    #4a6fa5;   /* 중간 네이비 (메인 액센트) */
    --c-primary-soft:   #e9eef7;   /* 옅은 파란 배경 */
    --c-primary-hover:  #f0f4fc;
    --c-danger:         #c13a3a;
    --c-warning:        #c08400;
    --c-success:        #2f8a3e;
    --c-text:           #2a2f3a;
    --c-text-muted:     #6b7280;
    --c-border:         #d8dee8;
    --c-border-light:   #e5e9ef;
    --c-bg:             #f5f7fa;
    --c-bg-card:        #ffffff;

    --header-h:         48px;
    --footer-h:         28px;
    --sidebar-w:        160px;
    --sidebar-w-mini:   56px;

    --shadow-sm:        0 1px 2px rgba(20,30,60,.06);
    --shadow-md:        0 2px 8px rgba(20,30,60,.08);
    --shadow-lg:        0 6px 16px rgba(20,30,60,.10);

    --radius-sm:        4px;
    --radius-md:        6px;
    --radius-lg:        8px;

    --t-fast:           120ms;
    --t-mid:            220ms;
}

/* ===== 2. 사이드바 접힘 상태 깜빡임 방지 (HTML 단계) ===== */
html.pre-sidebar-collapsed .app-sidebar { width: var(--sidebar-w-mini) !important; }
html.pre-sidebar-collapsed .content,
html.pre-sidebar-collapsed .app-footer { padding-left: var(--sidebar-w-mini) !important; }

/* ===== 3. 베이스 ===== */
* { box-sizing: border-box; }
html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    font-family: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
    font-size: 13px;
    color: var(--c-text);
    background: var(--c-bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }

/* ===== 4. 앱 셸 ===== */
.app {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
.app-body {
    flex: 1 1 auto;
    display: flex;
    min-height: 0;
}

/* ============================================================
   5. 헤더
   ============================================================ */
.app-header {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: var(--header-h);
    background: #ffffff;
    border-bottom: 1px solid var(--c-border);
    display: flex;
    align-items: center;
    padding: 0 12px;
    z-index: 50;
    box-shadow: var(--shadow-sm);
}
.app .app-body { padding-top: var(--header-h); }

/* 좌측: 햄버거 + 로고 */
.header-left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 0 0 auto;
    width: var(--sidebar-w);
    padding-right: 12px;
    border-right: 1px solid var(--c-border-light);
}
.btn-hamburger {
    width: 36px; height: 36px;
    border: none;
    background: transparent;
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 4px;
    transition: background var(--t-fast);
}
.btn-hamburger:hover { background: var(--c-primary-soft); }
.btn-hamburger span {
    display: block;
    width: 18px;
    height: 2px;
    background: var(--c-primary);
    border-radius: 2px;
}
.brand {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 700;
    color: var(--c-primary);
}
.brand-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px; height: 26px;
    background: var(--c-primary);
    color: #fff;
    border-radius: 50%;
    font-size: 15px;
    font-weight: 700;
}
.brand-name {
    font-size: 15px;
    letter-spacing: .02em;
}

/* 가운데: 즐겨찾기 메뉴 */
.header-quick {
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 0 12px;
    overflow-x: auto;
    scrollbar-width: thin;
}
.header-quick::-webkit-scrollbar { height: 4px; }
.header-quick::-webkit-scrollbar-thumb { background: #cfd6e1; border-radius: 4px; }

.quick-item {
    flex: 0 0 auto;
    padding: 6px 12px;
    font-size: 13px;
    color: var(--c-text);
    border-radius: var(--radius-sm);
    transition: all var(--t-fast);
    white-space: nowrap;
    border: 1px solid transparent;
}
.quick-item:hover {
    background: var(--c-primary-soft);
    color: var(--c-primary);
}
.quick-item.active {
    background: var(--c-primary-soft);
    color: var(--c-primary);
    font-weight: 600;
    border-color: #c8d6ee;
}
.quick-edit {
    margin-left: auto;
    color: var(--c-text-muted);
    padding: 6px 8px;
}
.quick-edit:hover {
    background: var(--c-primary-soft);
    color: var(--c-primary);
}

/* 우측: 사용자 정보 + 로그아웃 */
.header-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 0 0 auto;
    padding-left: 8px;
    border-left: 1px solid var(--c-border-light);
}
.user-info {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    line-height: 1.2;
    text-align: right;
}
.user-info strong {
    font-size: 13px;
    color: var(--c-primary);
    font-weight: 600;
}
.user-info small {
    font-size: 11px;
    color: var(--c-text-muted);
}
.btn-logout {
    width: 32px; height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    color: var(--c-text-muted);
    transition: all var(--t-fast);
}
.btn-logout:hover {
    background: #fee;
    color: var(--c-danger);
}

/* ============================================================
   6. 사이드바
   ============================================================ */
.app-sidebar {
    position: fixed;
    top: var(--header-h);
    left: 0;
    bottom: var(--footer-h);
    width: var(--sidebar-w);
    background: #ffffff;
    border-right: 1px solid var(--c-border);
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 40;
    transition: width var(--t-mid) ease;
}
.app-sidebar::-webkit-scrollbar { width: 6px; }
.app-sidebar::-webkit-scrollbar-thumb {
    background: #d0d7e2; border-radius: 4px;
}
.app-sidebar::-webkit-scrollbar-track { background: transparent; }

.sidebar-nav { padding: 8px 0; }
.menu-root {
    list-style: none;
    margin: 0;
    padding: 0;
}

/* ----- 그룹(대분류) ----- */
.menu-group { position: relative; }
.menu-group-btn {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 14px;
    border: none;
    background: transparent;
    text-align: left;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    color: var(--c-text);
    transition: background var(--t-fast);
}
.menu-group-btn:hover { background: var(--c-primary-soft); }
.menu-group.open > .menu-group-btn { color: var(--c-primary); }

.menu-ico {
    flex: 0 0 auto;
    width: 22px;
    text-align: center;
    font-size: 14px;
}
.menu-label { flex: 1 1 auto; }

.menu-arrow {
    flex: 0 0 auto;
    width: 0; height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid var(--c-text-muted);
    transition: transform var(--t-mid);
}
.menu-group.open > .menu-group-btn .menu-arrow {
    transform: rotate(180deg);
    border-top-color: var(--c-primary);
}

.menu-children {
    list-style: none;
    margin: 0;
    padding: 2px 0 6px 0;
    display: none;
    background: #fafbfc;
}
.menu-group.open > .menu-children { display: block; }

/* ----- 메뉴 아이템 ----- */
.menu-item {
    display: block;
    padding: 7px 14px 7px 36px;
    font-size: 12.5px;
    color: var(--c-text);
    transition: all var(--t-fast);
    border-left: 3px solid transparent;
}
.menu-item:hover {
    background: var(--c-primary-soft);
    color: var(--c-primary);
}
.menu-item.active {
    background: var(--c-primary-mid);
    color: #fff;
    font-weight: 600;
    border-left-color: var(--c-primary);
}

/* ----- 서브 메뉴 (중분류) ----- */
.menu-sub { list-style: none; }
.menu-sub-btn {
    width: 100%;
    display: flex;
    align-items: center;
    padding: 7px 14px 7px 36px;
    border: none;
    background: transparent;
    text-align: left;
    cursor: pointer;
    font-size: 12.5px;
    color: var(--c-text);
    transition: all var(--t-fast);
}
.menu-sub-btn:hover {
    background: var(--c-primary-soft);
    color: var(--c-primary);
}
.menu-sub.open > .menu-sub-btn {
    color: var(--c-primary);
    font-weight: 600;
}
.menu-arrow-sm {
    margin-left: auto;
    width: 0; height: 0;
    border-left: 3px solid transparent;
    border-right: 3px solid transparent;
    border-top: 4px solid var(--c-text-muted);
    transition: transform var(--t-mid);
}
.menu-sub.open > .menu-sub-btn .menu-arrow-sm {
    transform: rotate(180deg);
    border-top-color: var(--c-primary);
}
.menu-sub-children {
    list-style: none;
    margin: 0;
    padding: 0;
    display: none;
    background: #f3f5f9;
}
.menu-sub.open > .menu-sub-children { display: block; }
.menu-sub-children .menu-item {
    padding-left: 50px;
    font-size: 12px;
}

/* ----- 사이드바 미니 모드 (collapsed) ----- */
body.sidebar-collapsed .app-sidebar { width: var(--sidebar-w-mini); }
body.sidebar-collapsed .app-sidebar .menu-label,
body.sidebar-collapsed .app-sidebar .menu-arrow,
body.sidebar-collapsed .app-sidebar .menu-children {
    display: none;
}
body.sidebar-collapsed .app-sidebar .menu-group-btn {
    justify-content: center;
    padding: 12px 0;
}
body.sidebar-collapsed .app-sidebar .menu-group-btn:hover {
    background: var(--c-primary-soft);
}
body.sidebar-collapsed .app-sidebar .menu-group-btn:hover::after {
    /* 미니 모드에서 그룹명 툴팁 (선택) */
    content: attr(data-label);
}
body.sidebar-collapsed .header-left {
    width: var(--sidebar-w-mini);
}
body.sidebar-collapsed .content,
body.sidebar-collapsed .app-footer {
    padding-left: var(--sidebar-w-mini);
}

/* ============================================================
   7. 콘텐츠 영역
   ============================================================ */
.content {
    flex: 1 1 auto;
    padding-left: var(--sidebar-w);
    transition: padding-left var(--t-mid) ease;
    min-width: 0;
    display: flex;
    flex-direction: column;
}
.content-header {
    flex: 0 0 auto;
    padding: 14px 18px 8px 18px;
    background: var(--c-bg);
}
.page-title {
    margin: 0;
    font-size: 17px;
    font-weight: 700;
    color: var(--c-primary);
    letter-spacing: -.01em;
}
.content-body {
    flex: 1 1 auto;
    padding: 0 18px 18px 18px;
    min-height: 0;
    overflow: auto;
}

/* ============================================================
   8. 상태바 (footer)
   ============================================================ */
.app-footer {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    height: var(--footer-h);
    background: #ffffff;
    border-top: 1px solid var(--c-border);
    padding-left: var(--sidebar-w);
    transition: padding-left var(--t-mid) ease;
    z-index: 30;
    font-size: 11.5px;
    color: var(--c-text-muted);
}
.statusbar {
    height: 100%;
    display: flex;
    align-items: center;
    padding: 0 12px;
    gap: 12px;
}
.status-section {
    display: flex;
    align-items: center;
    gap: 6px;
    height: 100%;
    padding: 0 8px;
    border-right: 1px solid var(--c-border-light);
}
.status-section:last-child { border-right: none; }
.status-section.flex-grow { flex: 1 1 auto; min-width: 0; }
.status-section.right { margin-left: auto; }

.status-label {
    font-weight: 600;
    color: var(--c-text);
}
.status-dot {
    display: inline-block;
    width: 7px; height: 7px;
    border-radius: 50%;
    background: var(--c-success);
    box-shadow: 0 0 4px rgba(47,138,62,.5);
    animation: pulseDot 2s ease-in-out infinite;
}
.status-dot.offline {
    background: var(--c-text-muted);
    box-shadow: none;
    animation: none;
}
.status-dot.warn {
    background: var(--c-warning);
    box-shadow: 0 0 4px rgba(192,132,0,.5);
}
@keyframes pulseDot {
    0%, 100% { opacity: 1; }
    50% { opacity: .4; }
}

/* 진행 표시 (예: 저장 중) */
.status-progress {
    flex: 1 1 auto;
    height: 4px;
    background: #e8edf5;
    border-radius: 2px;
    overflow: hidden;
    position: relative;
    max-width: 200px;
    display: none;          /* 기본 숨김, JS에서 .active 추가 */
}
.status-progress.active { display: block; }
.status-progress-bar {
    position: absolute;
    top: 0; left: 0;
    height: 100%;
    width: 30%;
    background: linear-gradient(90deg, var(--c-primary-mid), var(--c-primary));
    border-radius: 2px;
    animation: slideBar 1.6s ease-in-out infinite;
}
@keyframes slideBar {
    0%   { left: -30%; }
    100% { left: 100%; }
}

/* 알림 배지 */
.status-alert {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 1px 8px;
    background: #fff4d4;
    color: #8a6900;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}
.status-alert.danger {
    background: #ffe0e4;
    color: var(--c-danger);
}
.status-alert.info {
    background: var(--c-primary-soft);
    color: var(--c-primary);
}

.status-shortcut {
    font-size: 11px;
    color: var(--c-text-muted);
}
.status-shortcut kbd {
    display: inline-block;
    padding: 1px 5px;
    margin: 0 2px;
    background: #f0f3f8;
    border: 1px solid var(--c-border);
    border-radius: 3px;
    font-family: Consolas, "Courier New", monospace;
    font-size: 10px;
    color: var(--c-text);
    box-shadow: 0 1px 0 #d8dee8;
}

#statusClock {
    font-family: Consolas, "Courier New", monospace;
    font-weight: 600;
    color: var(--c-primary);
}

/* 콘텐츠가 footer에 가리지 않게 여백 확보 */
.content-body { padding-bottom: calc(18px + var(--footer-h)); }

/* ============================================================
   9. 공용 페이지 요소
   ============================================================ */

/* 페이징 영역 */
.page-summary {
    margin: 8px 0;
    font-size: 12px;
    color: var(--c-text-muted);
}
.page-summary strong { color: var(--c-primary); }
.pagination-area {
    display: flex;
    justify-content: center;
    gap: 4px;
    margin: 12px 0;
    font-size: 13px;
}
.pagination-area a,
.pagination-area span {
    display: inline-block;
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    transition: all var(--t-fast);
}
.pagination-area a {
    color: var(--c-text);
}
.pagination-area a:hover {
    background: var(--c-primary-soft);
    color: var(--c-primary);
}
.pagination-area .page-current {
    background: var(--c-primary-mid);
    color: #fff;
    font-weight: 600;
}
.pagination-area .page-disabled {
    color: #bbb;
    cursor: not-allowed;
}

/* 빈 상태 (데이터 없음) */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--c-text-muted);
    font-size: 14px;
}
.empty-state .hint {
    font-size: 12px;
    color: #aaa;
    margin-top: 8px;
}

/* ============================================================
   10. 반응형 (간단)
   ============================================================ */
@media (max-width: 768px) {
    :root { --sidebar-w: 200px; }
    .app-sidebar {
        transform: translateX(-100%);
        transition: transform var(--t-mid);
    }
    body:not(.sidebar-collapsed) .app-sidebar {
        transform: translateX(0);
        box-shadow: var(--shadow-lg);
    }
    .content,
    .app-footer { padding-left: 0; }
    .header-left { width: auto; border-right: none; }
    .user-info small { display: none; }
}

/* ============================================================
   11. 인쇄
   ============================================================ */
@media print {
    .app-header,
    .app-sidebar,
    .app-footer,
    .header-quick,
    .btn-hamburger { display: none !important; }
    .content { padding-left: 0 !important; }
    .app-body { padding-top: 0 !important; }
}
