/* ============================================================
   GLOBAL DARK/LIGHT THEME – KOLEJ MATRIKULASI SELANGOR (KMS)
   ============================================================ */

/* 🎨 DEFAULT (DARK THEME) */
:root {
    --bg: #0b1020;
    --card: #0f1724;
    --muted: #9aa4b2;
    --primary: #1e88e5;
    --accent: #4CAF50;
    --danger: #dc3545;
    --warning: #ffc107;
    --text: #e6eef6;
    --glass: rgba(255,255,255,0.08);
    --shadow: 0 6px 18px rgba(0,0,0,0.45);
}

/* 🎨 LIGHT THEME OVERRIDE */
body.light-theme {
    --bg: #f4f6fb !important;
    --card: #ffffff !important;
    --muted: #6b7280 !important;
    --primary: #0d47a1 !important;
    --accent: #18803b !important;
    --danger: #dc3545 !important;
    --warning: #ffc107 !important;
    --text: #111827 !important;
    --glass: rgba(0,0,0,0.1) !important;
    --shadow: 0 4px 15px rgba(0,0,0,0.1) !important;
}


/* ============================================================
   GLOBAL BODY
   ============================================================ */
html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--text);
    font-family: "Poppins", system-ui, Arial, sans-serif;
    transition: background 0.3s, color 0.3s;
}

/* Wrapper Dashboard */
.pelajar-dashboard {
    max-width: 1300px;
    margin: 30px auto;
    padding: 20px;
}

/* ============================================================
   PROFILE
   ============================================================ */
.profile-card {
    background: var(--card);
    border-radius: 14px;
    padding: 25px 30px;
    border: 1px solid var(--glass);
    box-shadow: var(--shadow);
}

.profile-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.profile-img {
    width: 92px;
    height: 92px;
    border-radius: 100px;
    border: 4px solid var(--primary);
    object-fit: cover;
}

.muted { color: var(--muted); }

/* ============================================================
   THEME TOGGLE
   ============================================================ */
.theme-toggle {
    background: var(--glass);
    color: var(--text);
    border: none;
    padding: 10px 12px;
    border-radius: 10px;
    cursor: pointer;
}

/* ============================================================
   CARD
   ============================================================ */
.card {
    background: var(--card);
    padding: 20px;
    border-radius: 14px;
    border: 1px solid var(--glass);
    box-shadow: var(--shadow);
    transition: background 0.3s;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
    padding: 8px 14px;
    border-radius: 10px;
    background: transparent;
    border: 1px solid var(--glass);
    color: var(--text);
    font-weight: 600;
    text-decoration: none;
}
.btn.primary {
    background: var(--primary);
    border: none;
    color: #fff;
}

/* ============================================================
   TABLE
   ============================================================ */
.table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
    background: var(--card);
}

.table th {
    padding: 10px;
    font-size: 13px;
    color: var(--muted);
    border-bottom: 2px solid var(--glass);
}

.table td {
    padding: 10px;
    border-bottom: 1px solid var(--glass);
}

/* ============================================================
   FORM ELEMENTS
   ============================================================ */
input, textarea, select {
    background: var(--card);
    color: var(--text);
    border: 1px solid var(--glass);
    padding: 8px;
    border-radius: 8px;
}
input::placeholder {
    color: var(--muted);
}

/* ============================================================
   LIGHT THEME FORM FIX
   ============================================================ */
body.light-theme input,
body.light-theme textarea,
body.light-theme select {
    background: #ffffff !important;
    color: #000 !important;
    border: 1px solid #c7cde0 !important;
}

body.light-theme input::placeholder {
    color: #666 !important;
}

body.light-theme .table {
    background: #fff !important;
}
body.light-theme .table th {
    background: #e7efff !important;
    color: #002b80 !important;
}
body.light-theme .table td {
    color: #000 !important;
}

body.light-theme .card {
    background: #ffffff !important;
    border: 1px solid #dbe3f5 !important;
}

body.light-theme .alert {
    background: #eef4ff !important;
    color: #002b80 !important;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
    .profile-header { flex-direction: column; text-align: center; }
    .profile-main { flex-direction: column; }
    .table { min-width: 600px; }
}
