:root {
    --primary: #1a237e;
    --secondary: #3949ab;
    --bg-gray: #f4f7f6;
    --sidebar-w: 260px;
    --text-dark: #2c3e50;
}

body.portal-body {
    margin: 0;
    font-family: 'Segoe UI', Tahoma, sans-serif;
    background: var(--bg-gray);
    color: var(--text-dark);
}

/* TOP NAV */
.top-nav {
    height: 70px;
    background: var(--primary);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 30px;
    position: sticky;
    top: 0; z-index: 1000;
}
.nav-brand { display: flex; align-items: center; gap: 15px; font-size: 1.2rem; font-weight: bold; }
.nav-brand img { height: 45px; background: white; border-radius: 50%; padding: 2px; }
.logout-btn { color: white; text-decoration: none; padding: 8px 15px; border: 1px solid white; border-radius: 4px; transition: 0.3s; }
.logout-btn:hover { background: white; color: var(--primary); }

/* WRAPPER */
.main-wrapper { display: flex; min-height: calc(100vh - 70px); }

/* SIDEBAR */
.sidebar {
    width: var(--sidebar-w);
    background: white;
    border-right: 1px solid #ddd;
    padding-top: 30px;
}
.sidebar ul { list-style: none; padding: 0; margin: 0; }
.sidebar li a {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 30px;
    color: #555;
    text-decoration: none;
    font-weight: 500;
}
.sidebar li.active a {
    background: #eef2ff;
    color: var(--primary);
    border-right: 5px solid var(--primary);
}

/* CONTENT */
.content-area { flex: 1; padding: 40px; }
.form-container-card {
    background: white;
    padding: 50px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
}

/* HEADER */
.official-header { border-bottom: 2px solid var(--primary); margin-bottom: 40px; padding-bottom: 20px; }
.header-flex { display: flex; justify-content: space-between; align-items: center; }
.u-logo { height: 100px; }
.u-text { text-align: center; }
.u-text h1 { color: var(--primary); margin: 0; font-size: 2rem; font-family: 'Times New Roman', serif; }
.form-badge { background: var(--primary); color: white; padding: 5px 20px; border-radius: 50px; font-size: 0.8rem; margin-top: 10px; display: inline-block; }
.office-box { border: 1px solid #ccc; padding: 10px; font-size: 0.8rem; border-radius: 4px; }

/* INPUTS */
.section-heading {
    background: #f8fafc;
    border-left: 5px solid var(--primary);
    padding: 12px 20px;
    color: var(--primary);
    margin: 30px 0 20px 0;
}
.grid-row { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; margin-bottom: 20px; }
.trio { grid-template-columns: 1fr 1fr 1fr; }
.full-width { grid-column: span 2; }
.form-group label { display: block; margin-bottom: 8px; font-weight: 600; color: #666; font-size: 0.9rem; }
.portal-input { width: 100%; padding: 12px; border: 1px solid #cbd5e1; border-radius: 6px; box-sizing: border-box; }
.uppercase { text-transform: uppercase; }

/* TABLES */
.portal-table { width: 100%; border-collapse: collapse; margin-top: 10px; border: 1px solid #eee; }
.portal-table th { background: var(--primary); color: white; padding: 12px; text-align: left; font-size: 0.85rem; }
.portal-table td { border-bottom: 1px solid #eee; }
.table-field { width: 100%; border: none; padding: 12px; box-sizing: border-box; outline: none; }
.table-field-grey { background: #f1f5f9; font-weight: bold; color: #555; }

/* BUTTONS */
.btn-add { background: white; color: var(--primary); border: 1px dashed var(--primary); padding: 8px 15px; border-radius: 4px; cursor: pointer; margin-top: 10px; }
.submit-all-btn {
    width: 100%;
    background: linear-gradient(to right, var(--primary), var(--secondary));
    color: white; padding: 20px; border: none; border-radius: 8px;
    font-size: 1.3rem; font-weight: bold; cursor: pointer; margin-top: 50px;
}

    /* Table Styling */
    .portal-table {
        width: 100%;
        border-collapse: collapse; /* Merges borders into single lines */
        margin-bottom: 15px;
        background: white;
        font-size: 14px;
    }

    /* Headings */
    .portal-table th {
        background-color: #0c1c44; /* UMW Dark Blue */
        color: white;
        padding: 10px;
        text-align: left;
        border: 1px solid #000; /* Sharp border for headers */
        font-weight: 600;
    }

    /* Cells */
    .portal-table td {
        border: 1px solid #333; /* Visible dark border for cells */
        padding: 0; /* Remove padding so input fills the whole cell */
        margin: 0;
    }

    /* Inputs inside cells */
    .table-field {
        width: 100%;
        border: none; /* Remove default input border */
        padding: 8px 5px;
        box-sizing: border-box; /* Ensures padding doesn't break width */
        font-family: inherit;
        outline: none; /* Removes blue outline on click */
        background: transparent;
    }

    /* Input Focus State */
    .table-field:focus {
        background-color: #e8f0fe; /* Light blue background when typing */
    }

    /* Readonly fields (like Degree Titles) */
    .table-field-grey {
        width: 100%;
        border: none;
        padding: 8px 5px;
        box-sizing: border-box;
        background-color: #f0f0f0; /* Grey background */
        font-weight: bold;
        color: #333;
    }

    /* Button Styling */
    .btn-add {
        background-color: #28a745;
        color: white;
        border: none;
        padding: 8px 15px;
        border-radius: 4px;
        cursor: pointer;
        font-size: 13px;
        margin-bottom: 20px;
    }
    .btn-add:hover { background-color: #218838; }

    /* Section Headings */
    .section-heading {
        background: #eee;
        padding: 10px;
        border-left: 5px solid #0c1c44;
        margin-top: 20px;
        margin-bottom: 15px;
        color: #0c1c44;
        font-weight: bold;
    }

    /* Declaration Box */
    .declaration-box {
        border: 1px solid #ccc;
        padding: 15px;
        background: #f9f9f9;
        margin-bottom: 20px;
    }
    .decl-row {
        display: flex;
        justify-content: space-between;
        align-items: center;
        border-bottom: 1px dashed #ddd;
        padding-bottom: 5px;
        margin-bottom: 5px;
    }
    .opt-group label { margin-left: 10px; cursor: pointer; }
    
