/* =========================================
   1. GLOBAL STYLES (Untuk Semua Halaman)
   ========================================= */
body { 
    font-family: 'Inter', sans-serif; 
    background-color: #f3f4f6; 
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* =========================================
   2. HALAMAN UTAMA (index.php)
   ========================================= */
.main-container {
    width: 100%;
    max-width: 800px;
    margin-top: 40px;
    padding: 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-left: auto;
    margin-right: auto;
}

/* Logo & Header Sekolah */
.school-logo {
    width: 100px; 
    height: auto;
    margin-bottom: 15px;
    filter: drop-shadow(0 4px 6px rgba(0,0,0,0.1));
}
.school-name {
    font-weight: 800;
    color: #1f2937;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 1.25rem;
    margin-bottom: 5px;
    line-height: 1.2;
}
.class-name {
    font-weight: 700;
    color: #2563eb; /* Biru Tema */
    text-transform: uppercase;
    letter-spacing: 2px;
    font-size: 0.9rem;
    margin-bottom: 25px;
}
.portal-title {
    font-weight: 600;
    color: #4b5563;
    font-size: 1rem;
    margin-bottom: 30px;
    text-transform: uppercase;
    border-bottom: 2px solid #e5e7eb;
    display: inline-block;
    padding-bottom: 5px;
}

/* Kotak Carian Putih */
.card-search {
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    border: 1px solid #f3f4f6;
    padding: 30px;
    margin-bottom: 30px;
    text-align: center;
    width: 100%;
}
.form-control-lg {
    border-radius: 10px;
    padding: 12px 15px;
    font-size: 1rem;
    border: 2px solid #e5e7eb;
    background-color: #f9fafb;
    text-align: center; 
    letter-spacing: 1px;
}
.form-control-lg:focus {
    border-color: #2563eb;
    background-color: white;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

/* Butang Semak & Reset */
.btn-custom {
    border-radius: 50px;
    padding: 10px 25px;
    font-weight: 600;
    font-size: 0.9rem;
    min-width: 130px;
    transition: all 0.2s;
}
.btn-semak {
    background-color: #2563eb;
    color: white;
    border: none;
}
.btn-semak:hover { background-color: #1d4ed8; transform: translateY(-2px); }
.btn-semak:active { transform: scale(0.95); }

.btn-reset {
    background-color: #e5e7eb;
    color: #374151;
    border: none;
}
.btn-reset:hover { background-color: #d1d5db; color: #111827; }
.btn-reset:active { transform: scale(0.95); }

/* Kad Hasil Semakan (Makan/PIBG) */
.card-result {
    border: none;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    height: 100%;
}
.header-result { font-weight: 700; text-align: center; padding: 15px; font-size: 0.9rem; letter-spacing: 1px; color: white; }
.bg-green { background-color: #10b981; }
.bg-red { background-color: #ef4444; }
.bg-info-custom { background-color: #f59e0b; color: #1f2937; }

.status-text { font-size: 1.5rem; font-weight: 800; margin: 15px 0; }
.text-green { color: #059669; }
.text-red { color: #dc2626; }
.text-info-custom { color: #d97706; }

.price-tag {
    background-color: #f3f4f6;
    padding: 10px;
    border-radius: 8px;
    margin-top: 15px;
    font-weight: 700;
}

/* =========================================
   3. ADMIN DASHBOARD (admin.php)
   ========================================= */
.container-fluid { flex: 1; }

/* --- [A] WARNA HEADER ATAS (NAVBAR) --- */
.navbar {
    background-color: #103962 !important; 
}

/* --- [B] KOTAK STATISTIK --- */
.card-stat { transition: transform 0.2s; border: none; }
.card-stat:hover { transform: translateY(-5px); }

/* Kotak Biru (Jumlah Murid) */
.card-stat.bg-primary { background-color: #3b82f6 !important; }

/* Kotak Hijau (Selesai Makan & PIBG) */
.card-stat.bg-success { background-color: #118ab2 !important; }

/* --- [C] KEPALA JADUAL --- */
thead th { 
    position: sticky; top: 0; 
    background-color: #103962 !important; 
    color: white; z-index: 10; font-size: 0.85rem; 
}

/* Scrollbar Jadual */
.table-responsive { max-height: 600px; overflow-y: auto; }

/* Senarai Nama & Butang */
.table-custom-font td { font-size: 0.8rem !important; vertical-align: middle; }
.table-custom-font .btn-sm { font-size: 0.75rem; padding: 2px 5px; }
.table-custom-font .badge { font-size: 0.7rem; }


/* =========================================
   4. KAWALAN BUTANG KHAS (BARU TAMBAH)
   ========================================= */

/* (1) Butang SIMPAN DATA */
button[name="simpan"] {
    background-color: #2563eb !important; /* Warna Asal: Biru */
    border-color: #2563eb !important;
    color: white !important;
}
button[name="simpan"]:hover {
    background-color: #1d4ed8 !important; /* Biru Gelap sikit bila hover */
}

/* (2) Badge INFO (Kuning) */
/* Ini untuk label "INFO" dalam jadual */
.badge.bg-warning {
    background-color: #ffc107 !important; /* Warna Asal: Kuning Amber */
    color: #000000 !important; /* Tulisan Hitam */
}

/* (3) Butang PILIHAN TINDAKAN (Dropdown) */
.btn-group .dropdown-toggle {
    background-color: #3b82f6 !important; /* Warna Asal: Biru Cerah */
    border-color: #3b82f6 !important;
    color: white !important;
}

/* (4) Butang HAPUS (Merah) */
/* Ini butang besar sebelah Pilihan Tindakan */
button[value="delete"] {
    background-color: #dc2626 !important; /* Warna Asal: Merah */
    border-color: #dc2626 !important;
    color: white !important;
}


/* =========================================
   5. RESPONSIVE (MOBILE)
   ========================================= */
@media (max-width: 576px) {
    .main-container { margin-top: 10px; padding: 15px; }
    .school-logo { width: 80px; margin-bottom: 10px; }
    .school-name { font-size: 1.1rem; }
    .class-name { font-size: 0.8rem; letter-spacing: 1px; margin-bottom: 20px; }
    .portal-title { font-size: 0.9rem; margin-bottom: 20px; }
    .card-search { padding: 25px 20px; }
    .btn-custom { width: 100%; margin-bottom: 5px; }
    .d-flex-buttons { flex-direction: column; }
}

@media (min-width: 577px) {
    .d-flex-buttons { flex-direction: row; justify-content: center; gap: 15px; }
}