/* ── AceCoach AI 공통 스타일 ── */

/* ── 구글 폰트 ── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ── 브랜드 컬러 변수 ── */
:root {
    --ace-yellow:    #CCFF00;
    --ace-yellow-dk: #A8D400;
    --ace-navy:      #0A1628;
    --ace-navy-2:    #0F2040;
    --ace-navy-3:    #162B52;
    --ace-coral:     #FF4B2B;
    --ace-gray-50:   #F7F8FA;
    --ace-gray-100:  #EEF0F4;
    --ace-gray-200:  #DDE1EA;
    --ace-gray-400:  #9AA3B5;
    --ace-gray-600:  #5A6478;
    --ace-gray-800:  #2D3547;

    --radius-sm:  8px;
    --radius-md:  12px;
    --radius-lg:  18px;
    --shadow-sm:  0 1px 4px rgba(0,0,0,.06), 0 2px 8px rgba(0,0,0,.04);
    --shadow-md:  0 4px 16px rgba(0,0,0,.08), 0 1px 4px rgba(0,0,0,.04);
    --shadow-lg:  0 8px 32px rgba(0,0,0,.12), 0 2px 8px rgba(0,0,0,.06);
    --transition: 0.18s ease;
}

/* ── 기본 ── */
*, *::before, *::after { box-sizing: border-box; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 14px;
    color: var(--ace-gray-800);
    background: var(--ace-gray-50);
    -webkit-font-smoothing: antialiased;
}

/* ── 유틸리티 ── */
.ace-yellow      { color: var(--ace-yellow) !important; }
.ace-yellow-text { color: var(--ace-yellow) !important; }
.ace-coral       { color: var(--ace-coral)  !important; }
.bg-navy         { background-color: var(--ace-navy) !important; }

/* ── 버튼 ── */
.btn {
    font-size: 13px;
    font-weight: 600;
    letter-spacing: .01em;
    border-radius: var(--radius-sm);
    transition: all var(--transition);
}
.btn-ace-yellow {
    background: var(--ace-yellow);
    border-color: var(--ace-yellow);
    color: var(--ace-navy);
}
.btn-ace-yellow:hover,
.btn-ace-yellow:focus {
    background: var(--ace-yellow-dk);
    border-color: var(--ace-yellow-dk);
    color: var(--ace-navy);
    box-shadow: 0 4px 14px rgba(204,255,0,.35);
    transform: translateY(-1px);
}
.btn-navy {
    background: var(--ace-navy);
    border-color: var(--ace-navy);
    color: #fff;
}
.btn-navy:hover {
    background: var(--ace-navy-2);
    border-color: var(--ace-navy-2);
    color: #fff;
    transform: translateY(-1px);
}

/* ── 폼 컨트롤 ── */
.form-control,
.form-select {
    border-radius: var(--radius-sm);
    border: 1.5px solid var(--ace-gray-200);
    font-size: 14px;
    padding: .5rem .875rem;
    transition: border-color var(--transition), box-shadow var(--transition);
    background-color: #fff;
}
.form-control:focus,
.form-select:focus {
    border-color: var(--ace-yellow);
    box-shadow: 0 0 0 3px rgba(204,255,0,.18);
    outline: none;
}
.form-label {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .04em;
    color: var(--ace-gray-600);
    margin-bottom: .35rem;
}

/* ── 카드 ── */
.card {
    border: 1px solid var(--ace-gray-100);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    background: #fff;
}
.card-header {
    border-bottom: 1px solid var(--ace-gray-100);
    background: transparent;
    padding: 1rem 1.25rem .75rem;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .01em;
    color: var(--ace-gray-800);
}

/* ── 모바일 상단 바 ── */
.mobile-topbar {
    display: none;
    align-items: center;
    gap: .75rem;
    padding: .75rem 1rem;
    background: var(--ace-navy);
    position: sticky;
    top: 0;
    z-index: 900;
    flex-shrink: 0;
}
.mobile-topbar-brand {
    display: flex;
    align-items: center;
    gap: .5rem;
    text-decoration: none;
    flex: 1;
}
.mobile-topbar-brand-icon {
    width: 26px;
    height: 26px;
    background: var(--ace-yellow);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 900;
    color: var(--ace-navy);
    flex-shrink: 0;
}
.mobile-topbar-brand-text {
    font-size: 14px;
    font-weight: 800;
    color: #fff;
}
.mobile-topbar-brand-text span { color: var(--ace-yellow); }
.sidebar-toggle {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: var(--radius-sm);
    background: rgba(255,255,255,.1);
    color: #fff;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
}

/* 사이드바 열릴 때 배경 오버레이 */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1050;
    background: rgba(0,0,0,.45);
}
.sidebar-overlay.active { display: block; }

/* ── 사이드바 ── */
.sidebar {
    width: 224px;
    height: 100vh;
    position: sticky;
    top: 0;
    overflow-y: auto;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    padding: 1rem .875rem;
    background: var(--ace-navy);
    border-right: 1px solid rgba(255,255,255,.04);
}

/* ── 모바일 반응형 ── */
@media (max-width: 768px) {
    .mobile-topbar {
        display: flex;
    }

    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        z-index: 1060;
        transform: translateX(-100%);
        transition: transform .25s ease;
        height: 100dvh;
    }
    .sidebar.open {
        transform: translateX(0);
    }
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: .625rem;
    padding: .5rem .625rem 1.5rem;
    text-decoration: none;
}
.sidebar-brand-icon {
    width: 28px;
    height: 28px;
    background: var(--ace-yellow);
    border-radius: 7px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 900;
    color: var(--ace-navy);
    flex-shrink: 0;
}
.sidebar-brand-text {
    font-size: 15px;
    font-weight: 800;
    color: #fff;
    line-height: 1;
}
.sidebar-brand-text span { color: var(--ace-yellow); }

.sidebar-section-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: rgba(255,255,255,.28);
    padding: .875rem .625rem .35rem;
}

.sidebar .nav-link {
    display: flex;
    align-items: center;
    gap: .55rem;
    color: rgba(255,255,255,.5);
    border-radius: var(--radius-sm);
    padding: .5rem .625rem;
    margin-bottom: 1px;
    font-size: 13px;
    font-weight: 500;
    transition: all var(--transition);
    text-decoration: none;
}
.sidebar .nav-link i {
    font-size: 15px;
    width: 17px;
    text-align: center;
    flex-shrink: 0;
}
.sidebar .nav-link:hover {
    color: rgba(255,255,255,.88);
    background: rgba(255,255,255,.07);
}
.sidebar .nav-link.active {
    color: var(--ace-navy);
    background: var(--ace-yellow);
    font-weight: 700;
}
.sidebar .nav-link.active i { color: var(--ace-navy); }

.sidebar-footer {
    margin-top: auto;
    padding-top: .875rem;
    border-top: 1px solid rgba(255,255,255,.07);
}
.sidebar-user-email {
    font-size: 11px;
    color: rgba(255,255,255,.3);
    padding: .2rem .625rem .5rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ── 페이지 전체 세로 레이아웃 (topbar + d-flex) ── */
body.has-sidebar {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}
body.has-sidebar > .d-flex {
    flex: 1;
}

/* ── 메인 콘텐츠 ── */
.main-content {
    flex: 1;
    min-height: 100vh;
    overflow-y: auto;
    padding: 2rem 2rem;
    background: var(--ace-gray-50);
}

.page-title {
    font-size: 20px;
    font-weight: 800;
    color: var(--ace-gray-800);
    letter-spacing: -.02em;
    margin: 0;
}

/* ── 통계 요약 카드 ── */
.stat-card {
    background: #fff;
    border: 1px solid var(--ace-gray-100);
    border-radius: var(--radius-md);
    padding: 1.25rem 1.375rem;
    box-shadow: var(--shadow-sm);
    transition: box-shadow var(--transition), transform var(--transition);
}
.stat-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}
.stat-card-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--ace-gray-400);
    margin-bottom: .375rem;
}
.stat-card-value {
    font-size: 2rem;
    font-weight: 800;
    color: var(--ace-gray-800);
    letter-spacing: -.03em;
    line-height: 1.1;
}
.stat-card-value.accent { color: var(--ace-yellow-dk); }
.stat-card-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

/* ── 테이블 ── */
.table {
    font-size: 13px;
    margin: 0;
}
.table th {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--ace-gray-400);
    border-bottom: 1px solid var(--ace-gray-100);
    padding: .75rem 1.125rem;
    background: var(--ace-gray-50);
}
.table td {
    padding: .875rem 1.125rem;
    vertical-align: middle;
    border-color: var(--ace-gray-100);
    color: var(--ace-gray-800);
}
.table-hover tbody tr { transition: background var(--transition); }
.table-hover tbody tr:hover { background: var(--ace-gray-50); }

/* ── 페이지네이션 ── */
.pagination { gap: 3px; }
.pagination .page-link {
    border-radius: var(--radius-sm);
    border: 1px solid var(--ace-gray-200);
    color: var(--ace-gray-600);
    font-size: 13px;
    font-weight: 500;
    padding: .4rem .8rem;
    transition: all var(--transition);
}
.pagination .page-link:hover {
    background: var(--ace-gray-100);
    border-color: var(--ace-gray-200);
    color: var(--ace-gray-800);
}
.pagination .page-item.active .page-link {
    background: var(--ace-navy);
    border-color: var(--ace-navy);
    color: #fff;
    box-shadow: 0 2px 8px rgba(10,22,40,.25);
}

/* ── Alert ── */
.alert {
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
    border: none;
}
.alert-danger  { background: #FFF0EE; color: #C0392B; }
.alert-success { background: #F0FFF4; color: #1A7F37; }

/* ── Toast ── */
.toast {
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    border: none;
    font-size: 13px;
    font-weight: 500;
    min-width: 240px;
}

/* ── 스크롤바 ── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--ace-gray-200); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--ace-gray-400); }
