/* SmartGather Partner Portal — CP2 디자인 이식 */
@import url("https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/static/pretendard-dynamic-subset.min.css");

/* ── 폰트 및 기본 리셋 ── */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Pretendard', 'Apple SD Gothic Neo', sans-serif;
    background-color: #050505;
    background-image: radial-gradient(circle at 50% 0%, #1a1a1a 0%, #050505 60%);
    color: #ffffff;
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
    display: flex;
    justify-content: center;
    min-height: 100vh;
}

a { text-decoration: none; color: inherit; }
button { cursor: pointer; border: none; font-family: inherit; }

/* ── 앱 컨테이너 ── */
.app-container {
    width: 100%;
    max-width: 540px;
    background-color: #000000;
    min-height: 100vh;
    position: relative;
    box-shadow: 0 0 50px rgba(0,0,0,0.8);
    display: flex;
    flex-direction: column;
    border-left: 1px solid #222;
    border-right: 1px solid #222;
}

/* ── 색상 유틸 ── */
.text-gold {
    background: linear-gradient(to bottom, #cfc09f 22%, #ffecb3 24%, #a88932 26%, #d4af37 27%, #c5a028 40%, #edc967 78%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    color: #d4af37;
}

/* ── 헤더 ── */
.header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(10, 10, 10, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid #333;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 64px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.brand img {
    height: 36px;
    width: auto;
}

.brand-name {
    font-size: 1.1rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.menu-btn {
    font-size: 24px;
    color: #d4af37;
    cursor: pointer;
    background: none;
    border: none;
    display: flex;
    align-items: center;
    padding: 8px;
}

/* ── 슬라이드 메뉴 오버레이 ── */
.menu-overlay {
    position: fixed;
    top: 0;
    right: -100%;
    width: 100%;
    max-width: 540px;
    height: 100vh;
    background: #0f0f0f;
    z-index: 200;
    transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 70px 40px 40px;
    border-left: 1px solid #333;
    display: flex;
    flex-direction: column;
}

.menu-overlay.active {
    right: 0;
}

.menu-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 199;
    display: none;
}

.menu-backdrop.active {
    display: block;
}

.menu-close {
    position: absolute;
    top: 18px;
    right: 20px;
    font-size: 28px;
    color: #666;
    cursor: pointer;
    background: none;
    border: none;
    display: flex;
    align-items: center;
    transition: color 0.2s;
}

.menu-close:hover { color: #d4af37; }

.nav-item {
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 1.1rem;
    padding: 18px 0;
    border-bottom: 1px solid #1e1e1e;
    color: #ccc;
    cursor: pointer;
    transition: color 0.2s;
}

.nav-item:hover, .nav-item.active { color: #d4af37; }
.nav-item i { color: #d4af37; width: 24px; font-size: 1.2rem; }
.nav-item.logout { color: #ff5555; margin-top: 32px; border-bottom: none; }
.nav-item.logout i { color: #ff5555; }

.menu-footer {
    margin-top: auto;
    text-align: center;
    color: #444;
    font-size: 0.75rem;
    padding-top: 20px;
    border-top: 1px solid #1e1e1e;
}

/* ── 메인 컨테이너 ── */
.container {
    padding: 20px;
    flex: 1;
}

/* ── 섹션 타이틀 ── */
.section-title {
    font-size: 1.05rem;
    color: #888;
    margin-bottom: 20px;
}

/* ── 카드 ── */
.card {
    background: #161616;
    border: 1px solid #2a2a2a;
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 3px; height: 100%;
    background: #d4af37;
    opacity: 0;
    transition: opacity 0.3s;
}

.card:hover::before { opacity: 1; }

.card.main-stat {
    background: radial-gradient(circle at 100% 0%, #2a2200 0%, #161616 50%);
    border: 1px solid #443300;
}

/* ── 통계 ── */
.stat-label {
    font-size: 0.85rem;
    color: #aaa;
    margin-bottom: 8px;
}

.stat-value {
    font-size: 1.8rem;
    font-weight: 800;
    color: #fff;
}

.stat-value.large {
    font-size: 2.2rem;
    color: #d4af37;
}

.stat-sub {
    font-size: 0.75rem;
    color: #d4af37;
    margin-top: 5px;
}

.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

.progress-bar {
    height: 4px;
    background: #333;
    border-radius: 2px;
    margin-top: 15px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #b88a28, #d4af37);
    transition: width 1s ease;
}

/* ── 폼 ── */
.form-group { margin-bottom: 20px; }

.form-label {
    display: block;
    color: #d4af37;
    margin-bottom: 8px;
    font-size: 0.85rem;
    font-weight: 600;
}

.form-input, .form-select {
    width: 100%;
    background: #111;
    border: 1px solid #333;
    color: #fff;
    padding: 14px 15px;
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    outline: none;
    transition: border-color 0.3s;
    -webkit-appearance: none;
}

.form-input:focus, .form-select:focus {
    border-color: #d4af37;
}

.form-select option { background: #111; }

.btn-submit {
    width: 100%;
    padding: 16px;
    border: none;
    border-radius: 8px;
    background: linear-gradient(90deg, #b88a28 0%, #d4af37 50%, #b88a28 100%);
    background-size: 200% auto;
    color: #000;
    font-weight: 800;
    font-size: 1rem;
    font-family: inherit;
    cursor: pointer;
    margin-top: 10px;
    transition: background-position 0.3s, transform 0.1s;
    letter-spacing: 0.03em;
}

.btn-submit:hover { background-position: right center; }
.btn-submit:active { transform: scale(0.98); }

.btn-outline-dark {
    width: 100%;
    padding: 14px;
    border: 1px solid #333;
    border-radius: 8px;
    background: transparent;
    color: #888;
    font-size: 0.95rem;
    font-family: inherit;
    cursor: pointer;
    transition: border-color 0.3s, color 0.3s;
    margin-top: 8px;
}

.btn-outline-dark:hover { border-color: #d4af37; color: #d4af37; }

/* ── 빠른 실행 카드 ── */
.quick-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px 15px;
    text-align: center;
    cursor: pointer;
    border: 1px dashed #444 !important;
    background: transparent !important;
    transition: border-color 0.3s;
    text-decoration: none;
    color: inherit;
}

.quick-card:hover { border-color: #d4af37 !important; }
.quick-card i { font-size: 1.6rem; color: #d4af37; margin-bottom: 8px; }
.quick-card span { font-size: 0.85rem; color: #ccc; }

/* ── 매출 목록 ── */
.sale-item {
    padding: 15px 0;
    border-bottom: 1px solid #1e1e1e;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sale-item:last-child { border-bottom: none; }

.sale-info h4 {
    font-size: 1rem;
    color: #fff;
    margin-bottom: 4px;
    font-weight: 600;
}

.sale-meta {
    font-size: 0.8rem;
    color: #666;
}

.sale-amount { text-align: right; }

.commission {
    color: #d4af37;
    font-weight: 800;
    font-size: 1rem;
    display: block;
}

.status {
    font-size: 0.72rem;
    padding: 3px 8px;
    border-radius: 4px;
    display: inline-block;
    margin-top: 4px;
}

.status.done { background: rgba(212, 175, 55, 0.2); color: #d4af37; }
.status.pending { background: rgba(255,255,255,0.08); color: #888; }

/* ── 손님 목록 테이블 ── */
.table-wrap {
    width: 100%;
    overflow-x: auto;
}

.list-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    font-size: 0.88rem;
    color: #e6e6e6;
}

.list-table thead th {
    position: sticky;
    top: 0;
    background: #0d0d0d;
    color: #aaa;
    text-align: left;
    font-weight: 600;
    border-bottom: 1px solid #2a2a2a;
    padding: 12px 10px;
    font-size: 0.8rem;
    letter-spacing: 0.02em;
}

.list-table tbody td {
    padding: 13px 10px;
    border-bottom: 1px solid #1a1a1a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.list-table tbody tr:hover { background: rgba(212, 175, 55, 0.05); }

.list-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid #222;
}

.list-count {
    font-size: 0.88rem;
    color: #aaa;
    display: flex;
    align-items: center;
    gap: 6px;
}

.list-count i { color: #d4af37; }

.btn-register {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 8px;
    background: linear-gradient(90deg, #d4af37, #f1d785);
    color: #000;
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    text-decoration: none;
}

/* ── 프로필 ── */
.profile-header {
    text-align: center;
    padding: 24px 0 20px;
    border-bottom: 1px solid #222;
    margin-bottom: 20px;
}

.avatar {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #2a2a2a 0%, #111 100%);
    border-radius: 50%;
    margin: 0 auto 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #d4af37;
    color: #d4af37;
    font-size: 2rem;
}

.profile-name { font-size: 1.3rem; font-weight: 800; margin-bottom: 4px; }
.profile-id { color: #666; font-size: 0.85rem; }

.info-label { color: #666; font-size: 0.8rem; margin-bottom: 4px; }
.info-value { color: #fff; font-size: 0.95rem; margin-bottom: 16px; }

.rate-section-title {
    font-size: 0.9rem;
    color: #d4af37;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid #2a2a2a;
    font-weight: 700;
}

.rate-list { display: grid; gap: 8px; }

.rate-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 11px 14px;
    background: #111;
    border-radius: 8px;
    font-size: 0.9rem;
}

.rate-val { color: #d4af37; font-weight: 800; }

/* ── 푸터 ── */
.footer {
    text-align: center;
    padding: 32px 20px;
    border-top: 1px solid #1e1e1e;
    color: #444;
    font-size: 0.75rem;
    margin-top: auto;
}

.footer-logo {
    color: #555;
    margin-bottom: 6px;
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.1em;
}

/* ── 알림 박스 ── */
.alert-box {
    background: rgba(255, 85, 85, 0.08);
    border: 1px solid rgba(255, 85, 85, 0.2);
    color: #ff8888;
    font-size: 0.85rem;
    padding: 12px 16px;
    border-radius: 10px;
    margin-bottom: 16px;
}

.alert-box.success {
    background: rgba(212, 175, 55, 0.08);
    border-color: rgba(212, 175, 55, 0.2);
    color: #d4af37;
}

/* ── 미디어 쿼리 ── */
@media (max-width: 380px) {
    .list-table th:nth-child(3),
    .list-table td:nth-child(3) { display: none; }
}