@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;600&display=swap');

body {
    font-family: 'Poppins', sans-serif;
    background-color: #f4f7f6;
    color: #333;
    margin: 0;
}

/* --- GAYA UNTUK LOGIN & REGISTRASI --- */
.login-body {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}
.login-container {
    background-color: #fff;
    padding: 30px 40px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    width: 90%;
    max-width: 400px;
}
.login-container h2 {
    text-align: center;
    margin-top: 0;
    margin-bottom: 25px;
}
.form-footer {
    text-align: center;
    margin-top: 20px;
    font-size: 0.9em;
}
.form-footer a {
    color: #3498db;
    font-weight: 600;
}

/* --- Container & Header Utama Panel Admin --- */
.admin-container {
    background-color: #fff;
    padding: 30px 40px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    width: 90%;
    max-width: 1200px; /* Lebar maksimal agar navigasi dan konten leluasa */
    margin: 40px auto;
}
.report-container { /* Khusus untuk layout laporan yang mungkin lebih lebar */
    max-width: 1400px;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #e0e0e0;
    padding-bottom: 15px;
    margin-bottom: 25px;
}
.admin-header .header-logo a {
    font-size: 1.5em;
    font-weight: 600;
    color: #3498db;
    text-decoration: none;
}
.admin-header .header-user {
    display: flex; /* Gunakan flexbox untuk tombol profil/logout */
    align-items: center;
    gap: 15px; /* Jarak antar item */
}
.admin-header .header-user span {
    font-size: 0.95em;
    color: #555;
}
.admin-header .header-user a { /* Gaya untuk tombol Profil dan Logout */
    padding: 6px 12px;
    border-radius: 5px;
    font-size: 0.85em;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap; /* Mencegah teks pecah */
    transition: background-color 0.2s ease;
}
.admin-header .btn-profile {
    background-color: #6c757d; /* Abu-abu */
    color: white;
}
.admin-header .btn-profile:hover {
    background-color: #5a6268;
}
.admin-header .btn-logout {
    background-color: #e74c3c; /* Merah */
    color: white;
}
.admin-header .btn-logout:hover {
    background-color: #c0392b;
}


/* --- Navigasi Admin Utama --- */
.admin-nav {
    background-color: #ecf0f1;
    padding: 10px 15px;
    border-radius: 8px;
    margin-bottom: 30px;
    display: flex;
    justify-content: center; /* Menengahkan seluruh blok nav */
    align-items: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.admin-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap; /* Izinkan item untuk bungkus ke baris berikutnya jika tidak cukup ruang */
    justify-content: center; /* Tetap tengahkan item bahkan jika membungkus */
    gap: 12px; /* Jarak antar item */
    max-width: 100%; /* Pastikan ul tidak meluber */
}

.admin-nav ul li a {
    text-decoration: none;
    color: #34495e;
    font-weight: 600;
    padding: 8px 16px;
    font-size: 0.88em;
    border-radius: 6px;
    transition: background-color 0.3s ease, color 0.3s ease, transform 0.2s ease, box-shadow 0.2s ease;
    border: none;
    display: block;
    white-space: nowrap; /* Mencegah teks menu pecah ke baris baru */
    min-width: 110px; /* Lebar minimal untuk konsistensi */
    text-align: center;
}

.admin-nav ul li a:hover {
    background-color: #bdc3c7;
    color: #2c3e50;
    transform: translateY(-1px);
}

.admin-nav ul li a.active {
    background-color: #3498db;
    color: white;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    transform: translateY(0);
}

/* RESPONSIF: Untuk layar yang lebih kecil (mobile) */
@media (max-width: 768px) {
    .admin-nav ul {
        flex-direction: column;
        align-items: stretch;
        gap: 5px;
        padding: 5px;
    }
    .admin-nav ul li {
        width: 100%;
        text-align: center;
    }
    .admin-nav ul li a {
        padding: 10px 0;
        font-size: 1em;
        min-width: unset;
    }
}


/* --- Form & Input (Umum) --- */
.form-group { margin-bottom: 20px; }
.form-group label { display: block; font-weight: 600; margin-bottom: 8px; color: #555; }
.form-group input,
.form-group input[type="email"],
.form-group input[type="password"],
.form-group textarea,
.form-group select,
.form-group input[type="date"] {
    width: 100%;
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 5px;
    box-sizing: border-box;
    font-size: 1em;
    font-family: inherit;
}

/* Styling khusus untuk input warna di form Bio Link */
input[type="color"] {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    border: none;
    width: 40px;
    height: 40px;
    padding: 0;
    background: transparent;
    cursor: pointer;
    display: inline-block;
    vertical-align: middle;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    border-radius: 4px;
    margin-right: 10px;
}
input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
input[type="color"]::-webkit-color-swatch { border: none; border-radius: 4px; }
input[type="color"]::-moz-color-swatch { border: none; border-radius: 4px; }

/* Perbaikan untuk alignment label dengan input color */
.form-group label[for] { display: inline-block; margin-bottom: 8px; }
.form-group label[for][type="color"] { vertical-align: middle; line-height: 40px; margin-bottom: 0; }

/* Styling untuk mengelompokkan bagian desain */
.design-section-group {
    background-color: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 25px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}
.design-section-group h4 {
    color: #34495e;
    margin-top: 0;
    margin-bottom: 20px;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
    font-size: 1.2em;
    text-align: left;
}

/* Styling untuk kelompok radio button agar horizontal */
.radio-group {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 20px;
    align-items: center;
}
.radio-group input[type="radio"] {
    position: absolute; /* Sembunyikan radio button bawaan */
    opacity: 0;
}
.radio-group label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-weight: normal;
    color: #555;
    background-color: #eee;
    padding: 8px 15px;
    border-radius: 5px;
    transition: background-color 0.3s, border-color 0.3s, color 0.3s;
    border: 1px solid #ddd;
    margin-bottom: 0;
}
.radio-group label:hover { background-color: #e0e0e0; border-color: #ccc; }
.radio-group input[type="radio"]:checked + label {
    background-color: #3498db;
    color: white;
    border-color: #3498db;
    font-weight: 600;
    box-shadow: 0 2px 5px rgba(0,0,0,0.15);
}
.radio-group label::before { /* Tanda cek visual pada radio button */
    content: ''; display: inline-block; width: 14px; height: 14px;
    border: 1px solid #aaa; border-radius: 50%; margin-right: 8px;
    background-color: white; transition: background-color 0.3s, border-color 0.3s;
}
.radio-group input[type="radio"]:checked + label::before {
    background-color: #fff;
    border-color: #fff;
    box-shadow: inset 0 0 0 4px #3498db;
}
.design-option-group { /* Styling untuk mengelola tampilan opsi solid/gambar/gradien */
    border-top: 1px solid #eee;
    padding-top: 20px;
    margin-top: 20px;
}


/* --- Tombol (Umum dan Spesifik Aksi) --- */
.btn { /* Gaya dasar tombol. Beberapa tombol akan ditimpa gayanya. */
    text-decoration: none;
    display: inline-block;
    text-align: center;
    padding: 12px;
    border: none;
    background-color: #3498db;
    color: white;
    font-size: 1.1em;
    font-weight: 600;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}
.btn:hover {
    background-color: #2980b9;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}

.btn-add { /* Tombol "Tambah Link Baru" */
    background-color: #27ae60;
    padding: 12px 20px;
    font-size: 1em; /* Sedikit lebih kecil dari default .btn tapi lebih menonjol dari action-btn */
    font-weight: 600;
    border-radius: 8px; /* Lebih membulat */
    width: auto; /* Penting untuk tidak 100% */
    margin-bottom: 0; /* Dikelola oleh parent .action-bar */
    box-shadow: 0 4px 10px rgba(0,0,0,0.1); /* Tambahkan bayangan untuk menonjol */
    transform: translateY(0); /* Pastikan efek hover dari .btn tidak aktif secara default */
}
.btn-add:hover {
    background-color: #218c57;
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0,0,0,0.2);
}

.btn-filter {
    background-color: #3498db;
    color: white;
    padding: 8px 15px;
    border-radius: 5px;
    font-weight: 600;
    transition: background-color 0.3s;
    border: none;
    cursor: pointer;
    height: 40px;
    font-size: 0.9em;
    box-shadow: none; /* Jangan ada bayangan duplikat */
    transform: none; /* Jangan ada transform duplikat */
    line-height: 40px; /* Sesuaikan line-height */
    vertical-align: middle; /* Selaraskan secara vertikal */
    display: inline-flex; /* Agar konten bisa di-align */
    align-items: center;
    justify-content: center;
}
.btn-filter:hover { background-color: #2980b9; transform: none; box-shadow: none; }


.btn-reset {
    background-color: #95a5a6;
    padding: 8px 15px;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    font-weight: 500;
    line-height: 40px; /* Sesuaikan line-height */
    transition: background-color 0.3s;
    height: 40px;
    font-size: 0.9em;
    box-shadow: none;
    transform: none;
    vertical-align: middle; /* Selaraskan secara vertikal */
    display: inline-flex; /* Agar konten bisa di-align */
    align-items: center;
    justify-content: center;
}
.btn-reset:hover { background-color: #7f8c8d; transform: none; box-shadow: none; }

.btn-qr { /* Tombol QR besar */
    background-color: #f39c12;
    color: white;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    transition: background-color 0.3s ease, transform 0.2s ease;
    border: none;
    text-decoration: none;
    display: inline-block;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}
.btn-qr:hover {
    background-color: #e67e22;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}

/* Gaya untuk Tombol QR Code Kecil di Tabel */
.action-btn.btn-qr-small {
    background-color: #f39c12;
    color: white !important;
    padding: 4px 8px;
    font-size: 0.75em;
    border-radius: 5px;
    min-width: unset;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.action-btn.btn-qr-small:hover {
    background-color: #e67e22;
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(0,0,0,0.15);
}


/* Penyesuaian gaya umum tombol aksi di tabel */
.action-btn {
    padding: 6px 12px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 0.85em;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    min-width: 80px;
    color: white !important;
}
.action-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

/* Warna spesifik untuk setiap jenis tombol aksi */
.action-btn.report { background-color: #007bff; }
.action-btn.report:hover { background-color: #0056b3; }

.action-btn.edit { background-color: #28a745; }
.action-btn.edit:hover { background-color: #218838; }

.action-btn.delete { background-color: #dc3545; }
.action-btn.delete:hover { background-color: #c82333; }

.action-btn.manage { background-color: #6c757d; }
.action-btn.manage:hover { background-color: #5a6268; }


/* --- Tabel & Konten Tabel --- */
.table-title { text-align: center; margin-top: 40px; font-size: 1.5em; color: #333; }
.table-container { overflow-x: auto; }
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    background-color: #fff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    border-radius: 8px;
    overflow: hidden;
}
table th, table td { padding: 12px 15px; border-bottom: 1px solid #e0e0e0; text-align: left; vertical-align: middle; }
table th { background-color: #f8f8f8; font-weight: 600; color: #555; text-transform: uppercase; font-size: 0.9em; }
table tr:last-child td { border-bottom: none; }
table tbody tr:hover { background-color: #f5f5f5; }

/* Styling untuk TD yang berisi aksi/tombol */
td.actions {
    white-space: nowrap; /* Mencegah baris baru di dalam sel jika tombol berdekatan */
}

/* Gaya untuk Status Badge (Aktif/Banned) di tabel users */
.status-badge {
    padding: 4px 8px;
    border-radius: 5px;
    font-size: 0.75em;
    font-weight: 600;
    color: white;
    text-transform: uppercase;
    display: inline-block;
    min-width: 60px;
    text-align: center;
}
.status-badge.status-active { background-color: #28a745; }
.status-badge.status-banned { background-color: #dc3545; }


/* --- Notifikasi, Grafik, Filter, Ringkasan, Pagination --- */
.error, .success { padding: 10px; border-radius: 5px; text-align: center; margin-bottom: 15px; }
.error { background-color: #ffebee; color: #c62828; }
.success { background-color: #e8f5e9; color: #2e7d32; }

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); /* Responsif grid 300px min */
    gap: 25px;
    margin-bottom: 40px;
}
.stat-card, .summary-card, .report-chart-card { /* Tambah .report-chart-card agar gayanya seragam */
    background-color: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.07);
}
.stat-card h3, .summary-card h3, .report-chart-card h3 { /* Gaya header di card */
    text-align: center;
    margin-top: 0;
    margin-bottom: 15px;
}
.stat-card canvas, .report-chart-card canvas { /* Gaya canvas chart */
    max-height: 250px;
}

.date-filter-form.card { /* Gaya form filter tanggal */
    padding: 20px;
    margin-bottom: 30px;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center; /* Mengatur alignment secara default */
}
.date-filter-form form {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center; /* Mengatur alignment secara default */
    flex-grow: 1;
}
.date-filter-form .filter-group {
    margin-bottom: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}
.date-filter-form .filter-group label { margin-bottom: 0; font-weight: 500; }
.date-filter-form .filter-group input[type="date"] {
    padding: 8px 10px; border-radius: 5px; border: 1px solid #ccc;
    height: 40px; /* Samakan tinggi dengan tombol filter */
}

/* Responsif untuk form filter */
@media (max-width: 768px) {
    .date-filter-form.card {
        flex-direction: column;
        align-items: stretch;
    }
    .date-filter-form form {
        flex-direction: column;
        align-items: stretch;
    }
    .date-filter-form .btn-export-csv {
        margin-left: 0;
        width: 100%;
        text-align: center;
        margin-top: 15px;
    }
}


.summary-grid-report { /* Gaya ringkasan laporan (jika ada) */
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}
.summary-card h3 { margin-top: 0; margin-bottom: 15px; font-size: 1.1em; text-align: center; border-bottom: 1px solid #eee; padding-bottom: 10px; }
.summary-list { list-style: none; padding: 0; margin: 0; }
.summary-item { display: flex; justify-content: space-between; padding: 8px 5px; font-size: 0.95em; border-bottom: 1px solid #f1f3f5; }
.summary-item:last-child { border-bottom: none; }
.summary-count { font-weight: 600; }
.summary-percentage { font-weight: 400; color: #6c757d; font-size: 0.9em; margin-left: 5px; }


/* --- Pagination --- */
.pagination-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 30px;
    gap: 8px;
    flex-wrap: wrap;
}
.pagination-link {
    display: inline-block;
    padding: 8px 14px;
    border: 1px solid #dee2e6;
    color: #3498db;
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.2s ease;
}
.pagination-link:hover {
    background-color: #f4f7f9;
    border-color: #ced4da;
}
.pagination-link.active {
    background-color: #3498db;
    color: white;
    border-color: #3498db;
    font-weight: 600;
}
.pagination-ellipsis {
    padding: 8px 5px;
    color: #6c757d;
}

/* Halaman Profil */
.profile-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(350px, 1fr)); gap: 30px; }
.profile-grid .card { padding: 30px; }
.form-title { text-align: center; margin-top: 0; margin-bottom: 25px; border-bottom: 1px solid #eee; padding-bottom: 15px; }

/* CSS untuk Dropdown Navigasi */
.admin-nav .dropdown {
    position: relative;
    display: inline-block;
}

.admin-nav .dropdown-menu {
    display: none;
    position: absolute;
    background-color: #f9f9f9;
    min-width: 220px;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
    z-index: 1;
    list-style: none;
    padding: 0;
    margin-top: 5px;
    border-radius: 5px;
    border: 1px solid #ddd;
}

.admin-nav .dropdown-menu li a {
    color: black;
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    text-align: left;
    background: none;
    border-bottom: 1px solid #eee;
}

.admin-nav .dropdown-menu li a:last-child {
    border-bottom: none;
}

.admin-nav .dropdown-menu li a:hover {
    background-color: #f1f1f1;
}

.admin-nav .dropdown:hover .dropdown-menu {
    display: block;
}

/* Opsi untuk panah dropdown */
.arrow-down {
    border: solid black;
    border-width: 0 2px 2px 0;
    display: inline-block;
    padding: 3px;
    margin-left: 5px;
    transform: rotate(45deg);
    -webkit-transform: rotate(45deg);
}

/* =================================== */
/* CSS untuk Dropdown Navigasi         */
/* =================================== */
.admin-nav .dropdown {
    position: relative;
    display: inline-block;
}

.admin-nav .dropdown-menu {
    display: none;
    position: absolute;
    background-color: #f9f9f9;
    min-width: 220px;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
    z-index: 1;
    list-style: none;
    padding: 0;
    margin-top: 5px;
    border-radius: 5px;
    border: 1px solid #ddd;
}

.admin-nav .dropdown-menu li a {
    color: black;
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    text-align: left;
    background: none;
    border-bottom: 1px solid #eee;
}

.admin-nav .dropdown-menu li a:last-child {
    border-bottom: none;
}

.admin-nav .dropdown-menu li a:hover {
    background-color: #f1f1f1;
}

/* Tampilkan dropdown saat di-hover */
.admin-nav .dropdown:hover .dropdown-menu {
    display: block;
}

/* Style untuk panah dropdown */
.arrow-down {
    border: solid #333; /* Warna panah */
    border-width: 0 2px 2px 0;
    display: inline-block;
    padding: 3px;
    margin-left: 5px;
    transform: rotate(45deg);
    -webkit-transform: rotate(45deg);
    position: relative;
    top: -2px; /* Penyesuaian posisi vertikal */
}

/* Style untuk menandai submenu yang aktif */
.dropdown-menu a.active-sub {
    font-weight: bold;
    background-color: #e9ecef;
}