@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600&display=swap');

:root {
    --primary: #0004ff;
    --secondary: #22d3ee;
    --bg: #f1f5f9;
    --card: rgba(255,255,255,0.9);
    --text: #0f172a;
}

/* RESET */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(120deg,#e0e7ff,#f0f9ff);
    min-height: 100vh;
}

/* ================= LOGIN ================= */
.login-box {
    width: 360px;
    padding: 35px;
    border-radius: 20px;
    background: var(--card);
    backdrop-filter: blur(12px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.2);
    margin: auto;
    margin-top: 10%;
    animation: fadeIn 0.6s ease;
}

.login-box h2 {
    text-align: center;
    margin-bottom: 20px;
}

@keyframes fadeIn {
    from {opacity:0; transform: translateY(25px);}
    to {opacity:1; transform: translateY(0);}
}

/* ================= LAYOUT ================= */
.wrapper {
    display: flex;
}

/* SIDEBAR */
.sidebar {
    width: 250px;
    height: 100vh;
    background: var(--card);
    position: fixed;
    padding: 20px;
    border-right: 1px solid #e2e8f0;
}

.sidebar h2 {
    color: var(--primary);
    margin-bottom: 20px;
}

.sidebar a {
    display: block;
    padding: 12px;
    margin: 8px 0;
    text-decoration: none;
    color: var(--text);
    border-radius: 10px;
    transition: 0.3s;
}

.sidebar a:hover {
    background: var(--primary);
    color: white;
}

/* ================= MAIN ================= */
.main {
    margin-left: 250px;
    padding: 30px;
    width: calc(100% - 250px);
}

/* ================= TOPBAR ================= */
.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.topbar h2 {
    font-weight: 600;
}

.logout {
    background: #ef4444;
    color: white;
    padding: 8px 12px;
    border-radius: 8px;
    text-decoration: none;
}

/* ================= CONTAINER ================= */
.container {
    width: 100%;
    background: white;
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.05);
}

/* ================= FORM ================= */
.form-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

input, select {
    width: 100%;
    padding: 10px;
    border-radius: 10px;
    border: 1px solid #ddd;
    font-size: 13px;
    transition: 0.2s;
}

input:focus, select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(99,102,241,0.2);
}

/* BUTTON */
.form-action {
    text-align: right;
}

button {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    border: none;
    padding: 10px 18px;
    border-radius: 10px;
    cursor: pointer;
    transition: 0.2s;
}

button:hover {
    transform: scale(1.05);
}

/* ================= TABLE ================= */
.table-wrap {
    width: 100%;
    overflow-x: auto;
    margin-top: 20px;
}

table {
    width: 100%;
    min-width: 1400px;
    border-collapse: collapse;
}

th {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    padding: 12px;
    font-size: 13px;
    text-align: center;
}

td {
    padding: 10px;
    text-align: center;
    border-bottom: 1px solid #eee;
    font-size: 12px;
}

tr:nth-child(even) {
    background: #f8fafc;
}

tr:hover {
    background: #eef2ff;
}

/* ================= BUTTON AKSI ================= */
.btn-edit {
    background: #f59e0b;
    color: white;
    padding: 5px 10px;
    border-radius: 6px;
    text-decoration: none;
}

.btn-hapus {
    background: #ef4444;
    color: white;
    padding: 5px 10px;
    border-radius: 6px;
    text-decoration: none;
}

/* ================= ERROR ================= */
.error {
    color: red;
    text-align: center;
    margin-bottom: 10px;
}

/* ================= RESPONSIVE ================= */
@media(max-width: 1200px){
    .form-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media(max-width: 768px){
    .sidebar {
        display: none;
    }

    .main {
        margin-left: 0;
        width: 100%;
    }

    .form-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}