/* ============================================================
   RESET & BASE
   ============================================================ */
* { 
    box-sizing: border-box; 
    font-family: Arial, sans-serif; 
}
body { 
    margin: 0; 
    background: #f4f6f9; 
    color: #333; 
}

/* ============================================================
   NAVIGATION BAR
   ============================================================ */
nav { 
    background: #1e3a8a; 
    color: #fff; 
    padding: 12px 24px; 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    flex-wrap: wrap; 
    gap: 10px; 
}
nav a { 
    color: #fff; 
    text-decoration: none; 
    margin-left: 14px; 
    font-size: 14px; 
}
nav a:hover { 
    text-decoration: underline; 
}
.btn-logout { 
    background: #dc2626; 
    padding: 6px 12px; 
    border-radius: 4px; 
}
.role-badge { 
    display: inline-block; 
    padding: 2px 8px; 
    border-radius: 10px; 
    font-size: 11px; 
    font-weight: 600; 
    margin-left: 6px; 
    text-transform: uppercase; 
}
.role-badge.admin { 
    background: #fbbf24; 
    color: #78350f; 
}
.role-badge.mahasiswa { 
    background: #93c5fd; 
    color: #1e3a8a; 
}

/* ============================================================
   LAYOUT & CONTAINER
   ============================================================ */
.container { 
    padding: 24px; 
    max-width: 1100px; 
    margin: auto; 
}

/* ============================================================
   LOGIN PAGE
   ============================================================ */
.login-page { 
    background: linear-gradient(135deg, #1e3a8a, #3b82f6); 
    min-height: 100vh; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    padding: 20px; 
}
.login-container { 
    background: #fff; 
    padding: 32px; 
    border-radius: 10px; 
    box-shadow: 0 10px 40px rgba(0,0,0,.2); 
    width: 100%; 
    max-width: 420px; 
}
.login-container h2 { 
    text-align: center; 
    color: #1e3a8a; 
    margin: 0 0 6px; 
}
.subtitle { 
    text-align: center; 
    color: #6b7280; 
    font-size: 14px; 
    margin: 0 0 20px; 
}
.footer-text { 
    text-align: center; 
    font-size: 12px; 
    color: #9ca3af; 
    margin-top: 16px; 
}

/* ============================================================
   FORM ELEMENTS
   ============================================================ */
input, select, button { 
    width: 100%; 
    padding: 10px; 
    margin: 6px 0 12px; 
    border: 1px solid #ccc; 
    border-radius: 4px; 
    font-size: 14px; 
}
input:focus, select:focus { 
    outline: none; 
    border-color: #1e3a8a; 
    box-shadow: 0 0 0 3px rgba(30,58,138,.1); 
}
button { 
    background: #1e3a8a; 
    color: #fff; 
    border: none; 
    cursor: pointer; 
    font-weight: 600; 
    transition: background 0.2s;
}
button:hover { 
    background: #16296b; 
}

/* ============================================================
   FORM BOXES & FILTERS
   ============================================================ */
.form-box { 
    background: #fff; 
    padding: 20px; 
    border-radius: 8px; 
    margin-bottom: 20px; 
    max-width: 550px; 
}
.filter-box { 
    display: flex; 
    gap: 10px; 
    margin-bottom: 20px; 
    align-items: center; 
    flex-wrap: wrap; 
}
.filter-box input, .filter-box select { 
    flex: 1; 
    min-width: 150px; 
    margin: 0; 
}
.filter-box button { 
    width: auto; 
    padding: 10px 20px; 
}

/* ============================================================
   BUTTONS (Cancel & Print)
   ============================================================ */
.btn-cancel { 
    background: #6b7280; 
    color: #fff; 
    padding: 10px 16px; 
    border-radius: 4px; 
    text-decoration: none; 
    display: inline-block; 
    margin: 6px 0 12px; 
}
.btn-cancel:hover {
    background: #4b5563;
}

/* Tombol Cetak */
.btn-cetak {
    background: #059669; 
    color: #fff;
    padding: 10px 20px;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 600;
    display: inline-block;
    transition: background 0.2s;
}
.btn-cetak:hover {
    background: #047857;
}

/* Tombol Hapus Berbentuk Link */
.btn-link { 
    background: none; 
    border: none; 
    color: #dc2626; 
    text-decoration: underline; 
    cursor: pointer; 
    padding: 0; 
    font-size: 14px; 
    width: auto; 
}
.btn-link:hover { 
    color: #991b1b; 
    background: none; 
}

/* ============================================================
   TABEL
   ============================================================ */
table { 
    width: 100%; 
    border-collapse: collapse; 
    background: #fff; 
    border-radius: 8px; 
    overflow: hidden; 
    box-shadow: 0 2px 6px rgba(0,0,0,.05);
}
th, td { 
    padding: 12px; 
    text-align: left; 
    border-bottom: 1px solid #eee; 
    font-size: 14px; 
}
th { 
    background: #1e3a8a; 
    color: #fff; 
}

/* ============================================================
   BADGES (Status & Role)
   ============================================================ */
.badge { 
    padding: 4px 8px; 
    border-radius: 4px; 
    font-size: 12px; 
    color: #fff; 
}
.badge.selesai { background: #16a34a; }
.badge.proses  { background: #f59e0b; }

/* ============================================================
   NOTIFIKASI & ALERTS
   ============================================================ */
.err { 
    color: #991b1b; 
    background: #fee2e2; 
    padding: 10px; 
    border-radius: 4px; 
    margin-bottom: 12px;
}
.ok { 
    color: #166534; 
    background: #dcfce7; 
    padding: 10px; 
    border-radius: 4px; 
    margin-bottom: 12px; 
}
.alert { 
    background: #fef3c7; 
    color: #78350f; 
    padding: 10px; 
    border-radius: 4px; 
    font-size: 13px; 
    margin-bottom: 12px; 
}

/* ============================================================
   DASHBOARD CARDS
   ============================================================ */
.cards { 
    display: flex; 
    gap: 20px; 
    flex-wrap: wrap; 
}
.card { 
    flex: 1; 
    min-width: 180px; 
    background: #fff; 
    padding: 20px; 
    border-radius: 8px; 
    text-align: center; 
    box-shadow: 0 2px 6px rgba(0,0,0,.05); 
}
.card h1 { 
    color: #1e3a8a; 
    margin: 8px 0 0; 
}
/* ============================================================
   RESPONSIVE TABLE UNTUK MOBILE (Tampilan Kartu)
   ============================================================ */
.table-responsive {
    width: 100%;
    overflow-x: auto;
}

@media (max-width: 768px) {
    /* Sembunyikan header tabel di HP */
    .table-responsive table thead {
        display: none;
    }

    /* Ubah baris tabel menjadi blok kartu */
    .table-responsive table, 
    .table-responsive table tbody, 
    .table-responsive table tr, 
    .table-responsive table td {
        display: block;
        width: 100%;
    }

    /* Desain Kartu */
    .table-responsive table tr {
        margin-bottom: 15px;
        background: #fff;
        border: 1px solid #e5e7eb;
        border-radius: 8px;
        box-shadow: 0 2px 4px rgba(0,0,0,0.05);
        padding: 10px;
    }

    /* Desain isi kartu */
    .table-responsive table td {
        text-align: right;
        padding: 10px 10px 10px 50%;
        position: relative;
        border-bottom: 1px solid #f3f4f6;
    }

    .table-responsive table td:last-child {
        border-bottom: none;
    }

    /* Label di sebelah kiri (diambil dari atribut data-label) */
    .table-responsive table td::before {
        content: attr(data-label);
        position: absolute;
        left: 10px;
        width: 45%;
        font-weight: bold;
        text-align: left;
        color: #4b5563;
    }

    /* Khusus tombol aksi agar rata tengah di mobile */
    .table-responsive table td[data-label="Aksi"] {
        text-align: center;
        padding: 15px 10px 10px 10px;
        background: #f9fafb;
        border-radius: 0 0 8px 8px;
        margin-top: 5px;
    }

    .table-responsive table td[data-label="Aksi"]::before {
        display: none; /* Sembunyikan label "Aksi" */
    }

    .action-buttons {
        display: flex;
        justify-content: center;
        align-items: center;
        gap: 15px;
    }

    .action-buttons form {
        margin: 0;
    }
}