/*
 * Graduate student portal theme — loaded after theme.css, by
 * templates/student/base.html.twig only. Everything is scoped under
 * body.student-portal, so the applicant and admin portals (gold crest
 * theme, theme.css) are untouched even though all three share the same
 * .hcu-* layout classes.
 */
.student-portal {
    --sp-forest: #114e37;         /* buttons */
    --sp-forest-dark: #0c3a29;    /* button hover/active */
    --sp-sidebar: #1b7e5a;        /* sidebar background, card accent borders */
    --sp-sidebar-hover: #1e8e66;  /* sidebar hover/open state */
    --sp-page: #F4F4F4;           /* canvas behind cards/panels */
    --sp-text: #333333;           /* default text */

    --bs-primary: var(--sp-forest);
    --bs-primary-rgb: 17, 78, 55;
    --bs-body-color: var(--sp-text);
    --bs-link-color: var(--sp-forest);
    --bs-link-color-rgb: 17, 78, 55;
    --bs-link-hover-color: var(--sp-sidebar);
    --bs-link-hover-color-rgb: 27, 126, 90;

    /* The canvas only. --bs-body-bg is left white on purpose: Bootstrap
       derives card, table and form-control backgrounds from it, and those
       are the panels that sit on this canvas. */
    background-color: var(--sp-page);
    color: var(--sp-text);
}

/* theme.css paints a gold-tinted crest image behind the content column. */
.student-portal .hcu-content::before {
    content: none;
}

/* ---- Buttons ---- */
.student-portal .btn-primary {
    --bs-btn-bg: var(--sp-forest);
    --bs-btn-border-color: var(--sp-forest);
    --bs-btn-hover-bg: var(--sp-forest-dark);
    --bs-btn-hover-border-color: var(--sp-forest-dark);
    --bs-btn-active-bg: var(--sp-forest-dark);
    --bs-btn-active-border-color: var(--sp-forest-dark);
    --bs-btn-disabled-bg: var(--sp-forest);
    --bs-btn-disabled-border-color: var(--sp-forest);
    --bs-btn-focus-shadow-rgb: 27, 126, 90;
    background-color: var(--bs-btn-bg);
    border-color: var(--bs-btn-border-color);
}

.student-portal .btn-primary:hover,
.student-portal .btn-primary:focus {
    background-color: var(--sp-forest-dark);
    border-color: var(--sp-forest-dark);
}

.student-portal .btn-outline-primary {
    --bs-btn-color: var(--sp-forest);
    --bs-btn-border-color: var(--sp-forest);
    --bs-btn-hover-bg: var(--sp-forest);
    --bs-btn-hover-border-color: var(--sp-forest);
    --bs-btn-active-bg: var(--sp-forest);
    --bs-btn-active-border-color: var(--sp-forest);
}

.student-portal .form-control:focus,
.student-portal .form-select:focus {
    border-color: var(--sp-sidebar);
    box-shadow: 0 0 0 .2rem rgba(27, 126, 90, .2);
}

/* ---- Sidebar ---- */
.student-portal .hcu-sidebar {
    background: var(--sp-sidebar);
    border-right: 0;
}

.student-portal .hcu-sidebar-brand,
.student-portal .hcu-sidebar-brand:hover,
.student-portal .hcu-sidebar-brand a {
    color: #fff;
    border-bottom-color: rgba(255, 255, 255, .18);
}

.student-portal .hcu-sidebar-brand img {
    width: 56px;
}

.student-portal .hcu-sidebar-identity {
    border-bottom-color: rgba(255, 255, 255, .18);
}

.student-portal .hcu-sidebar-avatar {
    background-color: rgba(255, 255, 255, .15);
    border-color: rgba(255, 255, 255, .6);
}

.student-portal .hcu-sidebar-avatar i,
.student-portal .hcu-sidebar-name,
.student-portal .hcu-sidebar-osn {
    color: #fff;
}

.student-portal .hcu-sidebar-avatar i {
    opacity: .85;
}

.student-portal .hcu-sidebar-osn {
    opacity: .85;
}

.student-portal .hcu-sidebar-links .nav-link {
    color: #fff;
}

.student-portal .hcu-sidebar-links .nav-link:hover,
.student-portal .hcu-sidebar-links .nav-link:focus-visible {
    background-color: var(--sp-sidebar-hover);
    color: #fff;
}

.student-portal .hcu-sidebar-links .nav-link.active {
    background-color: var(--sp-forest);
    color: #fff;
    font-weight: 700;
}

.student-portal .hcu-sidebar-footer {
    border-top-color: rgba(255, 255, 255, .18);
}

.student-portal .hcu-sidebar-footer .btn {
    color: #fff;
    border-color: rgba(255, 255, 255, .6);
}

.student-portal .hcu-sidebar-footer .btn:hover {
    background-color: var(--sp-sidebar-hover);
    border-color: #fff;
}

.student-portal .offcanvas.hcu-sidebar .btn-close {
    filter: invert(1) grayscale(100%) brightness(200%);
}

/* ---- Top bar / signed-out header ---- */
.student-portal .hcu-topbar-title {
    color: var(--sp-forest);
}

.student-portal .navbar-hcu {
    background: var(--sp-sidebar);
    border-bottom: 4px solid var(--sp-forest);
}

.student-portal .navbar-hcu .navbar-brand,
.student-portal .hcu-header-contact a {
    color: #fff;
}

.student-portal .navbar-hcu .navbar-brand img {
    width: 64px;
}

.student-portal .hcu-header-contact a:hover {
    color: #fff;
    text-decoration: underline !important;
}

/* ---- Cards / panels ---- */
.student-portal .card {
    border: 0;
    border-top: 3px solid var(--sp-sidebar);
    box-shadow: 0 1px 3px rgba(0, 0, 0, .08);
    color: var(--sp-text);
}

.student-portal .card-hcu-header {
    background-color: #fff;
    color: var(--sp-forest);
    border-bottom: 1px solid #e9ecef;
    border-radius: 0;
}

.student-portal .hcu-form-section-title {
    color: var(--sp-forest);
}

.student-portal .sp-page-title {
    color: var(--sp-forest);
    font-weight: 700;
}

/* Dashboard figures */
.sp-stat {
    border-left: 4px solid var(--sp-sidebar);
    background: #fff;
    border-radius: .375rem;
    padding: 1rem 1.1rem;
    height: 100%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .08);
}

.sp-stat-label {
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: #6c757d;
    font-weight: 700;
}

.sp-stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--sp-forest);
    line-height: 1.25;
    overflow-wrap: anywhere;
}

.sp-stat-value.is-owing {
    color: #b02a37;
}

.sp-stat-note {
    font-size: .8rem;
    color: #6c757d;
}

/* Read-only label/value pairs (profile) */
.sp-field-label {
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: #6c757d;
    font-weight: 700;
    margin-bottom: .1rem;
}

.sp-field-value {
    overflow-wrap: anywhere;
}

.sp-profile-photo {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--sp-sidebar);
    background: #e9ecef;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.6rem;
    color: #adb5bd;
    flex-shrink: 0;
}

/* Tables */
.student-portal .table thead th {
    background-color: var(--sp-forest);
    color: #fff;
    font-size: .78rem;
    text-transform: uppercase;
    letter-spacing: .03em;
    white-space: nowrap;
}

.student-portal .table {
    --bs-table-color: var(--sp-text);
    margin-bottom: 0;
}

.sp-table-totals td {
    font-weight: 700;
    background-color: #f8f9fa;
}

.sp-amount {
    text-align: right;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.sp-amount.is-owing {
    color: #b02a37;
}

.sp-term-heading {
    font-size: .9rem;
    font-weight: 700;
    color: var(--sp-forest);
    text-transform: uppercase;
    letter-spacing: .03em;
}

.sp-term-heading.is-resit {
    color: #b02a37;
}

.student-portal footer.hcu-footer {
    color: #6c757d;
}
