/* PR-UI-C1: Toss 디자인 시스템 — 토큰(:root 변수) + 재사용 컴포넌트 클래스.
   기존 style.css는 레거시 페이지가 계속 쓰므로 무변, 이 파일은 그 다음에 로드되어
   레이아웃(사이드바/콘텐츠)과 신규 컴포넌트에만 적용된다. C-2/C-3에서 페이지별로
   .t-* 클래스를 그대로 재사용한다. */

/* ── 폰트: Pretendard (variable, 로컬 번들) ─────────────────────────────── */
@font-face {
    font-family: 'Pretendard Variable';
    src: url('/fonts/PretendardVariable.woff2') format('woff2-variations');
    font-weight: 45 920;
    font-display: swap;
}

/* ── 디자인 토큰 ───────────────────────────────────────────────────────── */
:root {
    /* 포인트 */
    --t-blue: #3182F6;
    --t-blue-hover: #1B64DA;
    --t-blue-bg: #E8F3FF;

    /* 텍스트 */
    --t-text-title: #191F28;
    --t-text-body: #4E5968;
    --t-text-muted: #8B95A1;

    /* 배경 */
    --t-bg-content: #F9FAFB;
    --t-bg-card: #FFFFFF;
    --t-border: #E5E8EB;
    --t-bg-gray: #F2F4F6;

    /* 시맨틱 */
    --t-success: #00A661;
    --t-success-bg: #E6F7EF;
    --t-warn: #B8850C;
    --t-warn-bg: #FDF3DC;
    --t-danger: #E5503C;
    --t-danger-bg: #FDECEA;

    /* 라운드 */
    --t-radius-card: 16px;
    --t-radius-control: 10px;
    --t-radius-badge: 6px;

    /* 정렬 */
    --t-grid: 8px;
    --t-control-height: 40px;
    --t-row-height: 52px;
    --t-card-padding: 24px;

    /* 폰트 */
    --t-font-family: 'Pretendard Variable', 'Pretendard', -apple-system, 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif;
}

/* ── 카드 ──────────────────────────────────────────────────────────────── */
.t-card {
    background: var(--t-bg-card);
    border-radius: var(--t-radius-card);
    padding: var(--t-card-padding);
}

.t-card-line {
    background: var(--t-bg-card);
    border: 1px solid var(--t-border);
    border-radius: var(--t-radius-card);
    padding: var(--t-card-padding);
}

/* ── 버튼 ──────────────────────────────────────────────────────────────── */
.t-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: var(--t-control-height);
    padding: 0 16px;
    border-radius: var(--t-radius-control);
    border: none;
    font-size: 14px;
    font-weight: 500;
    font-family: var(--t-font-family);
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease;
    background: var(--t-bg-gray);
    color: var(--t-text-body);
}

.t-btn-primary {
    background: var(--t-blue);
    color: #FFFFFF;
}

.t-btn-primary:hover {
    background: var(--t-blue-hover);
}

.t-btn-ghost {
    background: var(--t-bg-gray);
    color: var(--t-text-body);
}

.t-btn-ghost:hover {
    background: var(--t-border);
}

.t-btn-danger {
    background: var(--t-danger-bg);
    color: var(--t-danger);
}

.t-btn-danger:hover {
    background: var(--t-danger);
    color: #FFFFFF;
}

.t-btn-sm {
    height: 30px;
    padding: 0 12px;
    font-size: 12.5px;
}

/* ── 입력/셀렉트 ───────────────────────────────────────────────────────── */
.t-input,
.t-select {
    height: var(--t-control-height);
    width: 100%;
    padding: 0 12px;
    border: 1px solid var(--t-border);
    border-radius: var(--t-radius-control);
    font-size: 14px;
    font-family: var(--t-font-family);
    color: var(--t-text-title);
    background: var(--t-bg-card);
    box-sizing: border-box;
    transition: border-color 0.15s ease;
}

.t-input:focus,
.t-select:focus {
    outline: none;
    border: 1.5px solid var(--t-blue);
}

.t-select {
    appearance: auto;
}

/* ── 테이블 ────────────────────────────────────────────────────────────── */
.t-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13.5px;
}

.t-table th {
    text-align: left;
    color: var(--t-text-muted);
    font-weight: 500;
    font-size: 12.5px;
    padding: 0 12px 8px;
}

.t-table td {
    height: var(--t-row-height);
    padding: 0 12px;
    vertical-align: middle;
    border-top: 1px solid var(--t-bg-gray);
    color: var(--t-text-body);
}

.t-table td.num {
    text-align: right;
}

.t-table td.sub,
.t-table span.sub {
    color: var(--t-text-muted);
    font-size: 12px;
}

/* ── 배지 ──────────────────────────────────────────────────────────────── */
.t-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: var(--t-radius-badge);
    font-size: 12px;
    font-weight: 500;
    background: var(--t-bg-gray);
    color: var(--t-text-body);
}

.t-badge-success {
    background: var(--t-success-bg);
    color: var(--t-success);
}

.t-badge-warn {
    background: var(--t-warn-bg);
    color: var(--t-warn);
}

.t-badge-danger {
    background: var(--t-danger-bg);
    color: var(--t-danger);
}

.t-badge-muted {
    background: var(--t-bg-gray);
    color: var(--t-text-muted);
}

/* ── 탭 ────────────────────────────────────────────────────────────────── */
.t-tab-bar {
    display: flex;
    gap: 24px;
    border-bottom: 1px solid var(--t-border);
}

.t-tab {
    display: inline-block;
    padding: 12px 2px;
    font-size: 14px;
    font-weight: 500;
    color: var(--t-text-muted);
    border-bottom: 2px solid transparent;
    cursor: pointer;
    background: none;
    border-left: none;
    border-right: none;
    border-top: none;
    margin-bottom: -1px;
}

.t-tab.active {
    color: var(--t-blue);
    border-bottom: 2px solid var(--t-blue);
}

/* ── 스탯 카드 ─────────────────────────────────────────────────────────── */
.t-stat {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.t-stat .t-stat-label {
    font-size: 12px;
    color: var(--t-text-muted);
}

.t-stat .t-stat-value {
    font-size: 20px;
    font-weight: 500;
    color: var(--t-text-title);
}

/* ── 페이지 헤더 ───────────────────────────────────────────────────────── */
.t-page-header {
    margin-bottom: var(--t-card-padding);
}

.t-page-header .t-page-title {
    font-size: 18px;
    font-weight: 500;
    color: var(--t-text-title);
}

.t-page-header .t-page-sub {
    font-size: 12.5px;
    color: var(--t-text-muted);
    margin-top: 4px;
}

/* ── PR-UI-C2: 스탯 카드 그리드 / 진행바 / 말줄임 유틸 (C-2 상품관리에서 최초 사용,
   재사용 가능하도록 toss.css에 추가) ─────────────────────────────────────── */
.t-stat-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: var(--t-card-padding);
}

@media (max-width: 768px) {
    .t-stat-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.t-progress {
    height: 6px;
    border-radius: 3px;
    background: var(--t-bg-gray);
    overflow: hidden;
    margin-top: 6px;
}

.t-progress-bar {
    height: 100%;
    width: 0%;
    background: var(--t-blue);
    transition: width 0.3s ease;
}

.t-truncate {
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
