/* =========================================================
   기본
========================================================= */

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;

    width: 100%;
    min-height: 100%;
}

body {
    font-family:
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        "Noto Sans KR",
        sans-serif;

    background: #f5f6f8;
    color: #1f2937;
}


/* =========================================================
   전체 레이아웃
========================================================= */

.app-layout {
    display: flex;

    min-height: 100vh;
}


/* =========================================================
   사이드바
========================================================= */

.sidebar {
    position: fixed;

    top: 0;
    left: 0;

    width: 250px;
    height: 100vh;

    display: flex;
    flex-direction: column;

    background: #ffffff;

    border-right: 1px solid #e5e7eb;

    z-index: 1000;

    transition:
        transform 0.25s ease;
}


/* 헤더 */

.sidebar-header {
    height: 72px;

    padding: 0 20px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    border-bottom: 1px solid #f0f0f0;
}


/* 브랜드 */

.brand {
    display: flex;
    align-items: center;

    gap: 11px;
}

.brand-logo {
    width: 38px;
    height: 38px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 10px;

    background: #2563eb;

    color: #ffffff;

    font-size: 13px;
    font-weight: 800;
}

.brand-text {
    display: flex;
    flex-direction: column;

    gap: 2px;
}

.brand-text strong {
    font-size: 15px;

    color: #111827;
}

.brand-text span {
    font-size: 11px;

    color: #9ca3af;
}


/* 모바일 닫기 */

.sidebar-close {
    display: none;

    border: 0;

    background: transparent;

    color: #6b7280;

    font-size: 24px;

    cursor: pointer;
}


/* =========================================================
   사이드바 메뉴
========================================================= */

.sidebar-nav {
    flex: 1;

    padding: 18px 12px;

    overflow-y: auto;
}

.nav-item {
    height: 44px;

    display: flex;
    align-items: center;

    padding: 0 12px;

    margin-bottom: 3px;

    border-radius: 8px;

    color: #4b5563;

    text-decoration: none;

    font-size: 14px;
    font-weight: 500;

    transition:
        background 0.15s ease,
        color 0.15s ease;
}

.nav-item:hover {
    background: #f3f4f6;

    color: #111827;
}

.nav-item.active {
    background: #eff6ff;

    color: #2563eb;

    font-weight: 700;
}

.nav-icon {
    width: 28px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    margin-right: 6px;

    font-size: 16px;
}


/* =========================================================
   사이드바 하단
========================================================= */

.sidebar-footer {
    padding: 15px;

    border-top: 1px solid #f0f0f0;
}

.store-info {
    display: flex;
    align-items: center;

    gap: 9px;

    padding: 10px;

    border-radius: 9px;

    background: #f9fafb;
}

.store-status {
    width: 8px;
    height: 8px;

    flex-shrink: 0;

    border-radius: 50%;

    background: #22c55e;
}

.store-info>div:last-child {
    display: flex;
    flex-direction: column;

    gap: 2px;
}

.store-info strong {
    font-size: 12px;

    color: #374151;
}

.store-info span {
    font-size: 10px;

    color: #9ca3af;
}


/* =========================================================
   메인
========================================================= */

.main-area {
    width: calc(100% - 250px);

    min-height: 100vh;

    margin-left: 250px;

    display: flex;
    flex-direction: column;
}


/* =========================================================
   상단바
========================================================= */

.topbar {
    position: sticky;

    top: 0;

    height: 72px;

    padding: 0 28px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    background: #ffffff;

    border-bottom: 1px solid #e5e7eb;

    z-index: 900;
}

.topbar-left {
    display: flex;
    align-items: center;

    gap: 14px;
}

.menu-button {
    display: none;

    width: 38px;
    height: 38px;

    border: 1px solid #e5e7eb;

    border-radius: 8px;

    background: #ffffff;

    font-size: 18px;

    cursor: pointer;
}

.page-title {
    font-size: 18px;

    font-weight: 700;

    color: #111827;
}


/* 우측 */

.topbar-right {
    display: flex;
    align-items: center;

    gap: 18px;
}

.icon-button {
    width: 38px;
    height: 38px;

    border: 0;

    border-radius: 8px;

    background: transparent;

    font-size: 17px;

    cursor: pointer;
}

.icon-button:hover {
    background: #f3f4f6;
}

.user-menu {
    display: flex;
    align-items: center;

    gap: 9px;
}

.user-avatar {
    width: 36px;
    height: 36px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 50%;

    background: #eff6ff;

    color: #2563eb;

    font-size: 13px;
    font-weight: 700;
}

.user-info {
    display: flex;
    flex-direction: column;

    gap: 2px;
}

.user-info strong {
    font-size: 13px;
}

.user-info span {
    font-size: 10px;

    color: #9ca3af;
}


/* =========================================================
   콘텐츠
========================================================= */

.content-area {
    flex: 1;

    width: 100%;

    padding: 28px;
}


/* =========================================================
   푸터
========================================================= */

.footer {
    height: 50px;

    padding: 0 28px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    color: #9ca3af;

    font-size: 11px;
}


/* =========================================================
   대시보드
========================================================= */

.dashboard {
    width: 100%;

    max-width: 1600px;

    margin: 0 auto;
}


/* 페이지 헤더 */

.dashboard-header {
    display: flex;
    align-items: center;
    justify-content: space-between;

    margin-bottom: 24px;
}

.dashboard-header h1 {
    margin: 0 0 6px;

    font-size: 24px;

    font-weight: 700;

    color: #111827;
}

.dashboard-header p {
    margin: 0;

    font-size: 13px;

    color: #6b7280;
}

.dashboard-date {
    padding: 9px 13px;

    border: 1px solid #e5e7eb;

    border-radius: 8px;

    background: #ffffff;

    font-size: 13px;

    color: #6b7280;
}


/* =========================================================
   대시보드 요약
========================================================= */

.dashboard-summary {
    display: grid;

    grid-template-columns:
        repeat(4, minmax(0, 1fr));

    gap: 16px;

    margin-bottom: 20px;
}

.summary-card {
    padding: 20px;

    border: 1px solid #e5e7eb;

    border-radius: 12px;

    background: #ffffff;
}

.summary-card-header {
    display: flex;
    align-items: center;

    gap: 9px;

    margin-bottom: 14px;
}

.summary-icon {
    width: 34px;
    height: 34px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 8px;

    background: #f3f4f6;

    font-size: 16px;
}

.summary-label {
    font-size: 13px;

    font-weight: 600;

    color: #6b7280;
}

.summary-value {
    margin-bottom: 5px;

    font-size: 28px;

    font-weight: 700;

    color: #111827;
}

.summary-description {
    font-size: 11px;

    color: #9ca3af;
}


/* =========================================================
   대시보드 패널
========================================================= */

.dashboard-grid {
    display: grid;

    grid-template-columns:
        repeat(2, minmax(0, 1fr));

    gap: 20px;
}

.dashboard-panel {
    min-height: 300px;

    overflow: hidden;

    border: 1px solid #e5e7eb;

    border-radius: 12px;

    background: #ffffff;
}

.dashboard-panel-full {
    grid-column: 1 / -1;

    min-height: 260px;
}


/* 패널 헤더 */

.panel-header {
    padding: 20px 22px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    border-bottom: 1px solid #f0f0f0;
}

.panel-header h2 {
    margin: 0 0 5px;

    font-size: 15px;

    font-weight: 700;

    color: #111827;
}

.panel-header p {
    margin: 0;

    font-size: 11px;

    color: #9ca3af;
}

.panel-link {
    font-size: 12px;

    color: #2563eb;

    text-decoration: none;
}

.panel-link:hover {
    text-decoration: underline;
}


/* 빈 상태 */

.empty-state {
    min-height: 220px;

    padding: 30px;

    display: flex;
    flex-direction: column;

    align-items: center;
    justify-content: center;

    gap: 7px;

    text-align: center;
}

.empty-icon {
    width: 46px;
    height: 46px;

    margin-bottom: 4px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 50%;

    background: #f9fafb;

    font-size: 19px;
}

.empty-state strong {
    font-size: 13px;

    font-weight: 600;

    color: #374151;
}

.empty-state span {
    font-size: 11px;

    color: #9ca3af;
}


/* =========================================================
   모바일
========================================================= */

.sidebar-overlay {
    display: none;
}


@media (max-width: 900px) {

    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .sidebar-close {
        display: block;
    }

    .main-area {
        width: 100%;

        margin-left: 0;
    }

    .menu-button {
        display: block;
    }

    .sidebar-overlay {
        position: fixed;

        inset: 0;

        background: rgba(0, 0, 0, 0.35);

        z-index: 999;
    }

    .sidebar-overlay.active {
        display: block;
    }

    .content-area {
        padding: 20px;
    }

    .user-info {
        display: none;
    }
}


@media (max-width: 1100px) {

    .dashboard-summary {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }
}


@media (max-width: 700px) {

    .dashboard-header {
        align-items: flex-start;

        flex-direction: column;

        gap: 12px;
    }

    .dashboard-summary {
        grid-template-columns: 1fr;

        gap: 12px;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-panel-full {
        grid-column: auto;
    }

    .summary-card {
        padding: 17px;
    }

    .topbar {
        padding: 0 16px;
    }

    .content-area {
        padding: 16px;
    }

    .footer {
        padding: 0 16px;
    }

    .footer span:last-child {
        display: none;
    }
}