/* ─── 기본 스타일 ──────────────────────────────────────────── */
:root {
    --sidebar-width: 250px;
    --primary-color: #4361ee;
    --primary-light: #eef0ff;
    --success-color: #2ec4b6;
    --warning-color: #ff9f1c;
    --danger-color: #e71d36;
    --dark-color: #2b2d42;
    --gray-100: #f8f9fa;
    --gray-200: #e9ecef;
    --gray-600: #6c757d;
}

body {
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: #f5f6fa;
    color: #333;
}

/* ─── 사이드바 ─────────────────────────────────────────────── */
.sidebar {
    width: var(--sidebar-width);
    min-height: 100vh;
    background: var(--dark-color);
    color: white;
    position: fixed;
    left: 0;
    top: 0;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-header h4 {
    margin: 0;
    font-weight: 700;
    color: var(--primary-color);
}

.sidebar .nav-link {
    color: rgba(255,255,255,0.7);
    padding: 0.75rem 1.5rem;
    border-left: 3px solid transparent;
    transition: all 0.2s;
}

.sidebar .nav-link:hover {
    color: white;
    background: rgba(255,255,255,0.05);
    border-left-color: rgba(255,255,255,0.3);
}

.sidebar .nav-link.active {
    color: white;
    background: rgba(67, 97, 238, 0.2);
    border-left-color: var(--primary-color);
}

.sidebar .nav-link i {
    width: 24px;
    margin-right: 0.5rem;
}

.sidebar-footer {
    margin-top: auto;
    padding: 1rem 1.5rem;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.sidebar-footer .nav-link {
    padding: 0.5rem 0;
    font-size: 0.9rem;
}

/* ─── 메인 컨텐츠 ─────────────────────────────────────────── */
.main-content {
    margin-left: var(--sidebar-width);
    width: calc(100% - var(--sidebar-width));
    min-height: 100vh;
}

/* ─── 카드 스타일 ─────────────────────────────────────────── */
.stat-card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    transition: transform 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
}

.stat-card .card-body {
    padding: 1.25rem;
}

.stat-card .stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.stat-card .stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.2;
}

.stat-card .stat-label {
    font-size: 0.85rem;
    color: var(--gray-600);
}

.icon-primary { background: var(--primary-light); color: var(--primary-color); }
.icon-success { background: #e8f8f5; color: var(--success-color); }
.icon-warning { background: #fff8e8; color: var(--warning-color); }
.icon-danger { background: #fde8eb; color: var(--danger-color); }
.icon-info { background: #e8f4fd; color: #3498db; }

/* ─── 테이블 ──────────────────────────────────────────────── */
.table-card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    overflow: hidden;
}

.table-card .card-header {
    background: white;
    border-bottom: 1px solid var(--gray-200);
    font-weight: 600;
    padding: 1rem 1.25rem;
}

.table th {
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    color: var(--gray-600);
    border-bottom: 2px solid var(--gray-200);
}

.table td {
    vertical-align: middle;
}

/* ─── 뱃지 ────────────────────────────────────────────────── */
.badge-in {
    background: #d4edda;
    color: #155724;
}

.badge-out {
    background: #f8d7da;
    color: #721c24;
}

.stock-low {
    color: var(--danger-color);
    font-weight: 700;
}

.stock-ok {
    color: var(--success-color);
    font-weight: 600;
}

/* ─── 폼 ──────────────────────────────────────────────────── */
.form-card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}

.form-label {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--dark-color);
}

/* ─── 로그인 ──────────────────────────────────────────────── */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--dark-color) 0%, #1a1a2e 100%);
}

.login-card {
    width: 100%;
    max-width: 420px;
    border: none;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.login-card .card-body {
    padding: 2.5rem;
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-header h2 {
    font-weight: 700;
    color: var(--primary-color);
}

/* ─── 바코드 스캐너 ───────────────────────────────────────── */
.scanner-area {
    border: 2px dashed var(--gray-200);
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    background: var(--gray-100);
}

/* ─── 반응형 ──────────────────────────────────────────────── */
@media (max-width: 767.98px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.show {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
        width: 100%;
    }

    .stat-card .stat-value {
        font-size: 1.25rem;
    }
}

/* ─── 차트 영역 ───────────────────────────────────────────── */
.chart-container {
    position: relative;
    height: 300px;
}

/* ─── 이미지 업로드 ───────────────────────────────────────── */
.drop-zone {
    border: 2px dashed #dee2e6;
    border-radius: 12px;
    padding: 2rem 1rem;
    text-align: center;
    background: #f8f9fa;
    cursor: pointer;
    transition: all 0.2s;
    min-height: 200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.drop-zone:hover {
    border-color: var(--primary-color);
    background: #f0f2ff;
}

/* ─── 기타 유틸 ───────────────────────────────────────────── */
.cursor-pointer { cursor: pointer; }
.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
