/* Farmbot 관리 시스템 CSS */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

/* 헤더 */
.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1rem 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.header .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header h1 {
    font-size: 1.8rem;
    font-weight: 600;
}

.header .nav a {
    color: white;
    text-decoration: none;
    margin-left: 20px;
    padding: 8px 16px;
    border-radius: 4px;
    transition: background-color 0.3s;
}

.header .nav a:hover {
    background-color: rgba(255,255,255,0.2);
}

/* 메인 컨테이너 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* 카드 스타일 */
.card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 20px;
    overflow: hidden;
}

.card-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px 20px;
    font-weight: 600;
    font-size: 1.1rem;
}

.card-body {
    padding: 20px;
}

/* 버튼 스타일 */
.btn {
    display: inline-block;
    padding: 10px 20px;
    background: #667eea;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
    margin-right: 10px;
    margin-bottom: 10px;
}

.btn:hover {
    background: #5a67d8;
    transform: translateY(-1px);
}

.btn-success {
    background: #48bb78;
}

.btn-success:hover {
    background: #38a169;
}

.btn-danger {
    background: #f56565;
}

.btn-danger:hover {
    background: #e53e3e;
}

.btn-warning {
    background: #ed8936;
}

.btn-warning:hover {
    background: #dd6b20;
}

.btn-secondary {
    background: #718096;
}

.btn-secondary:hover {
    background: #4a5568;
}

.btn-small {
    padding: 6px 12px;
    font-size: 12px;
}

/* 폼 스타일 */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #4a5568;
}

.form-control {
    width: 100%;
    padding: 10px;
    border: 1px solid #cbd5e0;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.form-control:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-row {
    display: flex;
    gap: 20px;
}

.form-row .form-group {
    flex: 1;
}

/* 테이블 스타일 */
.table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

.table th,
.table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
}

.table th {
    background-color: #f7fafc;
    font-weight: 600;
    color: #4a5568;
}

.table tr:hover {
    background-color: #f7fafc;
}

.table-responsive {
    overflow-x: auto;
}

/* 상태 배지 */
.badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-success {
    background: #c6f6d5;
    color: #22543d;
}

.badge-danger {
    background: #fed7d7;
    color: #742a2a;
}

.badge-warning {
    background: #feebc8;
    color: #744210;
}

.badge-info {
    background: #bee3f8;
    color: #2a4365;
}

/* 메시지 스타일 */
.alert {
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 4px;
    border: 1px solid;
}

.alert-success {
    background: #c6f6d5;
    color: #22543d;
    border-color: #9ae6b4;
}

.alert-danger {
    background: #fed7d7;
    color: #742a2a;
    border-color: #feb2b2;
}

.alert-warning {
    background: #feebc8;
    color: #744210;
    border-color: #f6e05e;
}

.alert-info {
    background: #bee3f8;
    color: #2a4365;
    border-color: #90cdf4;
}

/* 대시보드 그리드 */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    text-align: center;
}

.stat-card .stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: #667eea;
    margin-bottom: 5px;
}

.stat-card .stat-label {
    color: #718096;
    font-size: 14px;
}

/* 토글 스위치 */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 24px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: #667eea;
}

input:checked + .slider:before {
    transform: translateX(26px);
}

/* 로딩 스피너 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 로그인 페이지 */
.login-container {
    max-width: 400px;
    margin: 100px auto;
    padding: 40px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
    color: #4a5568;
}

/* 반응형 디자인 */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .header .container {
        flex-direction: column;
        gap: 10px;
    }
    
    .form-row {
        flex-direction: column;
        gap: 0;
    }
    
    .table-responsive {
        font-size: 12px;
    }
    
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

/* 유틸리티 클래스 */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }
.mb-0 { margin-bottom: 0; }
.mb-10 { margin-bottom: 10px; }
.mb-20 { margin-bottom: 20px; }
.mt-20 { margin-top: 20px; }
.p-20 { padding: 20px; }
.hidden { display: none; }
.float-right { float: right; } 