/* SehatLog Dashboard Styles */
#sehatlog-dashboard {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Login Section */
.sehatlog-login-section {
    max-width: 400px;
    margin: 50px auto;
    padding: 30px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.sehatlog-login-section h2 {
    margin-bottom: 20px;
    color: #333;
}

/* Profile Warning */
.sehatlog-warning {
    background: linear-gradient(135deg, #ff9a56, #ff6b6b);
    color: white;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.warning-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
}

.warning-content p {
    margin: 5px 0;
}

/* Header */
.sehatlog-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding: 20px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border-radius: 10px;
}

.header-left h1 {
    margin: 0;
    font-size: 2.2em;
}

.header-left p {
    margin: 5px 0 0 0;
    opacity: 0.9;
}

.header-right {
    display: flex;
    gap: 10px;
}

/* Buttons */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

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

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-light {
    background: #f8f9fa;
    color: #495057;
    border: 1px solid #dee2e6;
}

.btn-light:hover {
    background: #e2e6ea;
}

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

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

/* KPI Cards */
.kpi-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.kpi-card {
    padding: 20px;
    border-radius: 10px;
    color: white;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: transform 0.3s ease;
}

.kpi-card:hover {
    transform: translateY(-3px);
}

.weight-card {
    background: linear-gradient(135deg, #4facfe, #00f2fe);
}

.bmi-card {
    background: linear-gradient(135deg, #43e97b, #38f9d7);
}

.bodyfat-card {
    background: linear-gradient(135deg, #fa709a, #fee140);
}

.bp-card {
    background: linear-gradient(135deg, #a8edea, #fed6e3);
}

.sleep-card {
    background: linear-gradient(135deg, #9890e3, #b1f4cf);
}

.kpi-icon {
    font-size: 2.5em;
    opacity: 0.8;
}

.kpi-content h3 {
    margin: 0 0 5px 0;
    font-size: 1em;
    opacity: 0.9;
}

.kpi-value {
    font-size: 1.8em;
    font-weight: bold;
    margin: 0;
}

.kpi-change {
    font-size: 0.85em;
    opacity: 0.8;
}

/* Tab Navigation */
.tab-navigation {
    display: flex;
    gap: 5px;
    margin-bottom: 20px;
    border-bottom: 2px solid #e9ecef;
}

.tab-btn {
    padding: 12px 20px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    color: #6c757d;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
}

.tab-btn.active {
    color: #667eea;
    border-bottom-color: #667eea;
    background: #f8f9fa;
}

.tab-btn:hover {
    color: #495057;
    background: #f8f9fa;
}

/* Tab Content */
.tab-content {
    display: none;
}

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

/* Section Headers */
.section-header {
    margin-bottom: 20px;
}

.section-header h2 {
    color: #333;
    margin: 0;
    padding-bottom: 10px;
    border-bottom: 2px solid #e9ecef;
}

/* Content Grid */
.content-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

/* Forms */
.form-section {
    background: white;
    padding: 25px;
    border-radius: 10px;
    border: 1px solid #e9ecef;
}

.form-section h3 {
    margin-top: 0;
    color: #333;
}

.entry-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.form-group label {
    font-weight: 500;
    color: #333;
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 10px;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
}

.bp-inputs {
    display: flex;
    align-items: center;
    gap: 8px;
}

.bp-inputs span {
    font-weight: bold;
    color: #6c757d;
}

.calculation-preview {
    font-size: 12px;
    color: #28a745;
    font-weight: 500;
    margin-top: 5px;
    min-height: 16px;
}

/* Charts */
.chart-section {
    background: white;
    padding: 25px;
    border-radius: 10px;
    border: 1px solid #e9ecef;
}

.chart-section h3 {
    margin-top: 0;
    color: #333;
}

#weight-chart,
#sleep-chart {
    max-height: 250px;
}

/* Tables */
.table-section {
    background: white;
    border-radius: 10px;
    border: 1px solid #e9ecef;
    overflow: hidden;
}

.table-header {
    padding: 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.table-header h3 {
    margin: 0;
    color: #333;
}

.date-filters {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.date-filters input {
    padding: 8px;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    font-size: 14px;
}

.table-container {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.data-table th {
    background: #f8f9fa;
    padding: 12px 8px;
    text-align: left;
    font-weight: 600;
    color: #495057;
    border-bottom: 2px solid #dee2e6;
}

.data-table td {
    padding: 12px 8px;
    border-bottom: 1px solid #dee2e6;
    vertical-align: top;
}

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

.action-buttons {
    display: flex;
    gap: 5px;
}

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

/* BMI Categories */
.bmi-underweight { color: #007bff; }
.bmi-normal { color: #28a745; }
.bmi-overweight { color: #ffc107; }
.bmi-obese { color: #dc3545; }

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

.modal-content {
    background-color: #fff;
    margin: 5% auto;
    padding: 0;
    border-radius: 10px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.modal-header {
    padding: 20px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border-radius: 10px 10px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    margin: 0;
}

.close {
    color: white;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
}

.close:hover {
    opacity: 0.7;
}

.modal-body {
    padding: 25px;
}

.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
}

/* Loading States */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.btn.loading::after {
    content: '...';
    animation: dots 1.5s infinite;
}

@keyframes dots {
    0%, 20% { content: '.'; }
    40% { content: '..'; }
    60%, 100% { content: '...'; }
}

/* Responsive Design */
@media (max-width: 768px) {
    #sehatlog-dashboard {
        padding: 10px;
    }
    
    .sehatlog-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .header-right {
        justify-content: center;
    }
    
    .kpi-section {
        grid-template-columns: 1fr;
    }
    
    .content-grid {
        grid-template-columns: 1fr;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .table-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .date-filters {
        justify-content: center;
    }
    
    .tab-navigation {
        flex-wrap: wrap;
    }
    
    .tab-btn {
        flex: 1;
        min-width: 120px;
    }
}

@media (max-width: 480px) {
    .kpi-card {
        flex-direction: column;
        text-align: center;
    }
    
    .kpi-icon {
        font-size: 2em;
    }
    
    .modal-content {
        margin: 10% auto;
        width: 95%;
    }
    
    .date-filters {
        flex-direction: column;
    }
    
    .date-filters input,
    .date-filters button {
        width: 100%;
    }
}

/* Utilities */
.text-center { text-align: center; }
.text-success { color: #28a745; }
.text-danger { color: #dc3545; }
.text-warning { color: #ffc107; }
.text-info { color: #17a2b8; }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 1rem; }

.d-none { display: none; }
.d-block { display: block; }
.d-flex { display: flex; }

/* Test Name Select Enhancements */
#test-name-select {
    max-height: 200px;
}

#test-name-custom {
    margin-top: 10px;
}