@charset "utf-8";

:root {
    --header-height: 64px;
    --sidebar-width: 250px;
}

.top-loading-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 0;
    height: 3px;
    background: linear-gradient(90deg, #2f8eea, #60a5fa);
    z-index: 99999;
    opacity: 0;
    transition: width .25s ease, opacity .3s ease;
    box-shadow: 0 0 8px rgba(47, 142, 234, .45);
}

.top-loading-bar.show {
    opacity: 1;
}

/* 전체 */
.app-wrap {
    min-height: 100vh;
    background: #eef1f4;
}

/* 상단 헤더 */
.top-header {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
    width: 100%;
    height: var(--header-height);
    border-bottom: 1px solid #d9e0e7;
    background: #ffffff;
    box-shadow: 0 1px 8px rgba(15, 23, 42, 0.06);
}

.top-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    padding: 0 20px;
    box-sizing: border-box;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.site-logo {
    font-size: 20px;
    font-weight: 700;
    line-height: 1;
}

.site-logo a {
    color: #111827;
    text-decoration: none;
}

/*.site-logo a:hover {
    text-decoration: underline;
}*/

/* 모바일 메뉴 버튼 */
.mobile-menu-btn {
    display: none;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: #fff;
    color: #374151;
    font-size: 18px;
    line-height: 32px;
    text-align: center;
    cursor: pointer;
}

/* 우측 유틸 */
.top-util {
    display: flex;
    align-items: center;
    gap: 12px;
}

.util-link,
.util-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 32px;
    padding: 0 6px;
    border: 0;
    background: none;
    color: #4b5563;
    font-size: 12px;
    line-height: 1;
    box-sizing: border-box;
    cursor: pointer;
}

.util-link:hover,
.util-btn:hover {
    color: #111827;
}

.admin-user-text {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #374151;
    font-size: 12px;
    font-weight: 700;
}

.admin-role-text {
    color: #6b7280;
    font-style: normal;
    font-size: 11px;
    font-weight: 400;
}

/* 다크모드 버튼 */
.dark-toggle {
    position: relative;
    width: 32px;
    min-width: 32px;
    height: 32px;
    padding: 0;
    border-radius: 50%;
}

.dark-toggle:hover {
    background: #f1f5f9;
}

.dark-toggle span {
    position: absolute;
    top: 50%;
    left: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    line-height: 1;
    transform: translate(-50%, -50%);
    font-size: 16px;
    transition: all .2s ease;
}

.dark-toggle .icon-sun {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.7);
}

.dark-toggle .icon-moon {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}


/* 로그인 후 레이아웃 */
.dashboard-layout {
    display: flex;
    min-height: 100vh;
    padding-top: var(--header-height);
    box-sizing: border-box;
}

/* 좌측 메뉴 */
.left-sidebar {
    width: var(--sidebar-width);
    background: #f7f7f7;
    border-right: 1px solid #d9e0e7;
    box-sizing: border-box;
}

.sidebar-sticky {
    position: sticky;
    top: calc(var(--header-height) + 0px);
    max-height: calc(100vh - var(--header-height));
    overflow-y: auto;
}

.sidebar-user {
    padding: 18px 16px;
    border-bottom: 1px solid #e5eaf0;
    background: #f0f2f5;
}

.sidebar-user-name {
    color: #111827;
    font-size: 14px;
    font-weight: 700;
}

.sidebar-user-id {
    margin-top: 4px;
    color: #6b7280;
    font-size: 12px;
}


.sidebar-menu li:last-child {
    border-bottom: 0;
}

.sidebar-menu li a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px 16px;
    color: #222;
    font-size: 14px;
    font-weight: 700;
    background: #f7f7f7;
    box-sizing: border-box;
}

.sidebar-menu li a:hover {
    background: #eceff3;
}

.sidebar-menu li a.active {
    background: #ffffff;
    color: #2563eb;
}


/* =========================
   사이드바 다단 메뉴
========================= */
.sidebar-menu {
    margin: 0;
    padding: 0;
    list-style: none;
}

.sidebar-menu li {
    position: relative;
}

.sidebar-menu li a,
.sidebar-menu li .menu-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 14px;
    border: 0;
    border-bottom: 1px solid #edf2f7;
    background: #ffffff;
    color: #374151;
    font-size: 12px;
    text-align: left;
    box-sizing: border-box;
    cursor: pointer;
}

.sidebar-menu li a:hover,
.sidebar-menu li .menu-toggle:hover {
    background: #f8fafc;
}

.sidebar-menu li a.active,
.sidebar-menu li .menu-toggle.active {
    background: #eff6ff;
    color: #2563eb;
    font-weight: 700;
}

.sidebar-menu .menu-ico {
    width: 18px;
    text-align: center;
    flex: 0 0 18px;
}

.sidebar-menu .menu-txt {
    flex: 1 1 auto;
}

.sidebar-menu .menu-arrow {
    margin-left: auto;
    font-size: 11px;
    transition: transform .2s ease;
}

.sidebar-menu li.open > .menu-toggle .menu-arrow {
    transform: rotate(180deg);
}

/* 2차, 3차 기본 닫힘 */
.sidebar-menu .depth-2,
.sidebar-menu .depth-3 {
    display: none;
}

.sidebar-menu li.open > .depth-2,
.sidebar-menu li.open > .depth-3 {
    display: block;
}

/* 2차 */
.sidebar-menu.depth-2 li a,
.sidebar-menu.depth-2 li .menu-toggle {
    padding-left: 34px;
    background: #f8fafc;
    font-size: 12px;
}

/* 3차 */
.sidebar-menu.depth-3 li a,
.sidebar-menu.depth-3 li .menu-toggle {
    padding-left: 52px;
    background: #fbfdff;
    font-size: 11px;
    color: #4b5563;
}


.menu-ico {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    min-width: 20px;
    font-size: 16px;
    line-height: 1;
}

.menu-txt {
    display: inline-block;
    line-height: 1.2;
}

/* 우측 본문 */
.main-content {
    flex: 1;
    min-width: 0;
    padding: 22px;
    box-sizing: border-box;
    background: #eef1f4;
}

.guest-content {
    max-width: 1280px;
    min-height: 100vh;
    margin: 0 auto;
    padding: calc(var(--header-height) + 24px) 20px 40px;
    box-sizing: border-box;
}

/* 페이지 패널 */
.page-panel {
    border: 1px solid #d5dbe2;
    border-radius: 14px;
    background: #ffffff;
    padding: 15px;
    box-sizing: border-box;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
}

.page-title {
    margin-bottom: 18px;
    color: #111827;
    font-size: 20px;
    font-weight: 700;
    line-height: 1.2;
}

.sub-title {
    margin-bottom: 16px;
    color: #111827;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.2;
}

.info-box {
    border: 1px solid #e5eaf0;
    border-radius: 12px;
    overflow: hidden;
    background: #ffffff;
}

.info-box table {
    width: 100%;
    table-layout: fixed;
}

.info-box th,
.info-box td {
    padding: 12px 14px;
    border-bottom: 1px solid #edf2f7;
    font-size: 12px;
    text-align: left;
    vertical-align: middle;
}

.info-box tr:last-child th,
.info-box tr:last-child td {
    border-bottom: 0;
}

.info-box th {
    width: 140px;
    background: #f7f9fb;
    font-weight: 700;
    color: #374151;
}

.info-box td {
    color: #111827;
}

/* footer */
.footer-wrap {
    border-top: 1px solid #d9e0e7;
    background: #ffffff;
}

.footer-inner {
    padding: 14px 20px;
    box-sizing: border-box;
}

.footer-copy {
    color: #6b7280;
    font-size: 11px;
}

/* 모바일 */
.sidebar-backdrop {
    display: none;
}


.input-btn-group {
    display: flex;
    gap: 8px;
    align-items: stretch;
}

.input-btn-input {
    flex: 1;
}

.input-btn-input .form-input {
    width: 100%;
    height: 38px;
}

.input-btn-button {
    flex-shrink: 0;
}

.input-btn-button .btn {
    height: 38px;
    white-space: nowrap;
}

@media all and (max-width: 900px) {
    .mobile-menu-btn {
        display: inline-block;
    }

    .dashboard-layout {
        display: block;
    }

    .left-sidebar {
        position: fixed;
        top: var(--header-height);
        left: -260px;
        z-index: 1100;
        width: var(--sidebar-width);
        height: calc(100vh - var(--header-height));
        transition: left .2s ease;
        box-shadow: 0 4px 14px rgba(0,0,0,.12);
    }

    .left-sidebar.open {
        left: 0;
    }

    .sidebar-sticky {
        position: relative;
        top: 0;
        max-height: 100%;
    }

    .sidebar-backdrop.show {
        display: block;
        position: fixed;
        top: var(--header-height);
        left: 0;
        z-index: 1050;
        width: 100%;
        height: calc(100vh - var(--header-height));
        background: rgba(0,0,0,.45);
    }

    .main-content {
        padding: 16px;
    }

    .admin-user-text {
        display: none;
    }
}



/* =========================
   로그인 연장 UI 추가 대응
========================= */
.login-timer-box,
.session-timer-box {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    flex-shrink: 0;
}

.login-remain-time,
.session-remain-time {
    font-size: 11px;
    line-height: 1;
    color: #374151;
    font-weight: 700;
}

.btn-session-extend,
#btn-session-extend {
    height: 28px;
    padding: 0 8px;
    font-size: 11px;
    white-space: nowrap;
}

/* 모바일 보정 */
@media all and (max-width: 900px) {
    .top-util {
        gap: 6px;
        flex-wrap: wrap;
        justify-content: flex-end;
    }

    .login-timer-box,
    .session-timer-box {
        width: 100%;
        justify-content: flex-end;
        margin-top: 2px;
    }

    .btn-session-extend,
    #btn-session-extend {
        height: 24px;
        padding: 0 7px;
        font-size: 10px;
    }
}

@media all and (max-width: 480px) {
    .top-util {
        gap: 4px;
    }

    .login-timer-box,
    .session-timer-box {
        justify-content: flex-start;
    }
}