/*!
 * MIS v2 커스텀 CSS
 */

/* ===== 기본 스타일링 ===== */
:root {
    --primary-color: #007bff;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
    --border-color: #dee2e6;
    --text-muted: #6c757d;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
}

/* ===== 테이블 스타일 개선 ===== */
.table {
    background-color: #fff;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 1.5rem;
    font-size: 14px;
}

.table thead {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

.table thead th {
    border-bottom: 2px solid var(--border-color);
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #495057;
    padding: 12px 15px;
    white-space: nowrap;
    vertical-align: middle;
}

.table tbody td {
    padding: 12px 15px;
    vertical-align: middle;
    border-bottom: 1px solid #f1f3f4;
    color: #333;
    font-size: 13px;
}

.table tbody tr:hover {
    background-color: #f8f9fa;
    transition: background-color 0.2s ease;
}

.table tbody tr:last-child td {
    border-bottom: none;
}

/* 정렬 가능한 테이블 헤더 */
.table thead th.sortable {
    cursor: pointer;
    position: relative;
    user-select: none;
    padding-right: 30px;
}

.table thead th.sortable:hover {
    background-color: #e9ecef;
    color: var(--primary-color);
}

.table thead th.sortable::after {
    content: '\2195';
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #adb5bd;
    font-size: 12px;
}

.table thead th.sortable.asc::after {
    content: '\2191';
    color: var(--primary-color);
}

.table thead th.sortable.desc::after {
    content: '\2193';
    color: var(--primary-color);
}

/* 테이블 데이터 타입별 스타일 */
.table td.text-center {
    text-align: center;
}

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

.table td.number {
    font-family: 'Courier New', monospace;
    text-align: right;
    font-weight: 500;
}

.table td.date {
    color: var(--text-muted);
    font-size: 12px;
}

.table td.status {
    font-weight: 600;
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.5px;
}

/* 테이블 반응형 */
.table-responsive {
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

@media (max-width: 768px) {
    .table thead th,
    .table tbody td {
        padding: 8px 10px;
        font-size: 12px;
    }
    
    .table thead th.sortable {
        padding-right: 25px;
    }
}

/* ===== 카드 스타일 개선 ===== */
.card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}

.card-header {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-bottom: 1px solid var(--border-color);
    border-radius: 12px 12px 0 0 !important;
    padding: 15px 20px;
}

.card-header h5 {
    margin: 0;
    font-weight: 600;
    color: #495057;
}

.card-body {
    padding: 20px;
}

/* ===== 버튼 스타일 개선 ===== */
.btn {
    border-radius: 6px;
    font-weight: 500;
    letter-spacing: 0.3px;
    transition: all 0.2s ease;
    padding: 8px 16px;
    font-size: 13px;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.btn-lg {
    padding: 12px 24px;
    font-size: 16px;
}

/* ===== 폼 스타일 개선 ===== */
.form-control {
    border-radius: 6px;
    border: 1px solid #ced4da;
    padding: 10px 12px;
    font-size: 13px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.form-label {
    font-weight: 500;
    color: #495057;
    margin-bottom: 6px;
    font-size: 13px;
}

/* ===== 배지 스타일 ===== */
.badge {
    font-size: 11px;
    font-weight: 500;
    padding: 4px 8px;
    border-radius: 12px;
    letter-spacing: 0.3px;
}

/* ===== 페이지네이션 스타일 ===== */
.pagination {
    margin: 0;
}

.page-link {
    border-radius: 6px;
    margin: 0 2px;
    border: 1px solid var(--border-color);
    color: var(--primary-color);
    padding: 8px 12px;
    font-size: 13px;
}

.page-link:hover {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.page-item.active .page-link {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

/* ===== 사이드바 스타일 ===== */
#sidebar {
    min-height: 100vh;
    transition: all 0.3s ease;
}

#sidebar .nav-link {
    color: rgba(255, 255, 255, 0.8);
    padding: 10px 15px;
    border-radius: 6px;
    margin: 2px 0;
    transition: all 0.2s ease;
}

#sidebar .nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
}

#sidebar .nav-link.active {
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
}

/* ===== 알림 스타일 ===== */
.alert {
    border: none;
    border-radius: 8px;
    padding: 15px 20px;
    margin-bottom: 20px;
    border-left: 4px solid;
}

.alert-success {
    background-color: #d4edda;
    border-left-color: var(--success-color);
    color: #155724;
}

.alert-danger {
    background-color: #f8d7da;
    border-left-color: var(--danger-color);
    color: #721c24;
}

.alert-warning {
    background-color: #fff3cd;
    border-left-color: var(--warning-color);
    color: #856404;
}

.alert-info {
    background-color: #d1ecf1;
    border-left-color: var(--info-color);
    color: #0c5460;
}

/* ===== 검색 폼 스타일 ===== */
.search-form {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.search-form .row {
    align-items: end;
}

.search-form .form-control {
    margin-bottom: 10px;
}

/* ===== 통계 카드 스타일 ===== */
.stats-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    margin-bottom: 20px;
}

.stats-card h3 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 5px;
}

.stats-card p {
    margin: 0;
    opacity: 0.9;
    font-size: 14px;
}

/* ===== 로딩 스피너 ===== */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.loading-content {
    background: white;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

/* ===== 회사별 테마 ===== */
.company-theme-aone {
    --primary-color: #007bff;
}

.company-theme-aone-world {
    --primary-color: #28a745;
}

/* ===== 반응형 디자인 ===== */
@media (max-width: 992px) {
    .card-body {
        padding: 15px;
    }
    
    .search-form {
        padding: 15px;
    }
}

@media (max-width: 576px) {
    .btn {
        padding: 6px 12px;
        font-size: 12px;
    }
    
    .card-header {
        padding: 12px 15px;
    }
    
    .card-body {
        padding: 12px;
    }
}

/* ===== 유틸리티 클래스 ===== */
.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.bg-gradient-primary {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%) !important;
}

.bg-gradient-success {
    background: linear-gradient(135deg, #28a745 0%, #1e7e34 100%) !important;
}

.shadow-sm {
    box-shadow: 0 2px 4px rgba(0,0,0,0.1) !important;
}

.shadow {
    box-shadow: 0 4px 8px rgba(0,0,0,0.15) !important;
}

.border-radius-lg {
    border-radius: 12px !important;
}

/* ===== 프린트 스타일 ===== */
@media print {
    .no-print {
        display: none !important;
    }
    
    .table {
        box-shadow: none;
        border: 1px solid #000;
    }
    
    .table thead th {
        background-color: #f8f9fa !important;
        -webkit-print-color-adjust: exact;
    }
} 