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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: #f5f5f5;
    min-height: 100vh;
}

.admin-login-wrapper {
    width: 100%;
    min-height: 100vh;
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.admin-login-container {
    width: 100%;
    max-width: 400px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    padding: 40px;
}

.admin-login-header {
    text-align: center;
    margin-bottom: 30px;
}

.admin-login-header h1 {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: 2px;
    margin-bottom: 8px;
}

.admin-login-header p {
    font-size: 12px;
    color: #666;
    letter-spacing: 0.5px;
}

.admin-login-form {
    display: flex;
    flex-direction: column;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 8px;
    color: #333;
}

.form-control {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: #000;
}

.form-error {
    min-height: 20px;
    font-size: 12px;
    color: #dc3545;
    margin-bottom: 15px;
    text-align: center;
}

.btn-login {
    width: 100%;
    padding: 14px;
    background: #000;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-login:hover {
    background: #333;
}

.btn-login:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.admin-login-footer {
    margin-top: 20px;
    text-align: center;
}

.back-link {
    font-size: 12px;
    color: #666;
    text-decoration: none;
    transition: color 0.2s;
}

.back-link:hover {
    color: #000;
}

/* Admin Dashboard Layout */
.admin-wrapper {
    display: flex;
    width: 100%;
    min-height: 100vh;
    background: #f5f5f5;
}

.admin-sidebar {
    width: 250px;
    background: #2c3e50;
    color: #fff;
    padding: 0;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    left: 0;
    top: 0;
}

.admin-brand {
    display: block;
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 2px;
    padding: 30px 20px;
    background: #1a252f;
    text-align: center;
    color: #fff;
    text-decoration: none;
    transition: all 0.2s;
    cursor: pointer;
}

.admin-brand:hover {
    background: #151f28;
    color: #3498db;
}

.admin-nav {
    list-style: none;
    padding: 20px 0;
}

.admin-nav-item {
    margin-bottom: 0;
}

.admin-nav-link {
    display: block;
    padding: 15px 25px;
    color: #ecf0f1;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s;
    border-left: 3px solid transparent;
    text-indent: 0;
    margin-left: 0;
}

.admin-nav-link:hover {
    background: #34495e;
    border-left-color: #3498db;
}

.admin-nav-link.active {
    background: #34495e;
    border-left-color: #3498db;
    color: #fff;
}

.admin-content {
    flex: 1;
    margin-left: 250px;
    width: calc(100% - 250px);
    min-height: 100vh;
}

.admin-header {
    background: #fff;
    padding: 25px 40px;
    border-bottom: 1px solid #e5e5e5;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

.admin-title {
    font-size: 24px;
    font-weight: 600;
    color: #2c3e50;
}

.admin-user {
    display: flex;
    align-items: center;
    gap: 20px;
}

.admin-user-name {
    font-size: 14px;
    color: #555;
    font-weight: 500;
}

.btn-logout {
    padding: 10px 20px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
    color: #555;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-logout:hover {
    background: #f8f9fa;
    border-color: #adb5bd;
    color: #000;
}

.btn-save-history-header {
    padding: 10px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 4px;
    font-size: 13px;
    color: #fff;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.btn-save-history-header:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-save-history-header:disabled {
    background: #ccc;
    cursor: not-allowed;
    box-shadow: none;
}

.btn-history {
    padding: 10px 20px;
    background: #6c757d;
    border: none;
    border-radius: 4px;
    font-size: 13px;
    color: #fff;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
}

.btn-history:hover {
    background: #5a6268;
    transform: translateY(-1px);
}

.admin-card {
    background: #fff;
    border-radius: 8px;
    padding: 30px;
    margin: 30px 40px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.08);
}

.admin-card-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
    color: #2c3e50;
}

.admin-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
}

.admin-stat-card {
    padding: 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 8px;
    color: #fff;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.admin-stat-card:nth-child(2) {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.admin-stat-card:nth-child(3) {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.stat-number {
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 8px;
}

.stat-label {
    font-size: 14px;
    opacity: 0.9;
    font-weight: 500;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
}

.admin-table th,
.admin-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #e5e5e5;
    font-size: 13px;
}

.admin-table th {
    background: #f9f9f9;
    font-weight: 600;
}

.admin-table tr:hover {
    background: #fafafa;
}

.btn-admin {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-admin-primary {
    background: #000;
    color: #fff;
}

.btn-admin-primary:hover {
    background: #333;
}

.btn-admin-secondary {
    background: #fff;
    color: #000;
    border: 1px solid #ddd;
}

.btn-admin-secondary:hover {
    background: #f5f5f5;
}

.btn-admin-danger {
    background: #dc3545;
    color: #fff;
}

.btn-admin-danger:hover {
    background: #c82333;
}

@media (max-width: 768px) {
    .admin-sidebar {
        width: 200px;
    }
    
    .admin-brand {
        font-size: 16px;
        padding: 20px 15px;
    }
    
    .admin-nav-link {
        font-size: 13px;
        padding: 12px 20px;
    }
    
    .admin-content {
        margin-left: 200px;
        width: calc(100% - 200px);
    }
    
    .admin-header {
        padding: 15px 20px;
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .admin-title {
        font-size: 18px;
    }
    
    .admin-user {
        gap: 10px;
        font-size: 12px;
    }
    
    .admin-user-name {
        display: none;
    }
    
    .btn-save-history-header,
    .btn-history,
    .btn-logout {
        padding: 8px 12px;
        font-size: 12px;
    }
    
    .admin-card {
        margin: 20px 25px;
        padding: 20px;
    }
}

@media (max-width: 576px) {
    .admin-login-container {
        padding: 30px 20px;
    }
    
    /* 모바일에서 사이드바 숨기기 */
    .admin-sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s;
        width: 250px;
        z-index: 1000;
    }
    
    .admin-sidebar.mobile-open {
        transform: translateX(0);
    }
    
    /* 햄버거 메뉴 버튼 */
    .mobile-menu-btn {
        display: block;
        position: fixed;
        top: 15px;
        left: 15px;
        z-index: 1001;
        background: #2c3e50;
        border: none;
        width: 40px;
        height: 40px;
        border-radius: 6px;
        cursor: pointer;
        padding: 0;
        transition: all 0.3s;
    }
    
    .mobile-menu-btn span {
        display: block;
        width: 20px;
        height: 2px;
        background: white;
        margin: 4px auto;
        transition: all 0.3s;
    }
    
    /* X 아이콘 변환 */
    .mobile-menu-btn.active span:nth-child(1) {
        transform: translateY(6px) rotate(45deg);
    }
    
    .mobile-menu-btn.active span:nth-child(2) {
        opacity: 0;
    }
    
    .mobile-menu-btn.active span:nth-child(3) {
        transform: translateY(-6px) rotate(-45deg);
    }
    
    /* 모바일 오버레이 */
    .mobile-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 999;
    }
    
    .mobile-overlay.active {
        display: block;
    }
    
    .admin-content {
        margin-left: 0;
        width: 100%;
    }
    
    .admin-header {
        padding: 15px 20px;
        padding-top: 65px;
    }
    
    .admin-title {
        font-size: 16px;
        width: 100%;
    }
    
    .admin-user {
        width: 100%;
        justify-content: flex-end;
        gap: 8px;
    }
    
    .admin-user-name {
        display: none;
    }
    
    .btn-save-history-header {
        font-size: 11px;
        padding: 6px 10px;
    }
    
    .btn-logout,
    .btn-history {
        font-size: 11px;
        padding: 6px 10px;
    }
    
    .admin-card {
        margin: 15px 20px;
        padding: 20px;
    }
    
    .admin-stats-grid {
        grid-template-columns: 1fr;
    }
}
