/* ==========================================================================
   1. RESET & GAYA UMUM (GLOBAL STYLES)
   ========================================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: #f4f7f6;
    color: #333;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ==========================================================================
   2. HEADER & NAVIGASI RESPONSIF
   ========================================================================== */
header {
    background-color: #2c3e50;
    color: white;
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.navbar {
    width: 85%;
    margin: auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap; /* Agar menu bisa turun jika layar sempit */
    gap: 15px;
}

.logo h1 {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

nav ul {
    list-style: none;
    display: flex;
    align-items: center;
    flex-wrap: wrap; /* Navigasi membungkus rapi di HP */
}

nav ul li {
    margin-left: 20px;
}

nav ul li a {
    color: #e0e6ed;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
    font-size: 15px;
    padding: 5px 0;
    display: inline-block;
}

nav ul li a:hover {
    color: #1abc9c;
}

/* ==========================================================================
   3. LAYOUT KONTEN & CONTAINER
   ========================================================================== */
.container {
    width: 85%;
    margin: 30px auto;
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    flex: 1;
}

h2 {
    color: #2c3e50;
    margin-bottom: 25px;
    border-bottom: 3px solid #1abc9c;
    padding-bottom: 12px;
    font-size: 22px;
}

h3 {
    color: #34495e;
    margin-bottom: 15px;
}

/* Grid Halaman Layanan */
.grid-layanan {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.kartu-layanan {
    background: #f8fafc;
    padding: 20px;
    border-radius: 6px;
    border-left: 5px solid #1abc9c;
    box-shadow: 0 2px 5px rgba(0,0,0,0.02);
    transition: transform 0.3s ease;
}

.kartu-layanan:hover {
    transform: translateY(-3px);
}

/* ==========================================================================
   4. FORMULIR & LOGIN
   ========================================================================== */
form {
    display: flex;
    flex-direction: column;
}

label {
    margin-top: 15px;
    font-weight: 600;
    color: #4a5568;
    font-size: 14px;
}

input, textarea, select {
    padding: 12px;
    margin-top: 6px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    width: 100%;
    font-size: 15px;
    background-color: #fff;
}

input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: #1abc9c;
    box-shadow: 0 0 0 3px rgba(26, 188, 156, 0.15);
}

button, .btn-print {
    margin-top: 20px;
    padding: 12px 20px;
    background-color: #1abc9c;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    text-align: center;
    transition: background-color 0.3s ease;
}

button:hover { background-color: #16a085; }

.wrapper-login {
    display: flex;
    justify-content: center;
    align-items: center;
    flex: 1;
    padding: 20px;
}

.box-login {
    width: 100%;
    max-width: 400px;
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.08);
}

.pesan-error {
    color: #e74c3c;
    background-color: #fce4e4;
    padding: 12px;
    border-radius: 6px;
    font-size: 14px;
    margin-bottom: 20px;
    text-align: center;
    border: 1px solid #fccdcd;
}

/* ==========================================================================
   5. OPTIMASI TABEL RESPONSIF (Tabel gulir ke samping di HP)
   ========================================================================== */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    background: white;
}

th, td {
    padding: 12px 14px;
    text-align: left;
    font-size: 14px;
}

th { background-color: #1abc9c; color: white; font-weight: 600; }
td { border-bottom: 1px solid #e2e8f0; color: #4a5568; }
tr:nth-child(even) td { background-color: #f8fafc; }

/* Pembungkus tabel otomatis agar di HP bisa di-geser kanan-kiri tanpa merusak web */
table {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* ==========================================================================
   6. LAYOUT DASHBOARD ADMIN UTAMA
   ========================================================================== */
.layout-dashboard {
    display: grid;
    grid-template-columns: 240px 1fr;
    flex: 1;
}

.sidebar {
    background-color: #2c3e50;
    color: white;
    padding: 25px 15px;
    border-top: 1px solid #34495e;
}

.sidebar h3 {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #95a5a6;
    margin-bottom: 15px;
}

.sidebar ul { list-style: none; }
.sidebar ul li { margin-bottom: 5px; }
.sidebar ul li a {
    color: #ecf0f1;
    text-decoration: none;
    display: block;
    padding: 10px 12px;
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.sidebar ul li a:hover, .sidebar ul li a.aktif {
    background-color: #1abc9c;
    color: white;
}

.konten-utama {
    padding: 25px 30px;
    background-color: #f4f7f6;
    overflow-x: hidden;
}

.kartu-statistik {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px;
    margin-bottom: 25px;
}

.stat {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.02);
    border-top: 4px solid #1abc9c;
}

.stat h3 { font-size: 12px; color: #7f8c8d; text-transform: uppercase; margin-bottom: 5px; }
.stat p { font-size: 26px; font-weight: 700; color: #2c3e50; }

.badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    display: inline-block;
}
.badge-pending { background-color: #fef3c7; color: #d97706; }
.badge-selesai { background-color: #dcfce7; color: #15803d; }

.tombol-aksi {
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    color: white;
    text-decoration: none;
    display: inline-block;
    margin-bottom: 5px;
}
.btn-terima { background-color: #10b981; }
.btn-tolak { background-color: #ef4444; }

/* ==========================================================================
   7. MEDIA QUERIES (SISTEM ADAPTIF HP & TABLET)
   ========================================================================== */

/* Ketika dibuka di Tablet / Layanan Sedang (Di bawah 992px) */
@media (max-width: 992px) {
    .layout-dashboard {
        grid-template-columns: 1fr; /* Sidebar dan konten bertumpuk vertikal */
    }
    .sidebar {
        padding: 15px;
    }
    .sidebar ul {
        display: flex;
        flex-wrap: wrap;
        gap: 10px;
    }
    .sidebar ul li {
        margin-bottom: 0;
        flex: 1;
        min-width: 140px;
    }
    .sidebar ul li a {
        text-align: center;
        padding: 8px;
    }
}

/* Ketika dibuka di HP / Layar Kecil (Di bawah 768px) */
@media (max-width: 768px) {
    .navbar {
        flex-direction: column;
        text-align: center;
    }
    nav ul {
        justify-content: center;
        padding: 0;
    }
    nav ul li {
        margin: 5px 10px;
    }
    .container {
        width: 92%;
        padding: 20px;
        margin: 20px auto;
    }
    .konten-utama {
        padding: 15px;
    }
    
    /* Menyerasikan judul halaman dan kolom cari di HP agar tidak bertabrakan */
    .konten-utama div[style*="display: flex"] {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 15px;
    }
    .konten-utama div[style*="width: 320px"], 
    .konten-utama div[style*="width: 300px"],
    .konten-utama div[style*="display: flex; gap: 15px"] {
        width: 100% !important;
    }
}

/* ==========================================================================
   8. FOOTER
   ========================================================================== */
footer {
    background-color: #2c3e50;
    color: #95a5a6;
    text-align: center;
    padding: 15px 0;
    font-size: 13px;
    border-top: 1px solid #34495e;
    width: 100%;
}
/* ==========================================================================
   9. BACKGROUND GAMBAR KHUSUS KOTAK SELAMAT DATANG (BERANDA)
   ========================================================================== */
.kontainer-selamat-datang {
    /* Menggunakan gambar online bertema ruang konseling yang teduh agar langsung muncul */
    background-image: linear-gradient(rgba(255, 255, 255, 0.90), rgba(255, 255, 255, 0.90)), 
                     url('img/bg-beranda');
    
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    
    /* Tambahan desain agar teks di dalam kotak memiliki ruang yang nyaman */
    padding: 40px !important;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.05);
}

/* Membuat tulisan judul di dalam kotak selamat datang lebih tegas */
.kontainer-selamat-datang h2 {
    color: #114e60;
    font-weight: 700;
}
