html, body, * {
    font-family: 'Pretendard', 'Noto Sans KR', Arial, sans-serif !important;
}
body {
    background: #f9fbfc;
    margin: 0;
    color: #222;
}
.container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* 로고 영역 (상단) */
.logo-area {
    padding: 20px 0 15px 32px;
    background: #fff;
    border-bottom: 1px solid #e6eaf0;
}

.logo {
    width: 110px;
}

/* 콘텐츠 영역 (로고 아래) */
.content-wrapper {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0; /* allow children to size correctly */
}

/* 사이드바 */
#sidebar {
    width: 100%;
    background: #fff;
    border-bottom: 1px solid #e6eaf0;
}

/* 상단 네비게이션 (top-nav) */
.top-nav {
    position: relative;
    z-index: 100;
    background: #fff;
}
.top-nav-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 32px;
}
.top-nav-left {
    display: flex;
    align-items: center;
    gap: 10px;
}
.top-link {
    display: inline-flex;
    align-items: center;
    height: 36px;
    padding: 0 10px;
    border-radius: 6px;
    color: #222;
    text-decoration: none;
    font-weight: 600;
}
.top-link.active, .top-link:hover { background: #f4f6fa; color: #2d6ff7; }

.top-dropdown { position: relative; }
.top-toggle {
    background: none;
    border: 1px solid #e6eaf0;
    height: 36px;
    padding: 0 10px;
    border-radius: 6px;
    font-weight: 600;
    color: #222;
    cursor: pointer;
}
.top-toggle:hover { border-color: #cfd7e6; color: #2d6ff7; }
.top-menu {
    position: absolute;
    top: 42px;
    left: 0;
    min-width: 160px;
    background: #fff;
    border: 1px solid #e6eaf0;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    display: none;
    padding: 6px;
}
.top-menu.show { display: block; }
.top-menu a {
    display: block;
    padding: 8px 10px;
    border-radius: 6px;
    color: #222;
    text-decoration: none;
    font-size: 14px;
}
.top-menu a:hover { background: #f6f8fa; color: #2d6ff7; }

.top-nav-right { display: flex; align-items: center; gap: 10px; }

@media (max-width: 900px) {
    .top-nav-inner { flex-wrap: wrap; gap: 8px; }
    .top-nav-left { gap: 8px; }
}

/* 메인 콘텐츠 */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0; /* enable iframe flex child to fill */
    padding: 12px 32px 0 32px;
}
.sidebar {
    width: 230px;
    background: #fff;
    border-right: 1px solid #e6eaf0;
    padding: 0 0 20px 0;
}
.logo-area {
    padding: 28px 32px 24px 32px;
}
.header-grid {
    display: grid;
    grid-template-columns: 1fr auto 1fr; /* left logo | centered menu | right account */
    align-items: center;
    gap: 12px;
}
.header-left {
    display: flex;
    align-items: center;
}
.top-nav-center {
    display: flex;
    align-items: center;
    justify-content: center; /* center the menu */
    gap: 18px;
}
.top-nav-right {
    justify-self: end; /* push to right end of header grid */
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative; /* anchor for account dropdown */
}
.logo {
    width: 110px;
}
.sidebar-nav ul {
    list-style: none;
    margin: 0;
    padding: 0 0 0 16px;
}
.sidebar-nav > ul > li {
    padding: 14px 0 8px 16px;
    position: relative;
    font-weight: 600;
    color: #222;
    cursor: pointer;
    line-height: 2;
}

.sidebar-nav .has-submenu > .menu-toggle {
    background: none;
    border: none;
    color: #222;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    text-align: left;
    padding: 0 0 0 6px;
}
.sidebar-nav .has-submenu > .menu-toggle:after {
    content: '^';
    display: inline-block;
    margin-left: 10px;
    font-size: 14px;
    margin-top: 2px;
    transition: transform 0.2s;
    vertical-align: middle;
}
.sidebar-nav .has-submenu.open > .menu-toggle:after {
    transform: rotate(180deg) scaleX(-1);
}
.sidebar-nav .submenu {
    display: none;
    list-style: none;
    margin: 6px 0 0 12px;
    padding: 0;
    font-weight: 400;
    color: #888;
    line-height: 2;
}
.sidebar-nav .has-submenu.open > .submenu {
    display: block;
}
.sidebar-nav ul li.active,
.sidebar-nav ul li:hover {
    color: #2d6ff7;
}
.sidebar-nav a {
    text-decoration: none;
    color: inherit;
}
.sidebar-nav a:hover {
    color: #2d6ff7;
}
.sidebar-nav a.active {
    color: #2d6ff7;
    font-weight: 700;
}
.has-submenu .submenu {
    display: none;
}

.sidebar-nav .menu-toggle.active::after {
    transform: rotate(180deg);
}

.sidebar-nav .submenu {
    margin-top: 8px;
    padding-left: 12px;
    display: none;
}

.sidebar-nav .submenu a.active {
    color: #2d6ff7;
    font-weight: 600;
}

.sidebar-nav .submenu {
    list-style: none;
    margin: 6px 0 0 12px;
    padding: 0;
    font-weight: 400;
    color: #888;
    line-height: 2;
}
.sidebar-nav .submenu li.active {
    color: #2d6ff7;
    font-weight: 600;
}
.main-content {
    flex: 1;
    padding: 12px 32px 0 32px;
}
.main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
}
.main-header h1 {
    font-size: 22px;
    font-weight: 700;
    margin: 0;
}
.btn-primary {
    background: #2d6ff7;
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 10px 22px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
}
.tab-section {
    margin-bottom: 28px;
    display: flex;
    align-items: flex-end;
    gap: 30px;
}
.tabs {
    display: flex;
    gap: 8px;
}
.tab {
    background: none;
    border: none;
    font-size: 15px;
    padding: 6px 16px;
    border-radius: 18px;
    color: #222;
    cursor: pointer;
    font-weight: 500;
}
.tab.active {
    background: #222;
    color: #fff;
    font-weight: 700;
}
.tab-filters {
    display: flex;
    gap: 8px;
}
.filter {
    background: #f4f6fa;
    border: none;
    color: #888;
    font-size: 14px;
    padding: 4px 14px;
    border-radius: 14px;
    cursor: pointer;
}
.filter.active {
    background: #2d6ff7;
    color: #fff;
    font-weight: 600;
}
.filter:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
.search-box {
    margin-left: auto;
    display: flex;
    align-items: center;
}
.search-box input {
    border: 1px solid #e6eaf0;
    border-radius: 6px;
    padding: 6px 14px;
    font-size: 14px;
    background: #fff;
}
.table-section {
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 2px 12px 0 rgba(50, 90, 180, 0.04);
    padding: 28px 24px 24px 24px;
}
.product-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 15px;
    margin-bottom: 14px;
}
.product-table th, .product-table td {
    padding: 12px 8px;
    border-bottom: 1px solid #f0f0f0;
    text-align: center;
    color: #222;
    font-weight: 400;
    background: #fff;
}
.product-table thead th {
    color: #888;
    font-weight: 500;
    background: #f6f8fa;
}
.product-table th:nth-child(1), .product-table td:nth-child(1) { width: 90px; }
.product-table th:nth-child(2), .product-table td:nth-child(2) { width: 90px; }
.product-table th:nth-child(3), .product-table td:nth-child(3) { width: 100px; }
.product-table th:nth-child(4), .product-table td:nth-child(4) { width: 320px; text-align: left; }
.product-table th:nth-child(5), .product-table td:nth-child(5) { width: 110px; }
.product-table th:nth-child(6), .product-table td:nth-child(6) { width: 60px; }

.status-pending { background: #fff8e4; color: #d9a700; font-weight: 600; border-radius: 12px; padding: 2px 10px; font-size: 13px; }
.status-done { background: #e6ffef; color: #1bb96e; font-weight: 600; border-radius: 12px; padding: 2px 10px; font-size: 13px; }
.status-active { background: #e4f1ff; color: #2d6ff7; font-weight: 600; border-radius: 12px; padding: 2px 10px; font-size: 13px; }

.product-table .btn-more { background: #f4f6fa; border: none; border-radius: 50%; width: 32px; height: 32px; font-size: 20px; color: #888; cursor: pointer; position: relative; }
.product-table td { position: relative; }
.product-table .more-menu { display: none; position: absolute; left: 50%; top: 36px; transform: translateX(-50%); background: #fff; border: 1px solid #e0e4ea; border-radius: 8px; box-shadow: 0 2px 12px 0 rgba(50,90,180,0.07); min-width: 140px; z-index: 10; text-align: left; }
.product-table .more-menu.active { display: block; }
.product-table .more-menu button { display: block; width: 100%; background: none; border: none; color: #222; font-size: 15px; padding: 10px 18px; text-align: left; cursor: pointer; }
.product-table .more-menu button:hover { background: #f6f8fa; color: #2857e7; }
.status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 13px;
    min-width: 92px;
    box-sizing: border-box;
}
.status-active {
    background: #e4f1ff;
    color: #2d6ff7;
    font-weight: 600;
}
.btn-secondary {
    background: #f4f6fa;
    border: none;
    border-radius: 6px;
    color: #2d6ff7;
    font-weight: 600;
    padding: 6px 14px;
    cursor: pointer;
}
.btn-more {
    background: #f4f6fa;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    font-size: 20px;
    color: #888;
    cursor: pointer;
}
.sns-icon.instagram {
    display: inline-block;
    width: 20px;
    height: 20px;
    background: url('../../images/instagram_icon.png') no-repeat center/cover;
}
.chat-switch input[type="checkbox"] {
    width: 20px;
    height: 20px;
}
.wizard-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    position: absolute;
    right: 32px;
    bottom: 32px;
    z-index: 10;
}
.campaign-wizard-modal .wizard-progress-vertical {
    display: block !important;
    margin: 0 32px 0 0 !important;
    min-width: 180px;
    width: 210px;
    height: 100%;
}
.wizard-progress-vertical .wizard-progress-step {
    display: block;
    width: 100%;
    box-sizing: border-box;
    margin-bottom: 16px;
    padding: 28px 18px;
    font-size: 18px;
}
.wizard-progress-vertical .wizard-progress-step:last-child {
    margin-bottom: 0;
}
.campaign-wizard-modal .modal-content {
    position: relative;
    padding-bottom: 80px;
}

/* 커스텀 알림창 스타일 */
.notification {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10000;
    width: 100%;
    max-width: 450px;
    animation: slideDown 0.3s ease-out forwards;
}
.notification-content {
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 15px;
}
.notification.success .notification-content {
    border-left: 4px solid #4CAF50;
}
.notification.warning .notification-content {
    border-left: 4px solid #f44336;
}
.notification-close {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #888;
    margin-left: 10px;
}
@keyframes slideDown {
    from { transform: translate(-50%, -100%); opacity: 0; }
    to { transform: translate(-50%, 0); opacity: 1; }
}

/* 더보기 버튼 드롭다운 스타일 */
.dropdown {
    position: relative;
    display: inline-block;
}
.dropdown-menu {
    position: absolute;
    right: 0;
    top: 100%;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    min-width: 150px;
    z-index: 100;
    display: none;
}
.dropdown-menu.show {
    display: block;
}
.dropdown-item {
    display: block;
    padding: 10px 16px;
    color: #333;
    text-decoration: none;
    font-size: 14px;
    transition: background 0.2s;
}
.dropdown-item:hover {
    background: #f4f6fa;
}
.dropdown-item:first-child {
    border-radius: 8px 8px 0 0;
}
.dropdown-item:last-child {
    border-radius: 0 0 8px 8px;
}
.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 14px;
}
.page-btn {
    background: #f4f6fa;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    color: #2d6ff7;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
}
.page-btn.active {
    background: #2d6ff7;
    color: #fff;
}
@media (max-width: 900px) {
    .container {
        flex-direction: column;
    }
    .sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid #e6eaf0;
    }
    .main-content {
        padding: 12px 32px 0 32px;
    }
    .table-section {
        padding: 14px 4px 14px 4px;
    }
}

/* Modal Styles */
.modal {
    position: fixed;
    z-index: 2000;
    left: 0; top: 0; right: 0; bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
.modal-backdrop {
    position: absolute;
    left: 0; top: 0; right: 0; bottom: 0;
    background: rgba(34, 34, 34, 0.35);
    z-index: 1;
}
.modal-content {
    position: relative;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 4px 32px 0 rgba(50, 90, 180, 0.09);
    padding: 36px 32px 28px 32px;
    min-width: 700px;
    max-width: 99vw;
    z-index: 2;
    width: 900px;
    animation: modal-fade-in 0.2s;
}

/* 상품명 컬럼만 넓게 */
.db-table th:nth-child(2),
.db-table td:nth-child(2),
.db-table th:nth-child(3),
.db-table td:nth-child(3),
.db-table th:nth-child(4),
.db-table td:nth-child(4) {
    width: 80px;
    min-width: 60px;
    max-width: 120px;
    word-break: keep-all;
    white-space: nowrap;
}
.db-table th:first-child,
.db-table td:first-child {
    width: 38px;
    min-width: 30px;
    max-width: 60px;
    padding-left: 0;
    padding-right: 0;
}
.db-table th:nth-child(5),
.db-table td:nth-child(5) {
    width: 480px;
    min-width: 260px;
    max-width: 700px;
    word-break: keep-all;
    white-space: normal;
}
@keyframes modal-fade-in {
    0% { opacity: 0; transform: scale(0.96); }
    100% { opacity: 1; transform: scale(1); }
}

/* 상품 등록 모달 탭 */
.modal-tabs {
    display: flex;
    margin-bottom: 22px;
    border-bottom: 1.5px solid #e0e4ea;
    gap: 2px;
}
.modal-tab {
    flex: 1 1 0;
    background: none;
    border: none;
    outline: none;
    font-size: 17px;
    font-weight: 600;
    padding: 13px 0 11px 0;
    color: #888;
    border-bottom: 2.5px solid transparent;
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s;
}
.modal-tab.active {
    color: #2857e7;
    border-bottom: 2.5px solid #2857e7;
    background: #f8faff;
}

/* 상품 DB 테이블 */
.db-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 12px;
}
.db-table th, .db-table td {
    border: 1px solid #e0e4ea;
    padding: 8px 10px;
    text-align: center;
    font-size: 15px;
}
.db-table th {
    background: #f5f7fa;
    color: #333;
    font-weight: 600;
    position: relative;
    vertical-align: bottom;
}

.sort-btn {
    background: none;
    border: none;
    font-size: 15px;
    color: #888;
    cursor: pointer;
    margin-left: 2px;
    vertical-align: middle;
    padding: 0 2px;
    transition: color 0.15s;
}
.sort-btn.active {
    color: #2857e7;
    font-weight: bold;
}
.db-table td {
    background: #fff;
}
.db-table input[type="checkbox"] {
    transform: scale(1.2);
    accent-color: #2857e7;
}

.modal-close {
    position: absolute;
    top: 18px; right: 18px;
    background: none;
    border: none;
    font-size: 28px;
    color: #888;
    cursor: pointer;
    z-index: 3;
}
.modal-content h2 {
    margin-top: 0;
    margin-bottom: 18px;
    font-size: 20px;
    font-weight: 700;
    text-align: left;
}
.form-group {
    margin-bottom: 18px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}
.form-group label {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 7px;
    color: #222;
}
.form-group input[type="text"],
.form-group select,
.form-group textarea {
    width: 100%;
    border: 1px solid #e6eaf0;
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 15px;
    background: #f9fbfc;
    color: #222;
    box-sizing: border-box;
}
.form-group textarea {
    resize: vertical;
    min-height: 70px;
}
.file-group input[type="file"] {
    margin-bottom: 6px;
}
.form-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 18px;
}

.form-hint {
    display: block;
    color: #888;
    font-size: 13px;
    margin-top: 6px;
    margin-bottom: 2px;
    line-height: 1.5;
}

