/* ============================================
   Admin 기본 변수
   ============================================ */
:root {
    --admin-bg: #0f172a;
    --admin-sidebar: #1e293b;
    --admin-header: #1e293b;
    --admin-content: #0f172a;
    --admin-card: #1e293b;
    --admin-border: #334155;
    --admin-text: #e2e8f0;
    --admin-text-muted: #94a3b8;
    --admin-primary: #3b82f6;
    --admin-primary-hover: #2563eb;
    --admin-success: #22c55e;
    --admin-warning: #f59e0b;
    --admin-danger: #ef4444;
    --admin-sidebar-width: 260px;
    --admin-header-height: 60px;
}

/* ============================================
   기본 리셋
   ============================================ */
.admin-body {
    margin: 0;
    padding: 0;
    font-family: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--admin-bg);
    color: var(--admin-text);
    min-height: 100vh;
}

.admin-body * {
    box-sizing: border-box;
}

/* ============================================
   레이아웃 구조
   ============================================ */
.admin-wrapper {
    display: flex;
    min-height: 100vh;
}

/* ============================================
   사이드바 (왼쪽 메뉴)
   ============================================ */
.admin-sidebar {
    width: var(--admin-sidebar-width);
    background: var(--admin-sidebar);
    border-right: 1px solid var(--admin-border);
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 100;
    display: flex;
    flex-direction: column;
}

.admin-sidebar-brand {
    padding: 20px 24px;
    border-bottom: 1px solid var(--admin-border);
    display: flex;
    align-items: center;
    gap: 12px;
}

.admin-sidebar-brand i {
    font-size: 24px;
    color: var(--admin-primary);
}

.admin-sidebar-brand span {
    font-size: 18px;
    font-weight: 700;
    color: #fff;
}

.admin-sidebar-brand span em {
    font-style: normal;
    color: var(--admin-primary);
}

/* 사이드바 메뉴 */
.admin-nav {
    flex: 1;
    padding: 16px 0;
}

.admin-nav-section {
    padding: 0 16px;
    margin-bottom: 8px;
}

.admin-nav-section-title {
    font-size: 11px;
    font-weight: 600;
    color: var(--admin-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 12px 8px 8px;
}

.admin-nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    margin: 2px 0;
    border-radius: 8px;
    color: var(--admin-text-muted);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.admin-nav-item:hover {
    background: rgba(59, 130, 246, 0.1);
    color: var(--admin-text);
}

.admin-nav-item.active {
    background: var(--admin-primary);
    color: #fff;
}

.admin-nav-item i {
    width: 20px;
    text-align: center;
    font-size: 16px;
}

/* 사이드바 하단 */
.admin-sidebar-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--admin-border);
    display: flex;
    align-items: center;
    gap: 8px;
}

.admin-sidebar-user {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    text-decoration: none;
    padding: 8px;
    margin: -8px;
    border-radius: 8px;
    transition: background 0.2s;
}

.admin-sidebar-user:hover {
    background: var(--admin-surface);
}

.admin-sidebar-user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--admin-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    flex-shrink: 0;
}

.admin-sidebar-user-info {
    flex: 1;
    min-width: 0;
}

.admin-sidebar-user-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--admin-text);
}

.admin-sidebar-user-role {
    font-size: 11px;
    color: var(--admin-text-muted);
}

.admin-sidebar-logout {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--admin-text-muted);
    text-decoration: none;
    transition: all 0.2s;
    flex-shrink: 0;
}

.admin-sidebar-logout:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

/* ============================================
   메인 영역
   ============================================ */
.admin-main {
    flex: 1;
    margin-left: var(--admin-sidebar-width);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ============================================
   상단 헤더
   ============================================ */
.admin-header {
    height: var(--admin-header-height);
    background: var(--admin-header);
    border-bottom: 1px solid var(--admin-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 50;
}

.admin-header-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--admin-text);
    display: flex;
    align-items: center;
    gap: 10px;
}

.admin-header-title i {
    color: var(--admin-primary);
}

.admin-header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.admin-header-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
}

.admin-header-btn-outline {
    background: transparent;
    border: 1px solid var(--admin-border);
    color: var(--admin-text-muted);
}

.admin-header-btn-outline:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--admin-text);
}

.admin-header-btn-primary {
    background: var(--admin-primary);
    color: #fff;
}

.admin-header-btn-primary:hover {
    background: var(--admin-primary-hover);
}

/* ============================================
   콘텐츠 영역
   ============================================ */
.admin-content {
    /* flex: 1; */
    padding: 20px; 
    background: var(--admin-content);
}

/* 카드 */
.admin-card {
    background: var(--admin-card);
    border: 1px solid var(--admin-border);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 12px;
}

.admin-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--admin-border);
}

.admin-card-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--admin-text);
    display: flex;
    align-items: center;
    gap: 10px;
}

.admin-card-title i {
    color: var(--admin-primary);
}

 
.tabbar{
    padding-top:20px; 
    margin-bottom:0px;
    padding-bottom: 0;
}

.tabbar_child{
    padding:16px 20px;
    margin-bottom:0px;
    padding-bottom:16px;
    padding-top:16px;
}
 


/* 테이블 */
.admin-table {
    width: 100%;
    border-collapse: collapse;
}

.admin-table th,
.admin-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--admin-border);
}

.admin-table th {
    font-size: 12px;
    font-weight: 600;
    color: var(--admin-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: rgba(0, 0, 0, 0.2);
}

.admin-table td {
    font-size: 14px;
    color: var(--admin-text);
}

.admin-table tbody tr:hover {
    background: rgba(59, 130, 246, 0.05);
}

/* 빈 상태 */
.admin-empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--admin-text-muted);
}

.admin-empty i {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.admin-empty p {
    font-size: 15px;
    margin: 0;
}

/* 상태 뱃지 */
.admin-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.admin-badge-success {
    background: rgba(34, 197, 94, 0.15);
    color: var(--admin-success);
}

.admin-badge-warning {
    background: rgba(245, 158, 11, 0.15);
    color: var(--admin-warning);
}

.admin-badge-danger {
    background: rgba(239, 68, 68, 0.15);
    color: var(--admin-danger);
}

.admin-badge-primary {
    background: rgba(59, 130, 246, 0.15);
    color: var(--admin-primary);
}


/* ── 모바일 오버레이 (사이드바 열릴 때 뒤 배경) ── */
.admin-sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.55);
    z-index: 99;
}
.admin-sidebar-overlay.active {
    display: block;
}

/* ── 모바일 상단 바 ── */
.admin-mobile-topbar {
    display: none;
}

/* ============================================
   반응형
   ============================================ */
@media (max-width: 1024px) {
    .admin-sidebar {
        width: 70px;
    }
    
    .admin-sidebar-brand span,
    .admin-nav-section-title,
    .admin-nav-item span,
    .admin-sidebar-user-info {
        display: none;
    }
    
    .admin-sidebar-brand {
        justify-content: center;
        padding: 20px 10px;
    }
    
    .admin-nav-item {
        justify-content: center;
        padding: 14px;
    }
    
    .admin-nav-item i {
        width: auto;
        font-size: 18px;
    }
    
    .admin-sidebar-user {
        justify-content: center;
    }
    
    .admin-main {
        margin-left: 70px;
    }
}
@media (max-width: 768px) {
    .admin-sidebar {
        transform: translateX(-100%);
        width: var(--admin-sidebar-width);
        transition: transform .28s cubic-bezier(.4,0,.2,1);
        z-index: 200;
    }
    .admin-sidebar.open {
        transform: translateX(0);
    }

    .admin-sidebar-brand span,
    .admin-nav-section-title,
    .admin-nav-item span,
    .admin-sidebar-user-info {
        display: block;
    }

    .admin-main {
        margin-left: 0;
        padding-top: 56px; /* 모바일 탑바 높이만큼 여백 */
    }

    .admin-content {
        padding: 16px;
        min-width:800px;
    }

    /* ── 모바일 탑바 ── */
    .admin-mobile-topbar {
        display: flex;
        align-items: center;
        gap: 12px;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        height: 56px;
        background: var(--admin-sidebar);
        border-bottom: 1px solid var(--admin-border);
        padding: 0 16px;
        z-index: 150;
    }
    .admin-hamburger {
        width: 36px;
        height: 36px;
        border: none;
        background: rgba(255,255,255,.08);
        border-radius: 8px;
        color: #fff;
        font-size: 16px;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
        transition: background .15s;
    }
    .admin-hamburger:hover {
        background: rgba(255,255,255,.16);
    }
    .admin-mobile-topbar-brand {
        font-size: 15px;
        font-weight: 700;
        color: #fff;
        letter-spacing: -.3px;
    }
    .admin-mobile-topbar-brand em {
        color: var(--admin-primary);
        font-style: normal;
    }
    .admin-mobile-topbar-page {
        margin-left: auto;
        font-size: 13px;
        color: var(--admin-text-muted);
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 160px;
    }
}
