/* =========================================
   🧭 Global Layout: App Container
========================================= */
.app-container {
    display: flex;
    height: 100vh;
    width: 100vw;
    overflow: hidden;
}
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.content-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 32px;
    overflow-y: auto;
}

/* =========================================
   📐 Global Layout: Sidebar
========================================= */
.sidebar { 
    width: 280px; 
    background-color: #111827; 
    color: #9CA3AF; 
    display: flex; 
    flex-direction: column; 
    height: 100vh;
}
.sidebar .nav-menu {
    list-style: none;
    padding: 20px 0;
    margin: 0;
    flex-grow: 1;
    overflow-y: auto;
}
.sidebar .nav-item {
    margin-bottom: 4px;
}
.sidebar .nav-link {
    display: flex;
    align-items: center;
    padding: 14px 28px;
    color: #9CA3AF; 
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    letter-spacing: 0.5px;
    transition: all 0.2s;
    border-left: 4px solid transparent; 
}
.sidebar .nav-link:hover {
    background-color: #1F2937;
    color: #fff;
}
.sidebar .nav-link.active {
    background-color: #1F2937;
    border-left-color: var(--z-primary);
    color: #fff;
}
.sidebar .nav-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 14px;
    color: inherit;
}
/* 서브메뉴(2뎁스) 꺾쇠 */
.sidebar .has-submenu .nav-arrow {
    margin-left: auto;
    transition: transform 0.3s;
    display: flex;
    align-items: center;
    opacity: 0.7;
}
.sidebar .has-submenu.open .nav-arrow {
    transform: rotate(180deg);
}
/* 서브메뉴 리스트 */
.sidebar .submenu {
    list-style: none;
    padding: 8px 0;
    margin: 0;
    display: none;
    background-color: #030712; 
}
.sidebar .has-submenu.open .submenu {
    display: block;
}
.sidebar .submenu li a {
    display: block;
    padding: 12px 28px 12px 64px; 
    color: #9CA3AF;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.5px;
    transition: all 0.2s;
}
.sidebar .submenu li a:hover, .sidebar .submenu li a.active {
    color: #fff;
}
/* 구독 및 결제 전용 스타일 */
.nav-payment {
    color: #818CF8 !important; 
    border-top: 1px solid rgba(255,255,255,0.05);
    margin-top: 10px;
    padding-top: 18px !important;
}
.nav-payment:hover {
    color: #fff !important;
}
.badge-dday {
    margin-left: auto;
    background: var(--z-danger);
    color: #fff;
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 800;
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.4);
    animation: pulse-red 2s infinite;
}
@keyframes pulse-red {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(239, 68, 68, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}
.sidebar-footer {
    padding: 24px;
    border-top: 1px solid rgba(255,255,255,0.05);
}
.sidebar .nav-logout {
    color: #9CA3AF;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 14px 28px;
    border-radius: 8px;
    text-decoration: none;
    font-size: 15px;
    transition: all 0.2s;
    font-weight: 700;
    border: 1px solid rgba(255,255,255,0.05);
}
.sidebar .nav-logout:hover {
    background-color: var(--z-danger);
    color: #ffffff;
    border-color: var(--z-danger);
}

/* =========================================
   🏔️ Global Layout: Header
========================================= */
.top-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #0f172a; 
    height: 70px;
    padding: 0 24px;
    border-bottom: 1px solid #1e293b; 
    color: #f8fafc; 
    position: relative;
    z-index: 50; 
}

/* Header Left */
.header-left {
    flex: 1;
    display: flex;
    align-items: center;
    overflow: hidden;
    height: 100%;
}
.log-roller-container {
    display: flex;
    align-items: center;
    background: rgba(0,0,0,0.15); 
    border: 1px solid #1e293b;
    border-radius: 8px;
    padding: 8px 16px;
    width: 380px;
    cursor: pointer;
    transition: background 0.2s;
}
.log-roller-container:hover {
    background: rgba(0,0,0,0.3);
}
.log-icon {
    margin-right: 12px;
    color: #38bdf8;
    display: flex;
    align-items: center;
}
.log-viewport {
    height: 20px;
    overflow: hidden;
    position: relative;
    flex: 1;
}
.log-list {
    list-style: none;
    margin: 0;
    padding: 0;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
}
.log-item {
    height: 20px;
    line-height: 20px;
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #f8fafc;
}
.log-time {
    color: #94a3b8;
    margin-right: 8px;
    font-size: 11px;
    background: rgba(255,255,255,0.08);
    padding: 2px 6px;
    border-radius: 4px;
}

/* Header Center */
.header-center {
    flex: 1.5;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
}
.btn-header {
    background-color: #1e293b;
    border: 1px solid #334155;
    color: #f8fafc;
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
    font-family: inherit;
}
.btn-header:hover {
    background-color: #334155;
    border-color: #475569;
}
.btn-header.highlight {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    border: none;
}
.btn-header.highlight:hover {
    background: linear-gradient(135deg, #1d4ed8, #1e40af);
}

/* Header Dropdowns */
.header-dropdown {
    position: absolute;
    top: 110%;
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 12px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.5);
    min-width: 240px;
    padding: 16px;
    z-index: 100;
    display: none;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.header-dropdown.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

/* Header Right */
.header-right {
    flex: 1;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 16px;
}
.user-badge {
    background: linear-gradient(135deg, #f59e0b, #ea580c);
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    padding: 4px 10px;
    border-radius: 12px;
    letter-spacing: 0.5px;
}
.user-expiry {
    font-size: 13px;
    color: #94a3b8;
    background: rgba(255,255,255,0.05);
    padding: 6px 12px;
    border-radius: 12px;
}
.user-id-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    border: 1px solid #334155;
    color: #f8fafc;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    padding: 8px 14px;
    border-radius: 8px;
    transition: all 0.2s;
    font-family: inherit;
}
.user-id-btn:hover {
    background: rgba(255,255,255,0.05);
}
.user-dropdown-menu {
    right: 0;
    min-width: 160px;
    padding: 8px;
}
.user-dropdown-menu a {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    color: #e2e8f0;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    border-radius: 6px;
}
.user-dropdown-menu a:hover {
    background: rgba(255,255,255,0.05);
}

/* =========================================
   📱 Responsive: Tablet & Mobile
========================================= */
@media (max-width: 1100px) {
    .sidebar { width: 240px; }
    .content-area { padding: 20px; }
    .summary-wrap { grid-template-columns: repeat(2, 1fr); }
    .top-header { gap: 8px !important; }
    .z-heading-lg { font-size: 22px; }
}
@media (max-width: 768px) {
    .sidebar { position: fixed; left: -280px; z-index: 11000; transition: left 0.3s ease; }
    .sidebar.mobile-open { left: 0; }
    .app-container { flex-direction: column; }
    .content-area { padding: 16px; }
    .summary-wrap { grid-template-columns: 1fr; }
    .z-heading-lg { font-size: 20px; }
    .z-heading-xl { font-size: 22px; }
    .plan-summary-card { flex-direction: column; align-items: flex-start; gap: 16px; }
    .usage-stats { width: 100%; }
}



/* === TRANSFERRED FROM COMPONENTS DURING CLEANUP === */
/* =========================================
   📦 Component: Premium Data Table
   출처: settings_user, inventory, settings_market, products 통합
========================================= */
.user-table-wrapper {
    background: #ffffff;
    border-radius: 20px;
    border: 1px solid #e2e8f0;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.03);
    margin-bottom: 24px;
}
.ziegg-table { width: 100%; border-collapse: collapse; text-align: left; }
.ziegg-table th {
    background: #f8fafc;
    padding: 18px 24px;
    font-size: 12px;
    font-weight: 800;
    color: #64748B;
    border-bottom: 1px solid #e2e8f0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.ziegg-table td {
    padding: 20px 24px;
    border-bottom: 1px solid #f1f5f9;
    font-size: 14px;
    color: #334155;
}
.ziegg-table tr:hover td { background: #fcfcfc; }
