/* SmartSelling Super Admin — 레이아웃 보조 CSS
   common.css 를 기반으로 사용하며, 여기서는 좌측 사이드바 레이아웃과
   어드민 전용 컴포넌트를 정의합니다. */

/* ── 좌측 사이드바 ── */
.admin-sidebar {
    position: fixed;
    top: 56px;
    left: 0;
    width: 210px;
    height: calc(100vh - 56px);
    background: #1e1e2f;
    overflow-y: auto;
    z-index: 900;
    padding: 16px 0 40px;
    box-shadow: 2px 0 8px rgba(0,0,0,.18);
}
.sidebar-section-title {
    font-size: 10px;
    font-weight: 700;
    color: #5a5a7a;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    padding: 18px 20px 6px;
}
.sidebar-link {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 10px 20px;
    font-size: 13.5px;
    font-weight: 500;
    color: #9a9ab8;
    text-decoration: none;
    transition: background 0.12s, color 0.12s;
    border-left: 3px solid transparent;
}
.sidebar-link:hover {
    background: rgba(99,102,241,.12);
    color: #c4c4e0;
}
.sidebar-link.active {
    background: rgba(99,102,241,.18);
    color: #fff;
    border-left-color: #6366F1;
    font-weight: 600;
}
.sidebar-link .si { font-size: 15px; width: 20px; text-align: center; flex-shrink: 0; }

/* ── 관리자 페이지 레이아웃 (사이드바 포함) ── */
.admin-wrap {
    padding-top: 56px;
    padding-left: 210px;
    min-height: 100vh;
    background: #f5f6fa;
}
.admin-content {
    max-width: 1380px;
    margin: 0 auto;
    padding: 28px 28px;
}
.admin-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}
.admin-page-title {
    font-size: 22px;
    font-weight: 700;
    color: #1a1a2e;
}
/* 헤더 'ADMIN' 라벨 */
.logo .admin-label {
    font-size: 11px;
    color: #a5b4fc;
    font-weight: 600;
    letter-spacing: 0.12em;
    margin-left: 6px;
    vertical-align: middle;
    background: rgba(99,102,241,.2);
    padding: 2px 6px;
    border-radius: 4px;
}

/* ── 필터 바 ── */
.filter-bar {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 12px;
}
.filter-bar input, .filter-bar select {
    padding: 8px 12px;
    font-size: 13px;
    border: 1px solid #d0d5dd;
    border-radius: 7px;
    background: #fafbfc;
    font-family: inherit;
}
.filter-bar input { flex: 1; min-width: 200px; }
.filter-bar input:focus, .filter-bar select:focus {
    outline: none;
    border-color: #6366F1;
    background: #fff;
}
.count-bar { font-size: 13px; color: #888; margin-bottom: 10px; }
.count-bar strong { color: #333; }

/* ── 요약 카드 행 ── */
.summary-row {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}
.summary-card {
    background: #fff;
    border: 1.5px solid #e8e8f0;
    border-radius: 10px;
    padding: 14px 22px;
    cursor: pointer;
    transition: border-color 0.15s;
    min-width: 130px;
}
.summary-card:hover { border-color: #6366F1; }
.summary-card.active { border-color: #6366F1; background: #f5f5ff; }
.summary-card .s-label { font-size: 12px; color: #888; margin-bottom: 4px; }
.summary-card .s-value { font-size: 24px; font-weight: 700; color: #1a1a2e; }

/* ── 패널 (collection_list 스타일) ── */
.admin-panel {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,.07);
    overflow: hidden;
    margin-bottom: 20px;
}
.admin-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    border-bottom: 1px solid #eee;
    background: #fafafa;
}
.admin-panel-header h3 {
    font-size: 15px;
    font-weight: 600;
    color: #1a1a2e;
    margin: 0;
}

/* ── 탭 ── */
.tab-bar {
    display: flex;
    border-bottom: 2px solid #eee;
    margin-bottom: 20px;
}
.tab-btn {
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    color: #888;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    cursor: pointer;
    transition: color 0.12s;
    font-family: inherit;
}
.tab-btn.active { color: #6366F1; border-bottom-color: #6366F1; }
.tab-btn:hover:not(.active) { color: #444; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ── KV 테이블 ── */
.kv-table { width: 100%; border-collapse: collapse; }
.kv-table tr { border-bottom: 1px solid #f0f0f0; }
.kv-table tr:last-child { border-bottom: none; }
.kv-table th {
    width: 140px;
    padding: 10px 16px;
    font-size: 13px;
    font-weight: 600;
    color: #555;
    text-align: left;
    background: #fafafa;
}
.kv-table td { padding: 10px 16px; font-size: 13px; color: #333; }

/* ── 액션 폼 ── */
.action-row {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    padding: 14px 16px;
    background: #fafafa;
    border-radius: 8px;
    margin-bottom: 12px;
}
.action-row label { font-size: 13px; font-weight: 600; color: #555; white-space: nowrap; }
.action-row select, .action-row input[type=date] {
    padding: 7px 10px;
    font-size: 13px;
    border: 1px solid #d0d5dd;
    border-radius: 6px;
    font-family: inherit;
}

/* ── 알림 메시지 ── */
.msg-box {
    display: none;
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 13px;
    margin-bottom: 12px;
}
.msg-box.ok  { display: block; background: #e6fff7; color: #00b894; }
.msg-box.err { display: block; background: #ffe6e6; color: #d63031; }

/* ── 기타 ── */
.empty-msg { text-align: center; padding: 40px; color: #aaa; font-size: 14px; }
.usage-bar {
    display: inline-block;
    height: 6px;
    border-radius: 3px;
    background: #6366F1;
    vertical-align: middle;
    margin-left: 6px;
}
.charts-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 20px; }
.bottom-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.info-grid  { display: grid; grid-template-columns: repeat(3,1fr); gap: 14px; margin-bottom: 20px; }
.info-card  {
    background: #fff;
    border: 1px solid #e8e8f0;
    border-radius: 10px;
    padding: 16px 20px;
    box-shadow: 0 1px 4px rgba(0,0,0,.05);
}
.info-card .ic-label { font-size: 12px; color: #888; margin-bottom: 5px; }
.info-card .ic-value { font-size: 18px; font-weight: 700; color: #1a1a2e; }

/* ── data-table 보조 (center 정렬 컬럼) ── */
.data-table td.center, .data-table th.center { text-align: center; }

/* 로그인 페이지 */
.admin-login-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1a1a2e 0%, #2d3561 100%);
}
.admin-login-box {
    background: #fff;
    border-radius: 16px;
    padding: 40px 36px;
    width: 380px;
    box-shadow: 0 20px 60px rgba(0,0,0,.25);
}
.admin-login-logo { text-align: center; margin-bottom: 28px; }
.admin-login-logo .brand { font-size: 22px; font-weight: 800; color: #1a1a2e; }
.admin-login-logo .brand span { color: #6366F1; }
.admin-login-logo .sub {
    font-size: 11px;
    color: #aaa;
    margin-top: 4px;
    letter-spacing: 0.15em;
    text-transform: uppercase;
}
.admin-login-input {
    width: 100%;
    padding: 12px 14px;
    font-size: 14px;
    border: 1.5px solid #e0e0e0;
    border-radius: 8px;
    margin-bottom: 12px;
    font-family: inherit;
    transition: border-color 0.12s;
}
.admin-login-input:focus { outline: none; border-color: #6366F1; }
.admin-login-btn {
    width: 100%;
    padding: 13px;
    font-size: 15px;
    font-weight: 700;
    background: #6366F1;
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    margin-top: 4px;
    font-family: inherit;
    transition: background 0.15s;
}
.admin-login-btn:hover { background: #5558E3; }
.admin-login-btn:disabled { background: #aaa; cursor: not-allowed; }
.admin-login-error {
    color: #d63031;
    font-size: 13px;
    text-align: center;
    margin-top: 10px;
    min-height: 18px;
}

@media (max-width: 1100px) {
    .charts-row, .bottom-row { grid-template-columns: 1fr; }
    .info-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 800px) {
    .stats-grid { grid-template-columns: repeat(2,1fr) !important; }
}
