/* ==========================================================
   STUDENT PROFILE VIEW
   ========================================================== */

/* ==========================================================
   HEADER
   ========================================================== */

.student-view-header h1 {
    margin: 0;
    font-size: 1.6rem;
    font-weight: 600;
}

/* ==========================================================
   ACTION BUTTONS
   ========================================================== */

.page-actions {
    display: flex;
    gap: 10px;
}

.page-actions .toolbar-btn {
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    border: 1px solid transparent;
    background: #fff;
    color: #111;
    cursor: pointer;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    transition:
            background-color 0.15s ease,
            border-color 0.15s ease,
            box-shadow 0.15s ease;
}

.page-actions .toolbar-btn.back-btn {
    background: #f8f8f8;
    border-color: #ccc;
    color: #444;
}

.page-actions .toolbar-btn:hover {
    background: #f0f0f0;
    border-color: #999;
}

.page-actions .toolbar-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.card-title--with-action {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.card-title--with-action .btn {
    background: #f8f8f8;

}

/* ==========================================================
   TOOLBAR BUTTON – ICON VARIANT
   ========================================================== */

.toolbar-btn--icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.toolbar-btn--icon img {
    display: block;
    opacity: 0.4;
}

.toolbar-btn--icon:hover img {
    opacity: 1;
}

/* ==========================================================
   TOOLBAR BUTTON – INLINE VARIANT
   ========================================================== */

.toolbar-btn--inline {
    padding: 6px 12px;
    font-size: 0.85rem;
    border-radius: 6px;

    background: #f8f8f8;
    border: 1px solid #ddd;
    color: #444;
}

.toolbar-btn--inline:hover {
    background: #f0f0f0;
    border-color: #bbb;
}

/* ==========================================================
   GRID & CARDS
   ========================================================== */

.student-view-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-top: 24px;
}

.card-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 14px;
    padding-bottom: 6px;
    border-bottom: 1px solid #e0e0e0;
}

/* ==========================================================
   KEY–VALUE GRID
   ========================================================== */

.kv {
    display: grid;
    grid-template-columns: 140px 1fr;
    row-gap: 10px;
    column-gap: 12px;
}

.kv .k {
    color: #666;
    font-size: 0.85rem;
}

.kv .v {
    font-weight: 500;
    margin-left: 3px;
    font-size: 0.9rem;
    line-height: 20px;
}

/* ==========================================================
   INLINE EDITABLE FIELDS
   ========================================================== */

.student-inline-input {
    width: 100%;
    max-width: 260px;

    box-sizing: border-box;
    height: 32px;
    line-height: 20px;

    padding: 6px 8px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;

    background: #fafafa;
    font-size: 0.9rem;
    font-weight: 500;

    cursor: pointer;
}

.student-inline-input:hover {
    background: #fff;
    border-color: #bbb;
}

.student-inline-input.editing {
    background: #fff;
    border-color: #888;
    cursor: text;
    box-shadow: 0 0 0 2px rgba(0,0,0,0.04);
}

/* ---------- SELECT NORMALIZATION ---------- */

select.student-inline-input {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;

    padding-right: 28px;

    background-image:
            linear-gradient(45deg, transparent 50%, #666 50%),
            linear-gradient(135deg, #666 50%, transparent 50%);
    background-position:
            calc(100% - 14px) 14px,
            calc(100% - 9px) 14px;
    background-size: 5px 5px;
    background-repeat: no-repeat;
}

/* ==========================================================
   INLINE FIELD ERRORS
   ========================================================== */

.field-error {
    border-color: #c62828 !important;
    background: #fff5f5;
}

.inline-error {
    grid-column: 2 / 3;
    margin-top: 4px;
    font-size: 0.8rem;
    color: #c62828;
}

/* ==========================================================
   STATUS BADGE
   ========================================================== */

.account-state {
    text-align: left;
}

.account-state .badge {
    cursor: pointer;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-active {
    background: #e6f6ec;
    color: #1b7f4a;
}

.badge-inactive {
    background: #fdeaea;
    color: #a12622;
}

/* ==========================================================
   COMMENTS
   ========================================================== */

.student-comments-card {
    margin-top: 24px;
}

.student-comments {
    width: 100%;
    min-height: 120px;
    resize: vertical;

    padding: 12px 14px;
    font-family: inherit;
    font-size: 0.9rem;
    line-height: 1.4;

    background: #fafafa;
    border: 1px solid #ddd;
    border-radius: 8px;

    cursor: pointer;
}

.student-comments.editing {
    background: #fffef5;
    border-color: #bbb;
    cursor: text;
}

/* ==========================================================
   ENROLLMENT HISTORY
   ========================================================== */

.admin-table thead {
    background: #aaaaaa;
}

#historyCard {
    margin-top: 32px;
}

.collapsible-title {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.collapsible-title .chevron {
    font-size: 0.85rem;
    color: #666;
    transition: transform 0.2s ease;
}

#historyCard:not(.collapsed) .chevron {
    transform: rotate(180deg);
}

#historyCard.collapsed .table-wrapper {
    display: none;
}

.back-link {
    display: inline-block;
    margin-bottom: 6px;
    font-size: 13px;
    color: #555;
    text-decoration: none;
}

.back-link:hover {
    text-decoration: underline;
}


/* ==========================================================
   MODAL – GENERIC (ADD ENROLLMENT)
   ========================================================== */

/* ---------- Visibility ---------- */

.modal.hidden {
    display: none;
}

/* ---------- Overlay container ---------- */

.modal {
    position: fixed;
    inset: 0;
    z-index: 2000;
}

/* ---------- Backdrop ---------- */

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
}

/* ---------- Dialog ---------- */

.modal-dialog {
    position: relative;
    z-index: 1;

    width: 100%;
    max-width: 520px;
    margin: 10vh auto;

    background: #fff;
    border-radius: 12px;

    box-shadow:
            0 10px 30px rgba(0,0,0,0.25),
            0 2px 8px rgba(0,0,0,0.15);

    animation: modal-in 0.18s ease-out;
}

/* ---------- Animation ---------- */

@keyframes modal-in {
    from {
        transform: translateY(-8px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* ==========================================================
   MODAL HEADER
   ========================================================== */

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;

    padding: 14px 18px;
    border-bottom: 1px solid #e0e0e0;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 600;
    color: #111;
}

.modal-close {
    border: none;
    background: transparent;
    font-size: 1.2rem;
    cursor: pointer;
    color: #666;
}

.modal-close:hover {
    color: #000;
}

/* ==========================================================
   MODAL BODY
   ========================================================== */

.modal-body {
    padding: 18px;
}

/* ---------- Form layout ---------- */

.form-grid {
    display: grid;
    grid-template-columns: 140px 1fr;
    column-gap: 14px;
    row-gap: 12px;
}

.form-row {
    display: contents;
}

.form-row label {
    font-size: 0.85rem;
    color: #666;
    align-self: center;
}

/* ---------- Inputs ---------- */

.modal-body select,
.modal-body input[type="text"],
.modal-body input[type="date"] {
    height: 32px;
    padding: 6px 8px;

    font-size: 0.9rem;
    font-weight: 500;

    border: 1px solid #ddd;
    border-radius: 6px;
    background: #fafafa;
}

.modal-body select:hover,
.modal-body input:hover {
    background: #fff;
    border-color: #bbb;
}

.form-readonly {
    height: 32px;
    line-height: 32px;
    padding: 0 8px;

    background: #f5f5f5;
    border: 1px solid #e0e0e0;
    border-radius: 6px;

    font-size: 0.9rem;
    font-weight: 500;
    color: #444;
}

/* ==========================================================
   MODAL – FORM ERROR (ADD ENROLLMENT)
   ========================================================== */


.form-error {
    animation: fade-in 0.15s ease-out;
    margin-top: 14px;
    padding: 10px 12px;

    border: 1px solid #d32f2f;
    border-radius: 6px;

    background: #fff5f5;
    color: #b71c1c;

    font-size: 0.85rem;
    font-weight: 500;
    line-height: 1.4;
}

@keyframes fade-in {
    from {
        opacity: 0;
        transform: translateY(-2px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.form-error.hidden {
    display: none;
}


/* ==========================================================
   MODAL FOOTER
   ========================================================== */

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;

    padding: 12px 18px;
    border-top: 1px solid #e0e0e0;
}

.modal-footer .btn {
    padding: 6px 12px;
    font-size: 0.85rem;
    border-radius: 6px;
    background: #f8f8f8;
    border: 1px solid #ddd;
}

.modal-footer .btn:hover {
    background: #f0f0f0;
    border-color: #bbb;

}