/* ==========================================================================
   1. RESET & STANDARISASI
   ========================================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: #f8fafc;
    color: #334155;
    min-height: 100vh; /* DIUBAH: Menggunakan min-height agar tinggi fleksibel */
    
    /* DIUBAH: Izinkan scrollbar otomatis muncul HANYA jika konten 
       benar-benar melebihi tinggi layar browser (misal saat error login muncul) */
    overflow-y: auto; 
}

/* ==========================================================================
   2. DESAIN LANDING PAGE & LOGIN (index.php) - KONTROL LAYOUT TENGAH
   ========================================================================== */
.landing-container {
    min-height: 100vh;
    width: 100%;
    display: flex;
    justify-content: center; 
    align-items: center;     
    position: relative;
    background: url('../images/bg-pdam.jpg') no-repeat center center;
    background-size: cover;
    
    /* TAMBAHAN: Memberikan ruang aman (padding) atas dan bawah 
       supaya form tidak menempel ke ujung layar saat resolusi perangkat kecil */
    padding: 40px 20px; 
}

.landing-container::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(15, 23, 42, 0.75); 
    z-index: 1;
}

/* Tampilan Informasi Selamat Datang */
.landing-hero {
    position: relative;
    z-index: 2;
    text-align: center;
    color: #ffffff;
    max-width: 700px;
    width: 100%;
    animation: fadeIn 0.4s ease-in-out;
}

.main-logo {
    width: 120px;
    height: auto;
    margin-bottom: 25px;
    filter: drop-shadow(0px 4px 10px rgba(0,0,0,0.3));
}

.landing-hero h1 {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.landing-hero h2 {
    font-size: 20px;
    font-weight: 500;
    margin-bottom: 20px;
    color: #38bdf8; /* Aksen biru air */
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.landing-hero p {
    font-size: 16px;
    line-height: 1.6;
    color: #e2e8f0;
    margin-bottom: 40px;
    text-shadow: 0 1px 3px rgba(0,0,0,0.5);
}

.btn-explore {
    padding: 14px 35px;
    background-color: #0284c7;
    color: white;
    border: none;
    border-radius: 30px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(2, 132, 199, 0.4);
    transition: all 0.3s ease;
}

.btn-explore:hover {
    background-color: #0369a1;
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(2, 132, 199, 0.6);
}

/* Box Notifikasi Error */
.error-box {
    background-color: #fee2e2; 
    color: #991b1b; 
    padding: 12px; 
    border-radius: 8px; 
    font-size: 13px; 
    margin-bottom: 20px; 
    text-align: left; 
    border: 1px solid #fca5a5;
}

/* Kotak Form Login Modern */
.login-card {
    position: relative;
    z-index: 2;
    background: #ffffff;
    padding: 35px 25px; /* Sedikit memperkecil padding dalam agar hemat ruang */
    width: 100%;
    
    /* DIUBAH: Mengecilkan lebar maksimal kotak login dari 420px ke 380px 
       agar terlihat lebih minimalis, elegan, dan pas */
    max-width: 380px; 
    
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
    text-align: center;
    animation: fadeIn 0.4s ease-in-out;
    
    /* TAMBAHAN: Memastikan tinggi kotak otomatis menyesuaikan konten di dalamnya */
    height: auto; 
}

.login-logo {
    width: 90px;
    height: auto;
    margin-bottom: 15px;
}

.login-card h2 {
    color: #0f172a;
    font-size: 22px;
    margin-bottom: 5px;
    font-weight: 700;
}

.login-card p {
    color: #64748b;
    font-size: 14px;
    margin-bottom: 30px;
}

/* Komponen Elemen Form */
.form-group {
    margin-bottom: 20px;
    text-align: left;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #475569;
    margin-bottom: 6px;
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    border: 1.5px solid #cbd5e1;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s;
    background-color: #fff;
}

.form-input:focus {
    outline: none;
    border-color: #0284c7;
    box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15);
}

select.form-input {
    height: 45px;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="%23475569" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="6 9 12 15 18 9"></polyline></svg>');
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    padding-right: 40px;
}

.btn-login {
    width: 100%;
    padding: 12px;
    background-color: #0284c7;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
    margin-top: 10px;
}

.btn-login:hover {
    background-color: #0369a1;
}

.btn-back {
    position: absolute;
    top: 15px;
    left: 15px;
    background: none;
    border: none;
    color: #64748b;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: color 0.3s;
}

.btn-back:hover {
    color: #0284c7;
}

/* ==========================================================================
   3. DESAIN LAYOUT FRAMEWORK UTAMA DASHBOARD
   ========================================================================== */
.wrapper {
    display: grid;
    grid-template-columns: 260px 1fr;
    grid-template-rows: 65px 1fr 40px;
    grid-template-areas: 
        "sidebar topbar"
        "sidebar content"
        "sidebar footer";
    height: 100vh;
}

.sidebar {
    grid-area: sidebar;
    background-color: #0f172a;
    color: #fff;
    padding: 20px 0;
    display: flex;
    flex-direction: column;
    overflow-y: auto; /* Aktifkan scroll internal jika menu terlalu panjang */
}

.sidebar-brand {
    padding: 0 20px 20px 20px;
    border-bottom: 1px solid #1e293b;
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-logo {
    width: 35px;
    height: auto;
}

.sidebar-brand h3 {
    font-size: 16px;
    font-weight: 700;
    color: #f8fafc;
}

.sidebar-menu {
    list-style: none;
    margin-top: 25px;
}

.sidebar-menu .menu-header {
    padding: 12px 20px 6px 20px;
    font-size: 11px;
    text-transform: uppercase;
    color: #475569;
    font-weight: 700;
}

.sidebar-menu li a {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: #94a3b8;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
}

.sidebar-menu li a:hover {
    background-color: #1e293b;
    color: #0284c7;
}

.sidebar-menu li a i {
    margin-right: 12px;
    width: 20px;
    text-align: center;
}

.sidebar-menu .logout-link a:hover {
    background-color: #991b1b;
    color: #fff;
}

.topbar {
    grid-area: topbar;
    background-color: #fff;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 30px;
}

.content-body {
    grid-area: content;
    padding: 30px;
    overflow-y: auto;
}

.main-footer {
    grid-area: footer;
    background-color: #fff;
    border-top: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: #64748b;
}

/* ==========================================================================
   4. DESAIN HALAMAN DASHBOARD UTAMA (dashboard.php)
   ========================================================================== */
.dashboard-wrapper {
    width: 100%;
    animation: fadeIn 0.5s ease-in-out;
}

.page-title {
    font-size: 24px;
    color: #0f172a;
    font-weight: 700;
    margin-bottom: 20px;
}

/* Grid Kartu Statistik */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

/* Komponen Kartu Informasi */
.card-info {
    background-color: #ffffff;
    border-radius: 12px;
    padding: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    border-left: 5px solid #cbd5e1;
    transition: transform 0.2s, box-shadow 0.2s;
}

.card-info:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.card-info-text h4 {
    font-size: 14px;
    color: #64748b;
    font-weight: 600;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.card-info-text p {
    font-size: 24px;
    color: #0f172a;
    font-weight: 700;
}

.card-info-icon {
    font-size: 32px;
    background-color: #f8fafc;
    width: 60px;
    height: 60px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
}

/* Box Putih Wadah Konten / Tabel */
.table-responsive {
    background-color: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    border: 1px solid #e2e8f0;
}

/* Animasi Transisi Halaman */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}