/* 관리자 공통 — 밝은 파스텔 톤 */

:root {
    --ch-bg: #f4f7fb;
    --ch-bg-accent: #eef4ff;
    --ch-surface: #ffffff;
    --ch-surface-soft: #f8fafc;
    --ch-text: #1e293b;
    --ch-text-secondary: #64748b;
    --ch-text-muted: #94a3b8;
    --ch-border: rgba(148, 163, 184, 0.28);
    --ch-border-strong: rgba(148, 163, 184, 0.42);
    --ch-primary: #5b7cfa;
    --ch-primary-soft: #dbe4ff;
    --ch-primary-deep: #3d5af1;
    --ch-mint: #5ec4a8;
    --ch-mint-soft: #d8f5ec;
    --ch-sky: #6bb8f0;
    --ch-sky-soft: #e0f2fe;
    --ch-lavender: #a78bfa;
    --ch-lavender-soft: #eee8ff;
    --ch-peach: #f9b67a;
    --ch-peach-soft: #fff1e6;
    --ch-rose: #f093a5;
    --ch-rose-soft: #ffe8ed;
    --ch-shadow: 0 10px 30px rgba(99, 124, 250, 0.08);
    --ch-shadow-lg: 0 16px 40px rgba(99, 124, 250, 0.12);
}

.ch-admin-page {
    min-height: 100vh;
    background:
        radial-gradient(ellipse 70% 45% at 10% -10%, rgba(167, 139, 250, 0.18), transparent 55%),
        radial-gradient(ellipse 55% 40% at 95% 5%, rgba(107, 184, 240, 0.16), transparent 50%),
        radial-gradient(ellipse 50% 35% at 50% 100%, rgba(94, 196, 168, 0.1), transparent 55%),
        linear-gradient(180deg, #f7f9fc 0%, #eef4ff 100%);
    color: var(--ch-text);
    font-family: "Segoe UI", "Noto Sans KR", Pretendard, "Apple SD Gothic Neo", sans-serif;
}

.ch-admin-shell {
    max-width: 960px;
    margin: 0 auto;
    padding: 0 24px 48px;
}

.ch-admin-shell--wide {
    max-width: 1400px;
}

.ch-admin-loading,
.ch-admin-error-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    gap: 16px;
    color: var(--ch-text-secondary);
    font-size: 15px;
}

.ch-admin-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #e2e8f0;
    border-top-color: var(--ch-primary);
    border-radius: 50%;
    animation: ch-admin-spin 0.75s linear infinite;
}

@keyframes ch-admin-spin {
    to { transform: rotate(360deg); }
}

.ch-admin-topbar {
    padding: 24px 0 20px;
    border-bottom: 1px solid var(--ch-border);
    margin-bottom: 24px;
}

.ch-admin-topbar-nav {
    margin-bottom: 16px;
}

.ch-admin-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid var(--ch-border);
    border-radius: 12px;
    color: var(--ch-text);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    line-height: 1;
    cursor: pointer;
    font-family: inherit;
    box-shadow: 0 4px 14px rgba(148, 163, 184, 0.12);
    transition: background 0.15s, border-color 0.15s, transform 0.15s, box-shadow 0.15s;
}

.ch-admin-back:hover {
    background: #fff;
    border-color: rgba(91, 124, 250, 0.35);
    color: var(--ch-primary-deep);
    transform: translateX(-2px);
    box-shadow: 0 8px 20px rgba(91, 124, 250, 0.12);
}

.ch-admin-back-icon {
    font-size: 16px;
    font-weight: 700;
    color: var(--ch-primary);
}

.ch-admin-topbar-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 16px;
}

.ch-admin-topbar-left {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ch-admin-topbar h1 {
    margin: 0;
    font-size: 26px;
    font-weight: 700;
    color: #0f172a;
    letter-spacing: -0.02em;
}

.ch-admin-topbar-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.ch-admin-card {
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid var(--ch-border);
    border-radius: 18px;
    padding: 28px;
    box-shadow: var(--ch-shadow);
    backdrop-filter: blur(8px);
}

.ch-admin-card + .ch-admin-card {
    margin-top: 20px;
}

.ch-admin-section-title {
    margin: 0 0 16px;
    font-size: 15px;
    font-weight: 650;
    color: #334155;
}

.ch-admin-section-sub {
    margin: -8px 0 20px;
    font-size: 13px;
    color: var(--ch-text-secondary);
    line-height: 1.5;
}

.ch-alert {
    padding: 14px 16px;
    border-radius: 12px;
    margin-bottom: 20px;
    font-size: 14px;
    line-height: 1.5;
    border: 1px solid transparent;
}

.ch-alert--success {
    background: var(--ch-mint-soft);
    color: #0f766e;
    border-color: rgba(94, 196, 168, 0.35);
}

.ch-alert--error {
    background: var(--ch-rose-soft);
    color: #be123c;
    border-color: rgba(240, 147, 165, 0.4);
}

.ch-alert--warning {
    background: var(--ch-peach-soft);
    color: #b45309;
    border-color: rgba(249, 182, 122, 0.4);
}

.ch-form-group {
    margin-bottom: 20px;
}

.ch-form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 13px;
    font-weight: 600;
    color: #475569;
}

.ch-form-input {
    width: 100%;
    padding: 12px 14px;
    background: #fff;
    border: 1px solid var(--ch-border-strong);
    border-radius: 12px;
    color: var(--ch-text);
    font-size: 15px;
    box-sizing: border-box;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.ch-form-input::placeholder {
    color: #94a3b8;
}

.ch-form-input:focus {
    outline: none;
    border-color: var(--ch-primary);
    box-shadow: 0 0 0 3px rgba(91, 124, 250, 0.18);
}

.ch-form-input:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background: #f8fafc;
}

.ch-form-hint {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: var(--ch-text-secondary);
    line-height: 1.45;
}

.ch-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 18px;
    border: none;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.15s, opacity 0.15s, background 0.15s, box-shadow 0.15s;
}

.ch-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.ch-btn-primary {
    background: linear-gradient(135deg, #6b8cff, #8b7cf6);
    color: #fff;
    box-shadow: 0 8px 18px rgba(91, 124, 250, 0.28);
}

.ch-btn-primary:hover:not(:disabled) {
    transform: translateY(-1px);
    opacity: 0.96;
}

.ch-btn-secondary {
    background: #fff;
    color: #475569;
    border: 1px solid var(--ch-border-strong);
}

.ch-btn-secondary:hover:not(:disabled) {
    background: #f8fafc;
    border-color: rgba(91, 124, 250, 0.35);
    color: var(--ch-primary-deep);
}

.ch-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
}

.ch-status-badge--ok {
    background: var(--ch-mint-soft);
    color: #0f766e;
    border: 1px solid rgba(94, 196, 168, 0.4);
}

.ch-status-badge--warn {
    background: var(--ch-peach-soft);
    color: #b45309;
    border: 1px solid rgba(249, 182, 122, 0.45);
}

.ch-status-date {
    margin: 10px 0 0;
    font-size: 13px;
    color: var(--ch-text-secondary);
}

.ch-divider {
    height: 1px;
    background: var(--ch-border);
    margin: 24px 0;
    border: none;
}

@media (max-width: 768px) {
    .ch-admin-shell {
        padding: 0 16px 32px;
    }

    .ch-admin-topbar-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .ch-admin-topbar-actions {
        width: 100%;
    }

    .ch-admin-card {
        padding: 20px;
    }
}

/* ── AdminLayout 고정 사이드바 (전역: 레이아웃 scoped CSS 미적용 방지) ── */
.adm-layout {
    min-height: 100vh;
    display: block;
}

.adm-layout > .adm-sidebar,
.adm-layout .adm-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: 220px;
    height: 100vh;
    box-sizing: border-box;
    padding: 27px 15px 19px;
    color: #dbe2f6;
    background: linear-gradient(180deg, #1f2940, #182135 62%, #151e31);
    box-shadow: 8px 0 30px rgba(30, 41, 65, 0.1);
    display: flex;
    flex-direction: column;
    z-index: 20;
}

.adm-layout .adm-side-brand {
    display: flex;
    align-items: baseline;
    gap: 5px;
    padding: 0 12px 28px;
    text-decoration: none;
    font-size: 20px;
    font-weight: 850;
    letter-spacing: -0.04em;
}

.adm-layout .adm-side-brand span { color: #7c9cff; }
.adm-layout .adm-side-brand em { color: #62d2ef; font-style: normal; }

.adm-sidebar .adm-side-logo,
.adm-layout .adm-side-logo {
    display: block;
    margin: 0 4px 22px;
    padding: 8px 10px;
    border-radius: 12px;
    background: #fff;
}

.adm-sidebar .adm-side-logo .site-logo--sm,
.adm-layout .adm-side-logo .site-logo--sm {
    width: 148px;
}

.adm-layout .adm-side-nav {
    display: flex;
    flex-direction: column;
    gap: 5px;
    overflow-y: auto;
}

.adm-layout .adm-side-item {
    --menu-index: 0;
    opacity: 0;
    transform: translateX(-18px);
    animation: adm-menu-in 0.44s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
    animation-delay: calc(70ms + var(--menu-index) * 55ms);
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 42px;
    padding: 0 12px;
    border-radius: 11px;
    color: #aebad1;
    text-decoration: none;
    font-size: 13px;
    font-weight: 650;
    transition: 0.18s;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
}

.adm-layout .adm-side-item::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(120, 137, 255, 0.17), transparent);
    opacity: 0;
    transition: 0.18s;
}

.adm-layout .adm-side-item:hover {
    color: #fff;
    transform: translateX(4px);
    background: rgba(255, 255, 255, 0.055);
}

.adm-layout .adm-side-item:hover::after,
.adm-layout .adm-side-item.active::after {
    opacity: 1;
}

.adm-layout .adm-side-item.active {
    color: #fff;
    background: rgba(111, 125, 255, 0.15);
    box-shadow: inset 3px 0 #8591ff;
}

.adm-layout .adm-side-icon {
    width: 23px;
    text-align: center;
    color: #8697bd;
    font-size: 16px;
    z-index: 1;
    pointer-events: none;
    user-select: none;
}

.adm-layout .adm-side-item > span:last-child {
    z-index: 1;
    pointer-events: none;
    user-select: none;
}

@keyframes adm-menu-in {
    to { opacity: 1; transform: translateX(0); }
}

.adm-layout .adm-side-bottom {
    margin-top: auto;
    padding: 15px 10px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    font-size: 12px;
    color: #9eabc3;
}

.adm-layout .adm-side-bottom a {
    border: 0;
    color: #f29aaf;
    background: transparent;
    font-size: 11px;
    cursor: pointer;
    text-decoration: none;
}

.adm-layout .adm-side-bottom a:hover { color: #ffb7c7; }

.adm-layout-main {
    min-height: 100vh;
    padding-left: 220px;
    box-sizing: border-box;
}

@media (max-width: 900px) {
    .adm-layout-main { padding-left: 0; }

    .adm-layout > .adm-sidebar,
    .adm-layout .adm-sidebar {
        position: relative;
        width: auto;
        height: auto;
        padding: 15px;
    }

    .adm-layout .adm-side-brand { padding-bottom: 13px; }

    .adm-layout .adm-side-nav {
        flex-direction: row;
        overflow-x: auto;
        padding-bottom: 4px;
    }

    .adm-layout .adm-side-item {
        flex: 0 0 auto;
        padding: 0 12px;
        opacity: 1;
        transform: none;
        animation: none;
    }

    .adm-layout .adm-side-bottom { display: none; }
}

/* 상품관리 케어유형 필터 — scoped CSS 캐시 누락 대비 */
.products-page .prd-filter-bar {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    margin: 0 0 20px;
    padding: 4px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(148, 163, 184, 0.35);
    border-radius: 12px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.products-page .prd-filter-btn {
    -webkit-appearance: none;
    appearance: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 9px 16px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: #64748b;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.2;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.products-page .prd-filter-btn:hover {
    color: #334155;
    background: rgba(148, 163, 184, 0.14);
}

.products-page .prd-filter-btn.active {
    background: #fff;
    color: #1e293b;
    box-shadow:
        0 1px 2px rgba(15, 23, 42, 0.06),
        0 0 0 1px rgba(148, 163, 184, 0.28);
}

.products-page .prd-filter-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 7px;
    border-radius: 8px;
    background: rgba(100, 116, 139, 0.12);
    color: #475569;
    font-size: 12px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.products-page .prd-filter-btn.active .prd-filter-count {
    background: rgba(79, 70, 229, 0.12);
    color: #4338ca;
}

/* Cloudflare email obfuscation 우회 (푸터·약관 공용) */
.site-email {
    display: inline;
    white-space: nowrap;
}

.site-email::before {
    content: attr(data-u) "\0040" attr(data-d);
}
