@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+KR:wght@300;400;500;600;700&family=Poppins:wght@300;400;500;600;700&display=swap');

:root {
    --primary-color: #1571e9;
    --primary-dark: #0d47a1;
    --primary-light: #4a90e2;
    --secondary-color: #00c853;
    --danger-color: #f44336;
    --warning-color: #ff9800;
    --dark-color: #1a1a1a;
    --gray-dark: #424242;
    --gray-medium: #757575;
    --gray-light: #e0e0e0;
    --gray-lighter: #f5f5f5;
    --white: #ffffff;
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
    --border-radius: 8px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --header-height: 68px;
    --sidebar-width: 260px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 15px;
    line-height: 1.6;
    color: var(--dark-color);
    background-color: var(--gray-lighter);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body.app-shell {
    min-height: 100vh;
    padding-top: var(--header-height);
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.container-fluid {
    width: 100%;
    padding: 0 20px;
}

/* 헤더 스타일 */
.header {
    /*background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary-dark) 100%);*/
    background: var(--white);
    color: var(--primary);
    padding: 0;
    box-shadow: var(--shadow-md);
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--header-height);
    z-index: 1000;
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
    padding: 16px 20px;
}

.logo {
    font-size: 24px;
    font-weight: 700;
    font-family: 'Poppins', sans-serif;
    color: var(--primary-color);
    text-decoration: none;
    letter-spacing: -0.5px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.logo-icon {
    width: 32px;
    height: 32px;
    color: var(--primary-color);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
}

.header-nav {
    display: flex;
    align-items: center;
    gap: 30px;
}

.header-nav a {
    color: var(--white);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
    opacity: 0.9;
}

.header-nav a:hover {
    opacity: 1;
    transform: translateY(-1px);
}

.header-user {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--white);
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: var(--white);
    font-size: 24px;
    cursor: pointer;
    padding: 5px;
}

/* 사이드바 스타일 */
.layout-with-sidebar {
    min-height: calc(100vh - var(--header-height));
}

.sidebar {
    width: var(--sidebar-width);
    background: var(--white);
    box-shadow: var(--shadow-sm);
    padding: 20px 0;
    position: fixed;
    top: var(--header-height);
    bottom: 0;
    left: 0;
    height: auto;
    overflow-y: auto;
    z-index: 900;
}

.sidebar-menu {
    list-style: none;
}

.sidebar-menu li {
    margin: 0;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 24px;
    color: var(--gray-dark);
    text-decoration: none;
    transition: var(--transition);
    font-weight: 500;
}

.sidebar-menu a:hover {
    background: var(--gray-lighter);
    color: var(--primary-color);
}

.sidebar-menu a.active {
    background: linear-gradient(90deg, transparent 0%, rgba(26, 115, 232, 0.08) 100%);
    color: var(--primary-color);
    border-right: 3px solid var(--primary-color);
}

.sidebar-menu i {
    width: 20px;
    text-align: center;
    font-size: 18px;
}

.main-content {
    min-width: 0;
    min-height: calc(100vh - var(--header-height));
    margin-left: var(--sidebar-width);
}

/* 카드 스타일 */
.card {
    background: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    padding: 24px;
    margin-bottom: 24px;
    transition: var(--transition);
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--gray-lighter);
}

.card-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--dark-color);
}

.card-body {
    padding: 0;
}

/* 버튼 스타일 */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 24px;
    font-size: 15px;
    font-weight: 500;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    font-family: inherit;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background: var(--primary-color);
    color: var(--white);
}

.btn-primary:hover:not(:disabled) {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: var(--gray-medium);
    color: var(--white);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--gray-dark);
}

.btn-success {
    background: var(--secondary-color);
    color: var(--white);
}

.btn-success:hover:not(:disabled) {
    background: #00a844;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-danger {
    background: var(--danger-color);
    color: var(--white);
}

.btn-danger:hover:not(:disabled) {
    background: #d32f2f;
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
}

.btn-outline:hover:not(:disabled) {
    background: var(--primary-color);
    color: var(--white);
}

.btn-sm {
    padding: 6px 16px;
    font-size: 14px;
}

.btn-lg {
    padding: 14px 32px;
    font-size: 16px;
}

.btn-block {
    width: 100%;
}

/* 폼 스타일 */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--gray-dark);
    font-size: 14px;
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    font-size: 15px;
    border: 1px solid var(--gray-light);
    border-radius: var(--border-radius);
    transition: var(--transition);
    font-family: inherit;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.1);
}

.form-control::placeholder {
    color: var(--gray-medium);
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23757575' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 40px;
}

.form-row {
    display: flex;
    gap: 16px;
}

.form-row .form-group {
    flex: 1;
}

/* 테이블 스타일 */
.table-responsive {
    overflow-x: auto;
    margin: 0 -24px;
    padding: 0 24px;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th {
    background: var(--gray-lighter);
    padding: 14px 16px;
    text-align: left;
    font-weight: 600;
    color: var(--gray-dark);
    font-size: 14px;
    border-bottom: 2px solid var(--gray-light);
}

.table td {
    padding: 14px 10px;
    border-bottom: 1px solid var(--gray-light);
    color: var(--dark-color);
}

.table tbody tr:hover {
    background: var(--gray-lighter);
}

.table tbody tr:last-child td {
    border-bottom: none;
}

/* 배지 스타일 */
.badge {
    display: inline-block;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 5px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-success {
    background: #e8f5e9;
    color: #2e7d32;
}

.badge-danger {
    background: #ffebee;
    color: #c62828;
}

.badge-warning {
    background: #fff3e0;
    color: #e65100;
}

.badge-info {
    background: #e3f2fd;
    color: #1565c0;
}

/* 알림 스타일 */
.alert {
    padding: 10px 10px;
    border-radius: var(--border-radius);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.alert-success {
    background: #e8f5e9;
    color: #2e7d32;
    border-left: 4px solid #2e7d32;
}

.alert-danger {
    background: #ffebee;
    color: #c62828;
    border-left: 4px solid #c62828;
}

.alert-warning {
    background: #fff3e0;
    color: #e65100;
    border-left: 4px solid #e65100;
}

.alert-info {
    background: #e3f2fd;
    color: #1565c0;
    border-left: 4px solid #1565c0;
}

/* 통계 카드 */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: var(--white);
    padding: 24px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.stat-card.send {
    background: linear-gradient(135deg, #48acfd 0%, #4dabf8 100%);
}

.stat-card.success {
    background: linear-gradient(135deg, #41b973 0%, #44bd76 100%);
}

.stat-card.warning {
    background: linear-gradient(135deg, #e99a23 0%, #ec9e27 100%);
}

.stat-card.danger {
    background: linear-gradient(135deg, #f44336 0%, #d32f2f 100%);
}

.stat-card.pay {
    background: linear-gradient(135deg, #3593a3 0%, #3796a7 100%);
}

.stat-label {
    font-size: 14px;
    opacity: 0.9;
    margin-bottom: 8px;
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    font-family: 'Poppins', sans-serif;
}

.stat-change {
    font-size: 13px;
    margin-top: 8px;
    opacity: 0.85;
}

/* 페이지네이션 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 30px;
}

.pagination a,
.pagination span {
    padding: 8px 14px;
    border: 1px solid var(--gray-light);
    border-radius: 6px;
    color: var(--gray-dark);
    text-decoration: none;
    transition: var(--transition);
}

.pagination a:hover {
    background: var(--primary-color);
    color: var(--white);
    border-color: var(--primary-color);
}

.pagination .active {
    background: var(--primary-color);
    color: var(--white);
    border-color: var(--primary-color);
}

/* 푸터 */
.footer {
    background: var(--white);
    padding: 40px 0;
    width: calc(100% - var(--sidebar-width));
    margin: 0 0 0 var(--sidebar-width);
    border-top: 1px solid var(--gray-light);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.footer-links {
    display: flex;
    gap: 24px;
}

.footer-links a {
    color: var(--gray-medium);
    text-decoration: none;
    font-size: 14px;
    transition: var(--transition);
}

.footer-links a:hover {
    color: var(--primary-color);
}

.footer-copyright {
    color: var(--gray-medium);
    font-size: 14px;
}

/* 모달 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--white);
    border-radius: var(--border-radius);
    padding: 30px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--gray-lighter);
}

.modal-title {
    font-size: 20px;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--gray-medium);
    transition: var(--transition);
}

.modal-close:hover {
    color: var(--dark-color);
}

/* 유틸리티 클래스 */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.d-flex { display: flex; }
.justify-between { justify-content: space-between; }
.align-center { align-items: center; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.gap-3 { gap: 24px; }

/* 반응형 디자인 */
@media (max-width: 1024px) {
    :root {
        --sidebar-width: 220px;
    }
}

@media (max-width: 768px) {
    .header-nav {
        display: none;
    }
    
    .mobile-menu-btn {
        display: block;
    }
    
    .layout-with-sidebar {
        display: flex;
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        height: auto;
        position: static;
        display: none;
    }
    
    .sidebar.active {
        display: block;
    }
    
    .main-content {
        width: 100%;
        margin-left: 0;
        padding: 20px 15px;
    }

    .footer {
        width: 100%;
        margin-left: 0;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .form-row {
        flex-direction: column;
        gap: 0;
    }
    
    .table-responsive {
        margin: 0 -15px;
        padding: 0 15px;
    }
    
    .footer-content {
        flex-direction: column;
        text-align: center;
    }
    
    .footer-links {
        flex-direction: column;
        gap: 12px;
    }
}

@media (max-width: 480px) {
    .logo {
        font-size: 20px;
    }
    
    .card {
        padding: 16px;
    }
    
    .card-title {
        font-size: 18px;
    }
    
    .stat-value {
        font-size: 24px;
    }
    
    .btn {
        padding: 10px 20px;
        font-size: 14px;
    }
}
