:root {
    --primary-color: #4CAF50;
    --secondary-color: #8BC34A;
    --accent-color: #CDDC39;
    --dark-green: #388E3C;
    --light-green: #C8E6C9;
    --warning-color: #FFC107;
    --danger-color: #F44336;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
}

body {
    background-color: #f5f5f5;
}

.dashboard-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 250px;
    background-color: var(--dark-green);
    color: white;
    padding: 20px 0;
}

.logo {
    display: flex;
    align-items: center;
    padding: 0 20px 20px;
    font-size: 1.5rem;
    font-weight: 600;
}

.logo i {
    margin-right: 10px;
    font-size: 1.8rem;
}

.sidebar nav ul {
    list-style: none;
}

.sidebar nav ul li {
    padding: 12px 20px;
    transition: all 0.3s;
}

.sidebar nav ul li:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.sidebar nav ul li.active {
    background-color: var(--primary-color);
}

.sidebar nav ul li a {
    color: white;
    text-decoration: none;
    display: flex;
    align-items: center;
}

.sidebar nav ul li a i {
    margin-right: 10px;
    width: 20px;
    text-align: center;
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 20px;
}

header h1 {
    color: var(--dark-green);
    margin-bottom: 20px;
}

/* Status Cards */
.status-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.status-card {
    background-color: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
}

.card-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    margin-right: 20px;
}

.card-info h3 {
    color: #555;
    font-size: 1rem;
    margin-bottom: 5px;
}

.card-info .value {
    font-size: 1.8rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
}

.status-badge {
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

.status-badge.normal {
    background-color: var(--light-green);
    color: var(--dark-green);
}

.status-badge.bahaya {
    background-color: #FFEBEE;
    color: var(--danger-color);
}

/* Notification */
.notification {
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 30px;
    display: flex;
    align-items: center;
}

.notification.warning {
    background-color: #FFF8E1;
    color: #FFA000;
}

.notification i {
    margin-right: 10px;
    font-size: 1.2rem;
}

/* Export Section */
.export-section {
    background-color: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.export-section h2 {
    color: var(--dark-green);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
}

.export-section h2 i {
    margin-right: 10px;
}

.export-controls {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

.date-range label {
    display: block;
    margin-bottom: 5px;
    color: #555;
}

.date-inputs {
    display: flex;
    align-items: center;
}

.date-inputs input {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.date-inputs span {
    margin: 0 10px;
    color: #555;
}

.export-btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    transition: background-color 0.3s;
}

.export-btn:hover {
    background-color: var(--dark-green);
}

.export-btn i {
    margin-right: 8px;
}

/* Tabel Data Sensor */
.sensor-table {
    background-color: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
}

.sensor-table table {
    width: 100%;
    border-collapse: collapse;
}

.sensor-table th, 
.sensor-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
}

.sensor-table th {
    background-color: var(--light-green);
    color: var(--dark-green);
    font-weight: 500;
}

.sensor-table tr:hover {
    background-color: #f5f5f5;
}

/* Grafik */
.chart-container {
    background-color: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.chart-container h2 {
    color: var(--dark-green);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
}

.chart-container h2 i {
    margin-right: 10px;
}

#monitoringChart {
    width: 100%;
    height: 400px;
}

/* Filter Bulan */
.month-filter {
    background-color: white;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.month-filter label {
    margin-right: 10px;
    font-weight: 500;
    color: var(--dark-green);
}

.month-filter input[type="month"] {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-right: 10px;
}

.filter-btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
}

.filter-btn:hover {
    background-color: var(--dark-green);
}

/* Tabel Riwayat */
.history-table {
    background-color: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    margin-bottom: 20px;
    overflow-x: auto;
}

.history-table table {
    width: 100%;
    border-collapse: collapse;
}

.history-table th {
    background-color: var(--light-green);
    color: var(--dark-green);
    padding: 12px 15px;
    text-align: left;
}

.history-table td {
    padding: 10px 15px;
    border-bottom: 1px solid #eee;
}

.history-table tr:hover {
    background-color: #f9f9f9;
}

.no-data {
    text-align: center;
    color: #777;
    padding: 20px 0;
}

/* Ekspor Data */
.export-section {
    text-align: right;
}

.export-btn {
    background-color: #2E7D32;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
}

.export-btn i {
    margin-right: 8px;
}

/* Alarm Settings */
.setting-card {
    background-color: white;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.setting-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.threshold-setting {
    margin-bottom: 15px;
}

.threshold-setting label {
    display: block;
    margin-bottom: 5px;
    color: #555;
}

.input-group {
    display: flex;
    align-items: center;
}

.input-group input {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    width: 100px;
}

.input-group .unit {
    margin-left: 10px;
    color: #777;
}

.notification-channel {
    margin-bottom: 15px;
}

.notification-channel label {
    display: flex;
    align-items: center;
    margin-bottom: 5px;
    color: #555;
}

.notification-channel label i {
    margin-right: 8px;
    width: 20px;
    text-align: center;
}

.notification-channel input {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    width: 100%;
    max-width: 300px;
}

.save-btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
}

.save-btn:hover {
    background-color: var(--dark-green);
}

.save-btn i {
    margin-right: 8px;
}

/* Toggle Switch */
.switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
}

.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: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: var(--primary-color);
}

input:checked + .slider:before {
    transform: translateX(26px);
}

/* Pengaturan Tab */
.settings-tabs {
    display: flex;
    margin-bottom: 20px;
    border-bottom: 1px solid #ddd;
}

.tab-btn {
    padding: 10px 20px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
    color: #555;
    border-bottom: 3px solid transparent;
    display: flex;
    align-items: center;
}

.tab-btn i {
    margin-right: 8px;
}

.tab-btn.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
    font-weight: 500;
}

.tab-content {
    display: none;
}

/* Form Groups */
.calibration-group, .form-group {
    margin-bottom: 15px;
}

.calibration-group label, .form-group label {
    display: block;
    margin-bottom: 5px;
    color: #555;
}

.calibration-group input, .form-group input {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    width: 200px;
}

/* Database Status */
.db-status {
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 0.9rem;
}

.db-status.terhubung {
    background-color: #E8F5E9;
    color: #2E7D32;
}

.db-status.gagal {
    background-color: #FFEBEE;
    color: #C62828;
}

/* Bantuan Section */
.help-section {
    background-color: white;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 30px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.help-section h2 {
    color: var(--dark-green);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

.help-section h2 i {
    margin-right: 10px;
}

/* Panduan Langkah */
.guide-steps {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.step {
    display: flex;
    gap: 15px;
}

.step-number {
    background-color: var(--primary-color);
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    flex-shrink: 0;
    margin-top: 3px;
}

.step-content h3 {
    color: var(--dark-green);
    margin-bottom: 5px;
}

.step-content p {
    color: #555;
    margin-bottom: 10px;
}

.step-content ul {
    margin-left: 20px;
    color: #555;
}

.step-image img {
    max-width: 300px;
    border-radius: 5px;
    margin-top: 10px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* FAQ */
.faq-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.faq-item {
    border: 1px solid #eee;
    border-radius: 5px;
    overflow: hidden;
}

.faq-question {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background-color: #f9f9f9;
    cursor: pointer;
}

.faq-question h3 {
    color: #333;
    font-size: 1rem;
}

.toggle-btn {
    background: none;
    border: none;
    color: var(--dark-green);
    font-size: 1rem;
    cursor: pointer;
}

.faq-answer {
    padding: 0 15px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

.faq-answer.show {
    padding: 15px;
    max-height: 500px;
}

.faq-answer p, .faq-answer ol, .faq-answer ul {
    margin-bottom: 10px;
    color: #555;
}

/* Kontak */
.contact-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.contact-method {
    display: flex;
    gap: 15px;
    align-items: flex-start;
    padding: 15px;
    border-radius: 5px;
    background-color: #f9f9f9;
}

.contact-method i {
    font-size: 1.5rem;
    color: var(--primary-color);
    margin-top: 3px;
}

.contact-method h3 {
    color: var(--dark-green);
    margin-bottom: 5px;
    font-size: 1rem;
}

.contact-method p {
    color: #333;
    font-weight: 500;
}

.contact-method small {
    color: #777;
    font-size: 0.8rem;
}

/* Struktur Utama */
.dashboard-container {
    display: flex;
    min-height: 100vh;
    overflow: hidden; /* Tambahkan ini */
}

/* Sidebar */
.sidebar {
    width: 250px;
    background-color: var(--dark-green);
    color: white;
    position: sticky; /* atau 'fixed' */
    top: 0;
    height: 100vh; /* 100% tinggi viewport */
    overflow-y: auto; /* Biarkan sidebar discroll sendiri jika konten panjang */
}

/* Konten Utama */
.main-content {
    flex: 1;
    padding: 20px;
    overflow-y: auto; /* Biarkan konten utama discroll */
    height: 100vh;
}

/* Profil Container */
.profile-container {
    display: flex;
    gap: 30px;
    margin-top: 20px;
}

.profile-text {
    flex: 2;
    background-color: white;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.profile-images {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.image-card {
    background-color: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.image-card img {
    width: 100%;
    height: auto;
    border-bottom: 1px solid #eee;
}

.image-card p {
    padding: 12px;
    text-align: center;
    color: #555;
    font-size: 0.9rem;
}

/* Responsif */
@media (max-width: 768px) {
    .profile-container {
        flex-direction: column;
    }
}