/* 관리 대시보드 스타일 */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: #f5f6fa;
    color: #2c3e50;
    line-height: 1.6;
}

/* 컨테이너 */
.admin-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0;
}

/* 헤더 */
.admin-header {
    background: #2c3e50;
    color: #fff;
    padding: 20px 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.admin-header h1 {
    font-size: 24px;
    font-weight: 600;
}

/* 탭 네비게이션 */
.tab-navigation {
    display: flex;
    gap: 0;
    background: #34495e;
    padding: 0 24px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.tab-btn {
    background: transparent;
    color: #bdc3c7;
    border: none;
    padding: 14px 20px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 500;
    transition: all 0.2s;
    border-bottom: 3px solid transparent;
}

.tab-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #ecf0f1;
}

.tab-btn.active {
    color: #fff;
    border-bottom-color: #3498db;
}

/* 탭 컨텐츠 */
.tab-content {
    padding: 24px;
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
}

/* 섹션 */
.section {
    background: #fff;
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.section h2 {
    font-size: 20px;
    margin-bottom: 20px;
    color: #2c3e50;
    border-bottom: 2px solid #ecf0f1;
    padding-bottom: 10px;
}

.section h3 {
    font-size: 16px;
    margin-bottom: 12px;
    color: #34495e;
}

/* 컨트롤 */
.controls {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.controls input[type="text"],
.controls input[type="number"],
.controls select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.controls input[type="text"] {
    flex: 1;
    min-width: 200px;
}

.controls label {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* 버튼 */
.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
}

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

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background: #3498db;
    color: #fff;
}

.btn-primary:hover:not(:disabled) {
    background: #2980b9;
}

.btn-success {
    background: #27ae60;
    color: #fff;
}

.btn-success:hover:not(:disabled) {
    background: #229954;
}

.btn-warning {
    background: #f39c12;
    color: #fff;
}

.btn-warning:hover:not(:disabled) {
    background: #e67e22;
}

.btn-secondary {
    background: #95a5a6;
    color: #fff;
}

.btn-secondary:hover:not(:disabled) {
    background: #7f8c8d;
}

.btn-small {
    padding: 4px 12px;
    font-size: 13px;
}

/* 통계 행 */
.stats-row {
    display: flex;
    gap: 16px;
    margin-bottom: 20px;
}

.stat-card {
    flex: 1;
    background: #f8f9fa;
    padding: 16px;
    border-radius: 6px;
    border-left: 4px solid #3498db;
}

.stat-card h4 {
    font-size: 13px;
    color: #7f8c8d;
    margin-bottom: 8px;
    text-transform: uppercase;
    font-weight: 600;
}

.stat-card .value {
    font-size: 28px;
    color: #2c3e50;
    font-weight: 700;
}

/* 데이터 테이블 */
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.data-table thead {
    background: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
}

.data-table th {
    padding: 12px;
    text-align: left;
    font-weight: 600;
    color: #495057;
}

.data-table td {
    padding: 12px;
    border-bottom: 1px solid #ecf0f1;
}

.data-table tbody tr:hover {
    background: #f8f9fa;
}

/* 페이지네이션 */
.pagination {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-top: 16px;
}

.pagination button {
    padding: 6px 12px;
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.pagination button:hover:not(:disabled) {
    background: #f8f9fa;
}

.pagination button.active {
    background: #3498db;
    color: #fff;
    border-color: #3498db;
}

.pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 행 레이아웃 */
.row {
    display: flex;
    gap: 24px;
    margin-bottom: 24px;
}

.col {
    flex: 1;
}

/* 차트 컨테이너 */
.chart-container {
    position: relative;
    max-height: 400px;
}

.chart-container-wide {
    position: relative;
    width: 100%;
    max-height: 300px;
}

/* ETL 관리 */
.etl-controls {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 20px;
}

.watermark-container {
    margin-bottom: 20px;
}

.watermark-item {
    background: #f8f9fa;
    padding: 12px;
    margin-bottom: 8px;
    border-radius: 4px;
    border-left: 4px solid #3498db;
}

.watermark-item h4 {
    font-size: 14px;
    margin-bottom: 8px;
    color: #2c3e50;
}

.watermark-item p {
    font-size: 13px;
    color: #7f8c8d;
    margin: 4px 0;
}

.result-container {
    background: #f8f9fa;
    padding: 16px;
    border-radius: 6px;
    border-left: 4px solid #27ae60;
}

.result-container.error {
    border-left-color: #e74c3c;
}

.result-container h4 {
    font-size: 14px;
    margin-bottom: 12px;
    color: #2c3e50;
}

.result-container pre {
    font-size: 13px;
    color: #2c3e50;
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* 테스트 데이터 관리 */
.action-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.action-card {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 6px;
    border: 1px solid #dee2e6;
}

.action-card h3 {
    font-size: 15px;
    margin-bottom: 8px;
    color: #2c3e50;
}

.action-card p {
    font-size: 13px;
    color: #7f8c8d;
    margin-bottom: 12px;
}

.action-card label {
    display: block;
    margin-bottom: 12px;
    font-size: 13px;
}

.action-card input[type="number"] {
    width: 80px;
    margin-left: 8px;
}

.action-card button {
    width: 100%;
}

.log-container {
    background: #2c3e50;
    padding: 16px;
    border-radius: 6px;
}

.log-container h3 {
    color: #ecf0f1;
    margin-bottom: 12px;
}

.log-container pre {
    background: #34495e;
    color: #ecf0f1;
    padding: 12px;
    border-radius: 4px;
    font-size: 13px;
    max-height: 300px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* 모달 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.4);
}

.modal.active {
    display: block;
}

.modal-content {
    background-color: #fff;
    margin: 5% auto;
    padding: 24px;
    border-radius: 8px;
    width: 90%;
    max-width: 800px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover,
.close:focus {
    color: #000;
}

/* 로딩 스피너 */
.loading {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* 반응형 */
@media (max-width: 768px) {
    .row {
        flex-direction: column;
    }

    .stats-row {
        flex-direction: column;
    }

    .action-grid {
        grid-template-columns: 1fr;
    }

    .controls {
        flex-direction: column;
        align-items: stretch;
    }

    .controls input[type="text"] {
        width: 100%;
    }
}
