/* ================= GOOGLE FONT ================= */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,wght@0,300;0,400;0,500;0,600;1,400&display=swap');

/* ================= GLOBAL ================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'DM Sans', sans-serif;
    background: #f4f4f2;
    color: #1a1a1a;
}

/* ================= LAYOUT ================= */
.container {
    display: flex;
    min-height: 100vh;
}

/* ================= SIDEBAR ================= */
.sidebar {
    width: 260px;
    background: #0d0d0d;
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    padding: 25px 15px;
    overflow-y: auto;
    box-shadow: 4px 0 20px rgba(0, 0, 0, .15);
    z-index: 1000;
}

.sidebar h2 {
    text-align: center;
    color: #ffffff;
    margin-bottom: 30px;
    font-size: 20px;
    font-weight: 600;
    letter-spacing: -.2px;
}

.sidebar a {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: rgba(255, 255, 255, .6);
    padding: 13px 15px;
    margin-bottom: 4px;
    border-radius: 10px;
    transition: .25s;
    font-size: 14px;
    font-weight: 400;
}

.sidebar a:hover,
.sidebar a.active {
    background: rgba(255, 255, 255, .1);
    color: #ffffff;
    transform: translateX(4px);
}

/* ================= CONTENT ================= */
.content {
    flex: 1;
    margin-left: 260px;
    padding: 35px;
}

.content h1 {
    font-size: 28px;
    font-weight: 600;
    margin-bottom: 10px;
    color: #0d0d0d;
    letter-spacing: -.3px;
}

.content p {
    color: #888888;
    margin-bottom: 20px;
    font-size: 14px;
}

/* ================= CARD ================= */
.card,
.form-card {
    background: #ffffff;
    padding: 25px;
    border-radius: 16px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, .07);
    border: 1px solid #e4e4e4;
    margin-top: 20px;
}

/* ================= DASHBOARD CARD ================= */
.stats-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-top: 25px;
}

@media (max-width: 992px) {
    .stats-container { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 576px) {
    .stats-container { grid-template-columns: 1fr; }
}

.stat-card {
    background: #ffffff;
    border-radius: 18px;
    padding: 25px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, .07);
    border: 1px solid #e4e4e4;
    text-align: center;
    transition: .3s;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, .10);
}

.stat-card h2 {
    font-size: 32px;
    font-weight: 600;
    color: #0d0d0d;
    margin-bottom: 8px;
}

.stat-card p {
    color: #888888;
    margin: 0;
}

/* ================= MENU DASHBOARD ================= */
.dashboard-menu {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
    margin-top: 30px;
}

@media (max-width: 992px) {
    .dashboard-menu { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 576px) {
    .dashboard-menu { grid-template-columns: 1fr; }
}

.dashboard-menu .card {
    background: #ffffff;
    border-radius: 18px;
    padding: 25px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, .07);
    border: 1px solid #e4e4e4;
    transition: .3s;
}

.dashboard-menu .card:hover {
    transform: translateY(-6px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, .10);
}

.dashboard-menu h3 {
    color: #0d0d0d;
    margin-bottom: 10px;
    font-weight: 600;
}

.dashboard-menu p {
    color: #888888;
    min-height: 50px;
}

/* ================= TABLE ================= */
.table-container {
    overflow-x: auto;
    width: 100%;
}

table {
    width: 100%;
    background: #ffffff;
    border-collapse: collapse;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, .07);
    border: 1px solid #e4e4e4;
}

table th {
    background: #0d0d0d;
    color: #ffffff;
    text-align: center;
    vertical-align: middle;
    padding: 12px 14px;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: .4px;
    text-transform: uppercase;
}

table td {
    padding: 11px 14px;
    text-align: center;
    vertical-align: middle;
    border-bottom: 1px solid #f0f0f0;
    font-size: 14px;
    color: #4a4a4a;
}

table tr:hover {
    background: #fafafa;
}

table th:last-child,
table td:last-child {
    width: 180px;
    min-width: 180px;
}

/* ================= KOLOM AKSI ================= */
.aksi {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
}

.aksi .btn {
    margin: 0;
    min-width: 70px;
}

/* ================= FORM ================= */
form {
    width: 100%;
}

label {
    display: block;
    margin-top: 15px;
    margin-bottom: 5px;
    font-weight: 500;
    font-size: 14px;
    color: #1a1a1a;
}

input[type=text],
input[type=password],
input[type=date],
input[type=file],
textarea,
select {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #e4e4e4;
    border-radius: 10px;
    font-size: 14px;
    font-family: 'DM Sans', sans-serif;
    background: #fafafa;
    color: #1a1a1a;
    transition: .25s;
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: #0d0d0d;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(13, 13, 13, .08);
}

textarea {
    resize: vertical;
}

/* ================= BUTTON SYSTEM ================= */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 18px;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    font-family: 'DM Sans', sans-serif;
    cursor: pointer;
    text-decoration: none;
    transition: all .25s ease;
    letter-spacing: .1px;
}

.btn:hover {
    transform: translateY(-2px);
}

/* Hitam — primary */
.btn-primary {
    background: #0d0d0d;
    color: #ffffff;
}

.btn-primary:hover {
    background: #1a1a1a;
    opacity: .88;
}

/* Hijau — success */
.btn-success {
    background: #1a1a1a;
    color: #ffffff;
}

.btn-success:hover {
    background: #333333;
}

/* Merah — danger */
.btn-danger {
    background: #3d3d3d;
    color: #ffffff;
}

.btn-danger:hover {
    background: #1a1a1a;
}

/* Abu — secondary */
.btn-secondary {
    background: #888888;
    color: #ffffff;
}

.btn-secondary:hover {
    background: #666666;
}

/* Abu muda — warning (ganti kuning → abu medium) */
.btn-warning {
    background: #4a4a4a;
    color: #ffffff;
}

.btn-warning:hover {
    background: #333333;
}

/* ================= ALERT ================= */
.alert {
    padding: 14px 18px;
    margin-bottom: 20px;
    border-radius: 10px;
    color: #ffffff;
    font-weight: 500;
    font-size: 14px;
    background: #1a1a1a;
    border-left: 4px solid #0d0d0d;
}

/* ================= MODAL ================= */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, .55);
    z-index: 9999;
}

.modal.active {
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: #ffffff;
    width: 90%;
    max-width: 500px;
    border-radius: 16px;
    padding: 28px;
    position: relative;
    animation: popup .3s ease;
    border: 1px solid #e4e4e4;
}

@keyframes popup {
    from { opacity: 0; transform: scale(.92); }
    to   { opacity: 1; transform: scale(1); }
}

.close {
    position: absolute;
    right: 16px;
    top: 12px;
    font-size: 22px;
    cursor: pointer;
    color: #888888;
    transition: color .2s;
}

.close:hover { color: #0d0d0d; }

/* ================= IMAGE ================= */
img {
    max-width: 100%;
    border-radius: 10px;
}

/* ================= SCROLLBAR ================= */
::-webkit-scrollbar { width: 6px; }

::-webkit-scrollbar-track { background: #f4f4f2; }

::-webkit-scrollbar-thumb {
    background: #c8c8c8;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover { background: #888888; }

/* ================= RESPONSIVE ================= */
@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
    }

    .content {
        margin-left: 0;
        width: 100%;
        padding: 20px;
    }

    .container { flex-direction: column; }

    table {
        display: block;
        overflow-x: auto;
    }

    .dashboard-menu { grid-template-columns: 1fr; }
    .stats-container { grid-template-columns: 1fr; }
}

/* ================= FORM CARD ================= */
.form-card {
    max-width: 900px;
    background: #ffffff;
    margin-top: 20px;
    padding: 30px;
    border-radius: 18px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, .07);
    border: 1px solid #e4e4e4;
}

.form-card label {
    display: block;
    margin-top: 15px;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 14px;
    color: #1a1a1a;
}

.form-card input,
.form-card textarea,
.form-card select {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #e4e4e4;
    border-radius: 10px;
    font-size: 14px;
    font-family: 'DM Sans', sans-serif;
    background: #fafafa;
    color: #1a1a1a;
    transition: .25s;
}

.form-card input:focus,
.form-card textarea:focus,
.form-card select:focus {
    outline: none;
    border-color: #0d0d0d;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(13, 13, 13, .08);
}

/* ================= GALLERY ================= */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.gallery-item {
    background: #ffffff;
    padding: 15px;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 2px 12px rgba(0, 0, 0, .07);
    border: 1px solid #e4e4e4;
    transition: .3s;
}

.gallery-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, .10);
}

.gallery-item img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-radius: 10px;
    display: block;
}

.thumb-table {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
    display: block;
    margin: 0 auto;
}

.thumbnail-preview {
    max-width: 180px;
    max-height: 180px;
    width: auto;
    height: auto;
    border-radius: 10px;
    margin-bottom: 15px;
    display: block;
}

/* ================= LOGIN PAGE ================= */
.login-page {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    background: linear-gradient(
        135deg,
        #0d0d0d 0%,
        #2a2a2a 50%,
        #e4e4e4 100%
    );
}

.login-box {
    width: 100%;
    max-width: 420px;
    background: #ffffff;
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .25);
    text-align: center;
    position: relative;
    border: 1px solid #e4e4e4;
}

.login-box h2 {
    margin: 0 0 10px;
    color: #0d0d0d;
    font-size: 26px;
    font-weight: 600;
    letter-spacing: -.3px;
}

.login-box p {
    color: #888888;
    margin-bottom: 25px;
    font-size: 14px;
}

.login-box form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.login-box input {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid #e4e4e4;
    border-radius: 10px;
    font-size: 15px;
    font-family: 'DM Sans', sans-serif;
    background: #fafafa;
    color: #1a1a1a;
    transition: .25s;
    box-sizing: border-box;
}

.login-box input:focus {
    outline: none;
    border-color: #0d0d0d;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(13, 13, 13, .08);
}

.login-box button {
    width: 100%;
    padding: 14px;
    margin-top: 5px;
    background: #0d0d0d;
    color: #ffffff;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    font-family: 'DM Sans', sans-serif;
    cursor: pointer;
    transition: .25s;
    letter-spacing: .1px;
}

.login-box button:hover {
    background: #1a1a1a;
    transform: translateY(-2px);
    opacity: .88;
}

.login-box .alert {
    margin-bottom: 15px;
    border-radius: 10px;
}

@media (max-width: 576px) {
    .login-box { padding: 30px 25px; }
    .login-box h2 { font-size: 22px; }
}

/* ================= LOGIN NOTE ================= */
.login-note {
    background: #f9f9f7;
    border-left: 4px solid #888888;
    padding: 12px;
    margin-bottom: 20px;
    border-radius: 8px;
    font-size: 13px;
    color: #4a4a4a;
    text-align: left;
}

.login-subtitle {
    margin-bottom: 20px;
}

/* ================= CLOSE BUTTON ================= */
.login-close {
    position: absolute;
    top: 15px;
    right: 15px;
    text-decoration: none;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: #888888;
    background: #f4f4f2;
    font-size: 18px;
    font-weight: bold;
    transition: .25s;
}

.login-close:hover {
    background: #e4e4e4;
    color: #0d0d0d;
}

/* ================= TOMBOL KEMBALI ================= */
.btn-kembali {
    display: block;
    margin-top: 15px;
    text-decoration: none;
    color: #4a4a4a;
    font-weight: 600;
    font-size: 14px;
    transition: .25s;
}

.btn-kembali:hover {
    color: #0d0d0d;
}

/* ================= AKSI TOMBOL KOMENTAR ================= */
.aksi-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
}

.aksi-btn a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 9px 14px;
    border-radius: 10px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    color: #ffffff;
    transition: .25s ease;
}

.aksi-btn a i { font-size: 12px; }

/* Toggle */
.btn-toggle {
    background: #4a4a4a;
}

.btn-toggle:hover {
    background: #1a1a1a;
    transform: translateY(-1px);
}

/* Hapus */
.btn-hapus {
    background: #888888;
}

.btn-hapus:hover {
    background: #0d0d0d;
    transform: translateY(-1px);
}

/* ================= ACTION TOP ================= */
.action-top {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 22px;
}

.action-top .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 44px;
    padding: 0 20px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    box-sizing: border-box;
}

.action-top .btn i { margin-right: 8px; }