﻿/* ==========================================================================
   1. CORE RESET & BRAND VARIABLES
   ========================================================================== */
:root {
    --ucsb-navy: #003660;
    --ucsb-gold: #FEB81D;
    --ucsb-coral: #C43424;
    --text-slate: #3D4952;
    --bg-clay: #F1EEEA;
    --font-main: "Nunito Sans", sans-serif;
}

html {
    box-sizing: border-box;
    -webkit-text-size-adjust: 100%;
}

*, *:before, *:after {
    box-sizing: inherit;
}

body, h1, h2, h3, h4, p, ul, ol, li {
    margin: 0;
    padding: 0;
}

/* FORCE THE PAGE TO STAY STILL */
html, body {
    max-width: 100%;
    overflow-x: hidden; /* This kills the 'Blank Area' shift on the whole site */
    overflow-y: hidden; /* This kills the 'Blank Area' shift on the whole site */
    position: relative;
}

/* ==========================================================================
   2. GLOBAL TYPOGRAPHY (UCSB BRAND CONSISTENCY)
   ========================================================================== */
body {
    background-color: var(--bg-clay);
    color: var(--text-slate);
    font-family: var(--font-main);
    font-weight: 400;
    font-size: 1.05rem;
    line-height: 1.55;
}

h1 {
    font-family: var(--font-main);
    font-weight: 800;
    color: var(--ucsb-navy);
    font-size: 2rem;
    margin-bottom: 1.25rem;
    letter-spacing: -0.01em;
    line-height: 1.2;
}

h2, h3, h4 {
    font-family: var(--font-main);
    font-weight: 700;
    color: var(--ucsb-navy);
    margin-top: 1.75rem;
    margin-bottom: 0.75rem;
}

p {
    margin-bottom: 1rem; /* Tightened paragraph spacing */
}

i {
    vertical-align: middle; /* aligns icon with text baseline */
    margin-right: 0.4em; /* space between icon and text */
    font-size: 1em; /* matches text size */
}

/* Target the inputs themselves */
input[type="checkbox"],
input[type="radio"] {
    cursor: pointer !important;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ==========================================================================
   3. NAVIGATION (Adaptive Grid/Row with JS Toggle)
   ========================================================================== */
.site-nav {
    background-color: var(--ucsb-navy) !important;
    width: 100%;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.nav-container {
    max-width: 1300px;
    margin: 0 auto;
    padding: 0;
    display: flex;
    align-items: center;
}

/* Toggle Button Styling */
.nav-toggle-btn {
    display: none; /* Hidden on Desktop */
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 15px 20px;
    margin-left: auto; /* Pushes the button to the far right */
}

    .nav-toggle-btn .bar {
        display: block;
        width: 25px;
        height: 3px;
        background: white;
        margin: 4px 0;
        border-radius: 3px;
    }

.nav-logo {
    display: inline-block;
    padding-left: 20px;
    padding-right: 40px;
}

    .nav-logo img {
        height: 28px;
        width: auto;
        display: inline-block;
    }

/* ==========================================================================
   4. MASTER LAYOUT (Pinned Header/Footer Logic)
   ========================================================================== */
.master-wrapper {
    display: flex;
    flex-direction: column;
    height: 100vh; /* Exactly fill the screen height */
    overflow: hidden; /* Prevent body-level scrolling */
}

.main-content {
    flex: 1; /* Grow to fill all space between header and footer */
    display: flex;
    flex-direction: column;
    overflow-y: auto; /* Enable scroll only for the content area */
    background-color: var(--bg-clay);
}

.content-container {
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    padding: 0 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Site Footer */
.site-footer {
    flex-shrink: 0;
    background-color: #ffffff;
    border-top: 1px solid #e9ecef;
    /* Reduced from 1.5rem to 0.6rem for a slim profile */
    padding: 0.85rem 1rem;
    box-shadow: 0 -1px 3px rgba(0, 0, 0, 0.05);
}

.footer-container {
    display: flex;
    justify-content: center;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    /* Reduced gap for a tighter look */
    gap: 20px;
}

.footer-logo img {
    /* Slightly smaller logo to fit the slimmer padding */
    height: 40px;
    width: auto;
    display: block;
}

.footer-info {
    text-align: center;
    border-left: 1px solid #dee2e6;
    /* Reduced from 30px to 20px to match the slim vibe */
    padding-left: 20px;
}

.copyright-text {
    margin-bottom: 2px;
    color: var(--ucsb-navy);
    font-size: 0.8rem; /* Scaled down slightly */
}

.footer-links {
    font-size: 0.75rem; /* Scaled down slightly */
}

@media (max-width: 768px) {
    .footer-container {
        flex-direction: column;
        gap: 10px;
    }

    .footer-info {
        text-align: center;
        border-left: none;
        padding-left: 0;
    }
}


/* ==========================================================================
   5. DASHBOARD GRID & CARDS
   ========================================================================== */
.section-common-gap {
    /* 2.5rem (~40px) top padding ensures a fixed gap from the Navbar */
    /* 1.5rem (~24px) bottom padding creates space before the grid/content */
    padding: 2.5rem 0 1.5rem 0;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
    margin-bottom: 3rem;
}

.dashboard-card {
    background: #FFFFFF;
    border-left: 5px solid var(--ucsb-navy);
    padding: 1.5rem;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    flex-direction: column;
}

.card-title {
    font-weight: 800 !important;
    font-size: 1.25rem;
    color: var(--ucsb-navy) !important;
    text-decoration: none !important;
    display: block;
    margin-bottom: 0.75rem;
}

    .card-title:hover {
        text-decoration: underline !important;
    }

.info-message {
    font-size: 0.9rem;
    font-style: italic;
    color: #555;
    padding-top: 12px;
    margin-top: auto;
    border-top: 1px dashed #ddd;
}

.notice-box {
    background-color: #FFF9E6; /* Soft Cream/Gold */
    border: 1px solid #E6D5A3; /* Muted Gold border */
    padding: 1.5rem;
    margin-top: 2rem;
    text-align: left;
}

    .notice-box p {
        margin-bottom: 0.5rem;
        font-size: 1rem;
        color: var(--text-slate);
    }

/* ==========================================================================
   6. LOGIN CARD (Centered in Master Page)
   ========================================================================== */
.login-page-wrapper {
    display: flex;
    flex: 1;
    justify-content: center;
    align-items: center; /* Puts the card in the vertical middle */
    /*padding: 40px 20px;*/
    /* 1. Use the 3rd padding value (Bottom) to push the box UP */
    /* 40px Top | 20px Right | 15vh Bottom | 20px Left */
    padding: 40px 20px 15vh;
    /* 2. Optional: Pull it slightly left as you wanted before */
    padding-right: 5vw;
    box-sizing: border-box;
}

.login-card {
    background: #FFFFFF;
    max-width: 600px;
    width: 100%;
    padding: 3rem;
    border-left: 8px solid var(--ucsb-navy);
    box-shadow: 0 10px 25px rgba(0,0,0,0.05);
}

.login-card-header {
    text-align: center;
    margin-bottom: 2rem;
}

    .login-card-header h1 {
        font-size: 1.85rem;
        margin-bottom: 0.5rem;
    }

/* SSO Button Styling */
.btn-sso-main {
    background-color: var(--ucsb-navy) !important;
    color: #FFFFFF !important;
    /* Use 'em' for padding so it scales proportionally with the font-size */
    padding: 0.8em 2em !important;
    font-family: var(--font-main) !important;
    font-weight: 700 !important;
    border: none !important;
    cursor: pointer !important;
    text-transform: uppercase !important;
    letter-spacing: 1px;
    /* Smooth transition for the hover effect */
    transition: background-color 0.2s ease, transform 0.1s ease, box-shadow 0.2s ease;
    /* Default: Mobile-first sizing */
    width: 100% !important;
    max-width: 400px;
    min-width: 220px;
    font-size: 1rem !important;
    display: inline-flex;
    text-align: center;
}

    .btn-sso-main:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 8px rgba(0,0,0,0.15);
        filter: brightness(1.15);
    }

.login-action {
    display: flex;
    justify-content: center;
    padding-bottom: 2.5rem;
}

.login-instructions {
    border-top: 1px solid #F0F0F0;
    padding-top: 2rem;
    font-size: 1rem;
    line-height: 1.7;
}

.system-metadata-block {
    margin-top: 3rem;
    padding-top: 1.5rem;
    border-top: 1px solid #F0F0F0;
    font-size: 0.75rem;
    color: var(--ucsb-navy);
    text-align: center;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.user-message-box:not(:empty) {
    margin-top: 1.5rem;
    padding: 1rem;
    background-color: #FFF5F5;
    border-left: 4px solid var(--ucsb-coral);
    color: #C53030;
}

/* ==========================================================================
   7. Misc
   ========================================================================== */
.MenuCurrent {
    background-color: var(--ucsb-gold) !important;
    color: var(--ucsb-navy) !important;
}

/* ==========================================================================
   8. TUTORIAL GROUPS PAGE STYLES (ENHANCED VERSION)
   ========================================================================== */
.info-summary {
    background-color: #fff;
    border-left: 6px solid var(--ucsb-gold);
    padding: 1.5rem;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

.info-grid {
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
}

.info-icon {
    color: var(--ucsb-gold);
    margin-right: 8px;
    font-size: 1.1rem;
}

.label-title {
    font-weight: 800;
    color: var(--ucsb-navy);
    margin-right: 5px;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.label-text {
    color: #444;
    font-weight: 600;
}

.instruction-text {
    margin-top: 15px;
    font-weight: 700;
    color: var(--ucsb-navy);
    border-top: 1px solid #f0f0f0;
    padding-top: 12px;
    font-size: 0.95rem;
}


/* --------------------------------------------------------------------------
   Table Enhancements (FIXED)
   -------------------------------------------------------------------------- */
.table-card {
    display: block !important;
    width: 100% !important;
    max-width: 100vw !important;
    overflow-x: auto !important;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-gutter: stable;
}

/* CRITICAL FIX */
.clas-styled-table {
    width: 100%;
    border-collapse: collapse;
    /* FIX: Force a wide min-width so the internal scroll activates */
    min-width: 900px;
    table-layout: auto;
}

    .clas-styled-table caption {
        padding: 12px;
        font-size: 0.85rem;
        color: var(--ucsb-navy);
        font-style: italic;
        text-align: left;
    }

.GroupScheduleHeaderStyle th {
    background: var(--ucsb-navy);
    color: #FFFFFF;
    padding: 18px 15px;
    text-align: left;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
    white-space: nowrap;
}

.GroupScheduleItemStyle td {
    padding: 15px;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.2s ease;
    vertical-align: middle;
}

.course-name-cell {
    color: var(--ucsb-navy);
    font-size: 1.05rem;
    white-space: normal;
}

.location-cell {
    font-size: 0.9rem;
    line-height: 1.4;
    color: #555;
    min-width: 180px;
}

.GroupScheduleItemStyle:hover {
    background-color: #f8faff;
    /* FIX: Use inset with 0 spread to prevent layout shifting on hover */
    box-shadow: inset 4px 0 0 0 var(--ucsb-gold) !important;
}

/* Status Badges (Refined) */
.cancel-badge, .active-badge, .neutral-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    display: inline-block;
}

.cancel-badge {
    background-color: #fee2e2;
    border: 1px solid var(--ucsb-coral);
    color: #b91c1c;
}

.active-badge {
    background-color: #dcfce7;
    border: 1px solid #22c55e;
    color: #15803d;
}

.neutral-badge {
    background-color: #f1f5f9; /* Soft Gray */
    border: 1px solid #cbd5e1; /* Medium Gray Border */
    color: #000000; /* Black Font */
}

.action-section {
    margin: 25px 0;
}
/* Buttons & Actions */
.btn-group-row {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important; /* Force items to stay on one line on large screens */
    gap: 12px;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
}

.btn-narrow {
    width: auto !important;
    min-width: 120px;
    white-space: nowrap; /* Prevents button text from breaking into 2 lines */
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    text-transform: none !important;
}

.btn-coral {
    background-color: var(--ucsb-coral) !important;
}

.btn-gold {
    background-color: var(--ucsb-gold) !important;
    color: var(--ucsb-navy) !important;
}

.is-hidden {
    display: none !important; /* Removes from layout and visual view */
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important; /* Prevents clicks even if display is forced */
}

/* Blurb/Instruction List */
.blurb-container {
    background: #f9fafb;
    padding: 20px;
    border: 1px solid #e5e7eb;
}

.blurb {
    margin-bottom: 12px;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 10px;
    border: none;
    padding: 0;
}

.blurb-icon {
    color: #9ca3af;
    font-size: 1rem;
}

.blurb:last-child {
    margin-bottom: 0;
}

/* Empty State */
.empty-state {
    padding: 50px;
    text-align: center;
    color: var(--ucsb-navy);
}

.empty-icon {
    font-size: 3rem;
    margin-bottom: 15px;
    opacity: 0.3;
}

/* Global helper */
.font-bold {
    font-weight: 700;
}

.text-center {
    text-align: center;
}

/* Alert Box Container */
.alert-container {
    display: flex;
    align-items: flex-start;
    padding: 16px 20px;
    margin: 20px 0;
    text-align: left;
    border: 1px solid;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

/* Danger/Error Specific Style */
.alert-danger {
    background-color: #fef2f2; /* Light Red background */
    border-color: #fecaca; /* Soft Red border */
    border-left: 5px solid #dc2626; /* Thick Red accent on the left */
}

.alert-content {
    flex: 1;
}

/* The Main Error Label */
.alert-title {
    display: block;
    font-size: 1.1rem;
    font-weight: 700;
    color: #991b1b; /* Deep Red for readability */
    margin-bottom: 8px;
}

/* The Instructional Text */
.alert-action-text {
    font-size: 0.95rem;
    color: #b91c1c; /* Medium Red */
    line-height: 1.5;
}

    /* Ensuring the Link stands out */
    .alert-action-text a {
        color: #1e3a8a; /* Blue for the link to make it clickable/visible */
        text-decoration: underline;
        font-weight: 600;
    }

/* Alert Content Styling */
.alert-text {
    display: block;
    font-size: 0.95rem;
    color: #b91c1c; /* Medium Red */
    margin-top: 5px;
    line-height: 1.4;
}

.alert-action-block {
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid rgba(220, 38, 38, 0.1); /* Subtle red divider */
    font-weight: 700;
    color: #991b1b;
    font-size: 0.95rem;
    line-height: 1.5;
}

/* Ensure icons align with the top of the text */
.alert-icon {
    color: #dc2626;
    font-size: 1.25rem;
    margin-right: 15px;
    margin-top: 2px;
}


/* ==========================================================================
   COMPACT PRINT ACTION CARD
   ========================================================================== */

.action-card.print-verification {
    background-color: #f8fafc; /* Neutral light slate */
    border-left: 5px solid #16a34a; /* Thick green accent on the side */
    border-top: 1px solid #e2e8f0;
    border-right: 1px solid #e2e8f0;
    border-bottom: 1px solid #e2e8f0;
    padding: 16px 20px;
    margin: 20px 0;
    display: flex;
    align-items: center;
    justify-content: space-between; /* Pushes button to the right */
    gap: 20px;
}

.action-content {
    flex: 1; /* Takes up remaining space */
}

.action-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px; /* Tighter spacing */
}

    .action-header h2 {
        margin: 0;
        color: #15803d; /* Dark Success Green */
        font-size: 1rem;
        font-weight: 700;
        letter-spacing: 0.5px;
    }

.main-instruction {
    font-size: 0.95rem;
    color: #334155;
    margin: 0;
    line-height: 1.4;
}

.print-button {
    display: inline-flex;
    align-items: center;
    background-color: #16a34a;
    color: #ffffff !important;
    padding: 8px 16px;
    text-decoration: none !important;
    font-weight: 600;
    font-size: 0.9rem;
    white-space: nowrap; /* Prevents button text wrapping */
    transition: all 0.2s;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

    .print-button:hover {
        background-color: #15803d;
        transform: translateY(-1px);
        box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    }

/* Compact Hint Text */
.print-hint {
    display: block;
    font-size: 0.8rem;
    color: var(--ucsb-navy);
    margin-top: 4px;
    font-style: italic;
    text-align: left;
}

/* ==========================================================================
   9.1 WIZARD STEP 1: REFINED JUSTIFIED DOCUMENT STYLE
   ========================================================================== */
.guidelines-container {
    margin-top: 20px;
}

.document-card {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

/* Header: Navy and Gold Accent */
.document-header {
    background-color: var(--ucsb-navy);
    padding: 20px 30px;
    display: flex;
    align-items: center;
    gap: 20px;
    border-bottom: 4px solid var(--ucsb-gold);
}

.header-icon {
    font-size: 1.8rem;
    color: var(--ucsb-gold);
}

.header-text h2 {
    color: #ffffff;
    margin: 0;
    font-size: 1.3rem;
    font-weight: 700;
}

.header-text p {
    color: #cbd5e1;
    margin: 0;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Body Content: Justified */
.document-body {
    padding: 30px;
}

.intro-alert {
    color: #b91c1c; /* Deep Red */
    font-weight: 700;
    font-size: 0.95rem;
    text-align: left; /* Keep intros left-aligned */
}

.justified-content {
    text-align: justify;
    text-justify: inter-word; /* Prevents awkward gaps between words */
    color: #334155;
    line-height: 1.8;
}

.document-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

    .document-list li {
        position: relative;
        padding-left: 30px;
        margin-bottom: 20px;
        font-size: 1rem;
        text-align: left;
    }

        /* Checkmark Bullets */
        .document-list li::before {
            content: "✔";
            position: absolute;
            left: 0;
            top: 0;
            color: var(--ucsb-gold);
            font-weight: 900;
            font-size: 1.1rem;
        }

.policy-highlight {
    background: #f8fafc;
    padding: 20px 25px 20px 45px !important;
    border-left: 4px solid var(--ucsb-navy);
    margin: 30px 0 !important;
}

/* Footer: Agreement Box */
.document-footer {
    background: #f1f5f9;
    padding: 30px 40px;
    border-top: 1px solid #e2e8f0;
}

.final-agreement-chk label {
    font-weight: 700;
    color: var(--ucsb-navy);
    cursor: pointer; /* Hand icon */
    padding-left: 12px;
    display: inline-block;
    transition: color 0.2s;
}

.final-agreement-chk:hover label {
    color: #000;
}

.validation-error-label {
    color: #dc2626;
    font-weight: 700;
    font-size: 0.85rem;
    display: block;
    margin-top: 10px;
    padding-left: 32px;
}

/* ==========================================================================
   9.2 WIZARD STEP 2: CONSISTENT CONTACT VERIFICATION
   ========================================================================== */
.contact-verification-grid {
    margin: 20px 0;
    display: flex;
    flex-direction: column;
    /* This controls the distance BETWEEN the rows */
    gap: 12px;
}

.contact-item {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    /* Vertical padding is minimal to keep stacked items close */
    padding: 4px 0;
    /* Spacing between label and value on desktop */
    column-gap: 12px;
    /* This controls distance between label and value when they stack */
    row-gap: 0px;
}

.contact-label {
    flex: 0 0 auto;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.05em;
    line-height: 1.2;
    /* Ensures the label doesn't force a gap below it */
    margin: 0;
}

.contact-value-box {
    /* 250px basis ensures a clean snap to mobile */
    flex: 1 1 250px;
    display: flex;
    justify-content: flex-start;
    align-items: center; /* Vertically centers the text in the box */
    margin: 0;
}

.contact-data-text {
    /* --- BACKGROUND ON TEXT ONLY --- */
    background-color: #f1f5f9;
    padding: 4px 10px;
    border-radius: 4px;
    display: inline-block; /* Essential to make the background wrap the text */

    font-size: 1.05rem;
    font-weight: 700;
    color: var(--ucsb-navy, #003660) !important;
    line-height: 1.2;
    word-break: break-all;
    text-align: left;
}

/* Styled "Update" Link */
.update-profile-link {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--ucsb-navy) !important;
    text-decoration: none !important;
    padding: 6px 12px;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    transition: all 0.2s;
}

    .update-profile-link:hover {
        background: var(--ucsb-gold);
        border-color: var(--ucsb-gold);
    }

.document-footer-hint {
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid #f1f5f9;
    text-align: center;
    font-size: 0.90rem;
}

/* ==========================================================================
   9.3 WIZARD STEP 3: SUBJECT SELECTION & POLICY
   ========================================================================== */
/* The Info/Policy Box */
.policy-notice-box {
    background-color: #fffaf0; /* Soft cream/gold tint */
    border-left: 4px solid var(--ucsb-gold);
    padding: 20px 25px;
    margin-bottom: 15px;
}

    .policy-notice-box p {
        text-align: left;
        color: #475569;
    }

        .policy-notice-box p:last-child {
            margin-bottom: 0;
        }

/* Selection Area Styles */
.selection-area {
    padding: 10px 0;
}

/* Specific override for the Step 3 instruction line */
.left-instruction-text {
    text-align: left !important; /* Forces left alignment */
    color: #475569;
    margin-bottom: 20px;
    display: block;
    width: 100%;
}

/* COMPACT SELECTION STYLING */
.compact-selection-group {
    max-width: 450px; /* Limits the horizontal spread */
    margin-top: 25px;
    margin-left: 10px; /* Forces it to the left edge */
    margin-right: auto; /* Pushes empty space to the right */
    display: block; /* Ensures it behaves as a left-aligned block */
    text-align: left; /* Ensures text inside is left-aligned */
}

.input-field {
    margin-bottom: 10px;
}

/* 1. The Compact Dropdown */
.document-dropdown {
    width: 280px;
    min-width: 260px !important;
    max-width: 320px !important; /* Fixed compact width */
    padding: 10px 15px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 0.95rem;
    color: var(--ucsb-navy);
    background-color: #ffffff;
    cursor: pointer;
    transition: all 0.2s ease;
    /* Modern Custom Arrow */
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23475569' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 14px;
}

    .document-dropdown:hover {
        border-color: #94a3b8;
        background-color: #f8fafc;
    }

    .document-dropdown:focus {
        border-color: var(--ucsb-navy);
        box-shadow: 0 0 0 3px rgba(0, 54, 96, 0.08);
        outline: none;
    }

/* 2. The Compact Textbox (Matching the Dropdown) */
.document-input-text {
    width: 280px; /* Default width */
    min-width: 100px;
    max-width: 320px;
    padding: 10px 15px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 0.95rem;
    color: var(--ucsb-navy);
    background-color: #ffffff;
    transition: all 0.2s ease;
    box-sizing: border-box; /* Ensures padding doesn't affect width */
}

    .document-input-text:hover {
        border-color: #94a3b8;
        background-color: #f8fafc;
    }

    .document-input-text:focus {
        border-color: var(--ucsb-navy);
        box-shadow: 0 0 0 3px rgba(0, 54, 96, 0.08);
        outline: none;
        background-color: #ffffff;
    }

/* 2. The Label (Left-aligned & Professional) */
.control-label {
    display: block;
    font-weight: 700;
    margin-bottom: 6px;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.8px;
}

/* 3. The Subject Name Display (Compact) */
.subject-display-box {
    width: 320px !important;
    border: none !important;
    background: transparent !important;
    font-weight: 600;
    color: var(--ucsb-navy); /* Gold for the actual name display */
    font-size: 1rem;
    padding: 5px 0 0 2px;
    font-style: italic;
}

/* Validation Text */
.val-error-text {
    color: var(--ucsb-coral) !important;
    font-size: 0.9rem;
    font-weight: 700;
    margin-top: 5px;
    display: block;
    text-align: left;
}

/* ==========================================================================
   9.4 STEP 4: SUBJECT SELECTION STYLES
   ========================================================================== */
/* Styling the confirmation labels for the Subject in Step 4 */
#lblSubject {
    color: var(--ucsb-navy);
    font-size: 1rem;
}

/* ==========================================================================
   9.5 STEP 5: LECTURE SELECTION STYLES
   ========================================================================== */
/* Summary row for showing previous selections */
.selection-summary-row {
    display: flex;
    gap: 30px;
    padding: 15px;
    background-color: #f8fafc;
    border: 1px solid #e2e8f0;
}

.summary-item {
    display: flex;
    flex-direction: column;
}

    .summary-item label {
        font-size: 0.7rem;
        margin-bottom: 2px;
    }

    .summary-item span {
        font-weight: 700;
        color: var(--ucsb-navy);
        font-size: 0.9rem;
    }

/* ==========================================================================
   9.. STEP .. : REST..
   ========================================================================== */
.info-label-text {
    display: block !important; /* Force span to act like a div */
    width: 100%; /* Take up full container width */
    text-align: left;
    /* Standard Spacing & Typography */
    margin-bottom: 15px;
    line-height: 1.6; /* Increased height for easier reading when justified */
    color: #334155; /* Slate 700 for high legibility */
    font-size: 0.95rem;
}

/* Clean up the 'New' label style */
.new-badge-style {
    background-color: #fef08a !important; /* Soft yellow instead of bright highlighter */
    color: #854d0e !important;
    padding: 2px 6px;
    font-size: 0.7rem;
    font-weight: 700;
}

/* Override the legacy button colors while keeping functionality */
.btn-secondary-outline {
    background-color: #f1f5f9 !important;
    border: 1px solid #cbd5e1 !important;
    color: #475569 !important;
    padding: 8px 16px;
    cursor: pointer;
    font-weight: bold;
}

.receipt-grid {
    width: 100%;
    border-collapse: collapse;
    background-color: #f8fafc;
    border: 1px solid #e2e8f0;
}

    .receipt-grid td {
        padding: 12px 15px;
        border-bottom: 1px dashed #cbd5e1;
        vertical-align: middle;
    }

    .receipt-grid tr:last-child td {
        border-bottom: none;
    }

.receipt-label {
    width: 160px;
    font-size: 0.75rem;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.receipt-value {
    font-size: 1rem;
    color: #1e293b;
}

/* Make sure the Group code stands out */
#lblGroupCodeSelected {
    color: var(--ucsb-navy);
    font-size: 1.1rem;
}

/* Styling for the final action button */
.btn-primary {
    background-color: var(--ucsb-navy);
    color: #ffffff !important;
    padding: 12px 24px;
    font-weight: 600;
    transition: background 0.2s;
}

    .btn-primary:hover {
        background-color: #003660;
    }

.inline-link {
    color: var(--ucsb-navy);
    text-decoration: underline;
    font-weight: 600;
}

/* ==========================================================================
   WIZARD NAVIGATION FOOTER (RESPONSIVE)
   ========================================================================== */
.wizard-footer {
    display: grid !important;
    /* This is the magic line: it creates columns that are at least 150px wide. 
       If 2 columns (300px + gaps) don't fit, it automatically stacks them. */
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
    width: 100%;
    box-sizing: border-box; /* PREVENTS OVERFLOW */
    padding: 15px 3px;
    border-top: 1px solid #e2e8f0;
}

    /* IMPORTANT: This 'dissolves' the table so the buttons 
   can follow the Grid rules above. 
*/
    .wizard-footer table,
    .wizard-footer tbody,
    .wizard-footer tr,
    .wizard-footer td {
        display: contents !important;
    }

    .wizard-footer input[type="submit"] {
        width: 100% !important;
        min-height: 44px; /* Standard Apple touch target size */
        /* MANDATORY: This is the only way to stop the iPad from 
       adding its own extra width and 'bubble' styling */
        -webkit-appearance: none !important;
        background-color: #003660 !important;
        color: #ffffff !important;
        font-weight: 600;
        border: none;
        cursor: pointer !important; /* Forces the 'hand' icon on desktop */
        pointer-events: auto !important; /* Ensures the button is 'hittable' by the mouse */
        font-size: 1rem !important;
        -webkit-text-size-adjust: 100% !important; /* Prevents iPad from overriding the 1.1rem */
    }

        .wizard-footer input[type="submit"]:hover {
            transform: translateY(-2px);
            box-shadow: 0 4px 8px rgba(0,0,0,0.15);
            filter: brightness(1.15);
        }


    /* Specific button color override */
    .wizard-footer input[id*="CancelButton"] {
        background-color: #FEB81C !important;
        color: #003660 !important;
    }

/* ==========================================================================
   GRIDVIEW MODERN (MATCHED TO FIRST STYLE)
   ========================================================================== */
.gridview-modern {
    width: 100% !important;
    border-collapse: separate !important; /* Matches first style for scroll support */
    margin: 15px 0;
    background-color: #ffffff;
    /* FIX: Force min-width for internal scroll activation */
    min-width: 900px;
    table-layout: auto;
    border: 1px solid #e2e8f0;
}

    /* Header Styling: Navy Gradient & Uppercase */
    .gridview-modern th {
        background: linear-gradient(180deg, var(--ucsb-navy) 0%, #162b4d 100%) !important;
        color: #FFFFFF !important;
        padding: 18px 15px !important; /* Matched padding */
        text-align: left;
        font-size: 0.8rem;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 1px;
        text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
        white-space: nowrap;
        border: none;
    }

    /* Row Styling */
    .gridview-modern td {
        padding: 15px !important; /* Matched padding */
        border-bottom: 1px solid #f0f0f0;
        color: #334155;
        vertical-align: middle;
        transition: background 0.2s ease;
    }

    /* Alternating Row Color (Zebra) */
    .gridview-modern tr:nth-child(even) {
        background-color: #f8fafc;
    }

    /* Hover Effect from Style 1 */
    .gridview-modern tr:hover {
        background-color: #f1f5f9;
    }

    /* Caption styling if the GridView uses it */
    .gridview-modern caption {
        padding: 12px;
        font-size: 0.85rem;
        color: #777;
        font-style: italic;
        text-align: left;
    }

    /* Center checkbox column utility */
    .gridview-modern td div[align="center"] {
        display: flex;
        justify-content: center;
        align-items: center;
    }

/* ==========================================================================
   Appointment Review Layout Engine
   ========================================================================== */
.appointment-review-grid {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 25px;
    background: #f8fafc;
    padding: 20px;
    border: 1px solid #e2e8f0;
    box-sizing: border-box;
    width: 100%;
}

.review-row-responsive {
    display: grid;
    grid-template-columns: 140px 1fr;
    align-items: center;
    width: 100%;
    gap: 12px;
    min-height: 40px;
}

.responsive-input-flow {
    display: flex !important;
    align-items: center;
    gap: 8px;
    width: 100%;
    box-sizing: border-box;
}

/* Helper structural variants */
.stacked-input-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    width: 100%;
}

.appointment-review-grid .wrap-flow {
    flex-wrap: wrap;
}

.appointment-review-grid .min-width-zero {
    min-width: 0;
}

.appointment-review-grid .inline-block {
    display: inline-block;
}

/* Dynamic Typography Components */
.appointment-review-grid .control-label {
    margin: 0;
}

.appointment-review-grid .AppointmentDataLabel {
    font-weight: 600;
    color: var(--ucsb-navy);
}

.appointment-review-grid .input-suffix-text {
    font-size: 0.9rem;
    color: #475569;
    font-weight: 500;
    vertical-align: middle;
    flex-shrink: 0;
}

.appointment-review-grid .restriction-label-text {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    margin: 0;
    text-align: left;
    color: maroon;
}

.appointment-review-grid .bold-error {
    font-weight: bold;
    flex-shrink: 0;
}

.appointment-review-grid .no-wrap {
    white-space: nowrap;
}

/* Dropdown isolation context overrides */
.appointment-review-grid .dropdown-wrapper {
    flex: 0 1 auto;
    min-width: 0;
    max-width: 100%;
}

.appointment-review-grid .document-dropdown {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}

/* Security verification layout alignments */
.appointment-review-grid .input-row-padded {
    min-height: 45px;
}

.appointment-review-grid .perm-verification-gap {
    gap: 10px;
}

.appointment-review-grid .custom-perm-input {
    width: 140px;
    padding: 8px 12px;
    height: 38px;
    box-sizing: border-box;
}

.appointment-review-grid .validation-inline-weight {
    font-weight: 600;
}

.appointment-review-grid .security-muted-text {
    font-size: 0.88rem;
    color: #64748b;
    font-weight: 500;
}

/* Validation summaries & global error container frameworks */
.appointment-review-grid .val-error-summary-list {
    margin-bottom: 20px;
    padding-left: 20px;
    color: #b91c1c;
}

.appointment-review-grid .server-error-container {
    margin-top: 15px;
    min-height: 20px;
}

.appointment-review-grid .global-error-alert {
    font-weight: 600;
    display: block;
    padding: 8px 12px;
    background-color: #fdf2f2;
    border-radius: 4px;
    border: 1px solid #f87171;
}

/* Informational Info guideline boxes */
.appointment-review-grid .guideline-blurb-wrapper {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.appointment-review-grid .info-blurb-row {
    font-size: 0.88rem;
    color: #475569;
    line-height: 1.4;
    display: flex;
    align-items: center;
}

.appointment-review-grid .blurb-icon-align {
    margin-right: 6px;
    color: var(--ucsb-navy);
    flex-shrink: 0;
}

.appointment-review-grid .text-center {
    text-align: center;
}


/* ==========================================================================
   Responsive adjustment
   ========================================================================== */
@media screen and (max-width: 768px) {
    .action-card.print-verification {
        flex-direction: column;
        align-items: flex-start;
    }

    .btn-group-row {
        flex-wrap: wrap !important;
        flex-direction: column !important;
        align-items: stretch !important;
    }

    .btn-narrow {
        width: 100% !important;
    }

    .document-body {
        padding: 25px 20px;
    }

    .justified-content, .document-list li {
        text-align: left;
    }

    .document-header {
        padding: 20px;
    }

    .header-text h3 {
        font-size: 1.1rem;
    }

    .input-group-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    /* Header/Text Adjustments */
    h1 {
        font-size: 1.5rem !important;
        margin-bottom: 1rem;
        line-height: 1.25;
    }

    /* Scaled down from 1.3rem */
    .header-text h2 {
        font-size: 1rem !important;
        line-height: 1.3;
    }

    .document-header {
        gap: 10px;
    }

    /* Appointments details */
    .review-row-responsive {
        display: flex !important;
        flex-direction: column !important;
        align-items: flex-start !important;
        text-align: left;
        gap: 6px !important;
        width: 100%;
    }

        /* FIX: Force label elements to break out of inline wrapping and stick left */
        .review-row-responsive > span,
        .review-row-responsive .control-label {
            display: block !important;
            text-align: left !important;
        }

    .appointment-review-grid .dropdown-wrapper {
        flex: 1 1 100% !important;
        width: 100% !important;
    }

    .appointment-review-grid .input-suffix-text {
        margin-left: 0;
    }
}

/* Nav and table card related  */
@media (max-width: 992px) {
    .nav-toggle-btn {
        display: block; /* Show hamburger icon */
    }

    .nav-container {
        flex-wrap: wrap; /* Allows menu to drop below the button on mobile */
    }

    #nav {
        display: none; /* Hidden by default */
        grid-template-columns: repeat(2, 1fr);
        list-style: none;
        margin: 0;
        padding: 0;
        width: 100%; /* Spans full width when open */
        border-top: 1px solid rgba(255,255,255,0.1);
    }

        /* Class added by JavaScript */
        #nav.open {
            display: grid;
        }

        #nav li {
            border-right: 1px solid rgba(255,255,255,0.1);
            border-bottom: 1px solid rgba(255,255,255,0.1);
        }

            #nav li:nth-child(2n) {
                border-right: none;
            }

            #nav li a {
                display: block;
                padding: 1.2rem 0.5rem;
                text-align: center;
                color: #FFFFFF;
                text-decoration: none;
                font-size: 0.85rem;
                font-weight: 700;
                text-transform: uppercase;
                letter-spacing: 0.5px;
            }

                #nav li a:hover {
                    background-color: rgba(255, 255, 255, 0.1) !important;
                    border-bottom-color: var(--ucsb-gold) !important;
                    color: #FFFFFF !important;
                }

    .nav-logout {
        grid-column: span 2;
        background-color: var(--ucsb-coral);
    }

        /* 1. The container hover (turns to UCSB Blue) */
        .nav-logout:hover {
            background-color: var(--ucsb-navy); /* Your UCSB Blue color */
        }

    /* 1. Remove the standard table look */
    .table-card {
        padding: 5px !important;
    }

    .clas-styled-table {
        min-width: 100% !important; /* Kill the 850px wide scroll */
        border: none;
    }

        .clas-styled-table thead {
            display: none; /* Hide headers */
        }

        /* 2. Turn each row into a standalone floating Card */
        .clas-styled-table tr {
            display: block;
            background: #fff;
            margin-bottom: 20px;
            padding: 10px;
            border: 1px solid #e5e7eb;
            box-shadow: 0 4px 6px rgba(0,0,0,0.05);
        }

        /* 3. Style the Cells as rows inside the Card */
        .clas-styled-table td {
            display: block;
            text-align: right !important; /* Content moves to the right */
            padding: 12px 10px;
            border-bottom: 1px solid #f3f4f6;
            position: relative;
            min-height: 45px; /* Prevents collapse if content is empty */
            word-break: break-word; /* Prevents long URLs from breaking the card */
        }

            .clas-styled-table td:last-child {
                border-bottom: none;
            }

            /* 4. The Magic Label (Positioned on the Left) */
            .clas-styled-table td::before {
                content: attr(data-label); /* Pulls from your HTML data-label */
                position: absolute;
                left: 10px; /* Stays on the left */
                top: 12px;
                width: 40%; /* Reserved space for the label */
                text-align: left;
                font-weight: 800;
                font-size: 0.75rem;
                color: var(--ucsb-navy);
                text-transform: uppercase;
            }

        /* 5. Content Spacing */
        /* This ensures the content doesn't overwrite the label */
        .clas-styled-table td {
            padding-left: 45% !important;
        }

    /* Specific Badge Alignment for Cards */
    .status-cell {
        display: flex !important;
        justify-content: flex-end;
    }
}

/* DESKTOP VIEW: Single Horizontal Row */
@media (min-width: 993px) {
    .nav-container {
        padding: 0 20px;
    }

    #nav {
        display: flex !important; /* Ensure always visible on desktop */
        flex-direction: row;
        align-items: center;
        list-style: none;
        width: 100%;
    }

        #nav li a {
            display: block;
            color: #FFFFFF;
            text-decoration: none !important;
            padding: 0.75rem 1rem;
            font-weight: 600;
            font-size: 0.95rem;
            transition: all 0.2s ease;
            border-bottom: 3px solid transparent !important;
        }

            #nav li a:hover {
                background-color: rgba(255, 255, 255, 0.1) !important;
                border-bottom-color: var(--ucsb-gold) !important;
                color: #FFFFFF !important;
            }

    .nav-logout {
        margin-left: auto;
        background-color: var(--ucsb-coral);
    }
        /* 1. The container hover (turns to UCSB Blue) */
        .nav-logout:hover {
            background-color: var(--ucsb-navy); /* Your UCSB Blue color */
        }
}
