/* Design system for the /mobile/ section. Self-contained: does not
   share selectors with the desktop App_Themes/Default stylesheets,
   so it is safe to evolve independently ahead of a native app wrapper. */

:root {
    /* Ninety Nines Flying Club brand: deep maroon + gold, taken from the
       club crest (App_Themes/Default/images/99 logo.png). */
    --m-primary: #6e1b1b;
    --m-primary-light: #9c2b2b;
    --m-accent: #b8860b;
    --m-accent-light: #d4a537;
    --m-bg: #faf7f0;
    --m-card-bg: #ffffff;
    --m-text: #2b2116;
    --m-muted: #8a7b66;
    --m-border: #e6ddc9;
    --m-danger: #a3352b;
    --m-danger-bg: #fdf0ef;
    --m-danger-border: #f3c6c1;
    --m-success: #1c7a44;
    --m-success-bg: #eafaf0;
    --m-success-border: #b9e8cc;
    --m-radius: 14px;
    --m-shadow: 0 10px 30px rgba(110, 27, 27, 0.14);
}

* , *::before, *::after {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
}

.m-body {
    background: var(--m-bg);
    color: var(--m-text);
    font-family: Segoe UI, -apple-system, Roboto, Helvetica, Arial, sans-serif;
    -webkit-tap-highlight-color: transparent;
    min-height: 100vh;
}

img {
    max-width: 100%;
    height: auto;
}

/* Header: logo+title on their own line, logged-in user/sign-out on the
   line below - keeps each line short enough for small phone screens. */
.m-header {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 12px 16px;
    padding-top: calc(12px + env(safe-area-inset-top, 0px));
    background: linear-gradient(135deg, var(--m-primary), var(--m-primary-light));
    color: #ffffff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.m-header-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0;
}

.m-header-logo {
    height: 58px;
    width: auto;
}

.m-header-title {
    font-size: 17px;
    font-weight: 600;
}

.m-header-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    font-size: 12px;
    opacity: .9;
}

.m-header-user {
    display: flex;
    align-items: center;
    gap: 5px;
}

.m-header-user svg {
    width: 13px;
    height: 13px;
    fill: #ffffff;
    opacity: .85;
    flex: 0 0 auto;
}

.m-header-links {
    display: flex;
    align-items: center;
}

.m-header-link {
    display: flex;
    align-items: center;
    gap: 4px;
    color: #ffffff;
    opacity: .85;
    font-size: 12.5px;
    background: transparent;
    border: none;
    text-decoration: none;
    cursor: pointer;
    white-space: nowrap;
}

.m-header-link + .m-header-link {
    margin-left: 8px;
    padding-left: 8px;
    border-left: 1px solid rgba(255, 255, 255, 0.35);
}

.m-header-link svg {
    width: 12px;
    height: 12px;
    fill: #ffffff;
    flex: 0 0 auto;
}

.m-header-link:hover {
    opacity: 1;
    text-decoration: underline;
}

/* Content area */
.m-content {
    padding: 16px;
    padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px));
    max-width: 480px;
    margin: 0 auto;
}

/* Full-bleed centered shell, used by pages like login that render
   outside the normal header/content flow (header hidden). */
.m-shell {
    min-height: calc(100vh - 32px);
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 16px 4px;
}

/* Card */
.m-card {
    width: 100%;
    max-width: 380px;
    background: var(--m-card-bg);
    border-radius: var(--m-radius);
    padding: 30px 24px;
    box-shadow: var(--m-shadow);
}

.m-card-center {
    text-align: center;
}

/* Brand badge */
.m-logo-img {
    display: block;
    max-width: 140px;
    height: auto;
    margin: 0 auto 16px auto;
}

.m-slogan {
    margin: 0 0 8px 0;
    font-size: 11px;
    font-style: italic;
    color: var(--m-primary);
}

.m-title {
    margin: 0;
    font-size: 22px;
    font-weight: 600;
    color: var(--m-text);
}

.m-subtitle {
    margin: 4px 0 24px 0;
    font-size: 13px;
    color: var(--m-muted);
}

.m-forgot {
    margin: -10px 0 18px 0;
    text-align: right;
    font-size: 12.5px;
}

.m-forgot a {
    color: var(--m-primary);
    text-decoration: none;
}

.m-forgot a:hover {
    text-decoration: underline;
}

/* Banners */
.m-banner {
    display: block;
    margin-bottom: 18px;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
    text-align: left;
}

.m-banner-success {
    background-color: var(--m-success-bg);
    border: 1px solid var(--m-success-border);
    color: var(--m-success);
}

.m-banner-icon {
    display: inline-block;
    margin-right: 6px;
    font-weight: bold;
}

/* Form fields */
.m-field {
    text-align: left;
    margin-bottom: 16px;
}

.m-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .02em;
    text-transform: uppercase;
    color: var(--m-muted);
    margin-bottom: 6px;
}

.m-input {
    width: 100%;
    padding: 11px 12px;
    font-size: 15px;
    color: var(--m-text);
    background-color: #f7f2e6;
    border: 1px solid var(--m-border);
    border-radius: 8px;
    outline: none;
    transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease;
}

.m-input:focus {
    border-color: var(--m-primary-light);
    background-color: #ffffff;
    box-shadow: 0 0 0 3px rgba(184, 134, 11, 0.2);
}

.m-input + span {
    display: block;
    margin-top: 5px;
    font-size: 11px;
    color: var(--m-danger);
}

/* Buttons */
.m-btn {
    width: 100%;
    display: block;
    padding: 12px;
    margin-top: 6px;
    border: none;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--m-primary), var(--m-primary-light));
    color: #ffffff;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: .01em;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    transition: transform .1s ease, box-shadow .15s ease, opacity .15s ease;
    box-shadow: 0 6px 14px rgba(110, 27, 27, 0.3);
}

.m-btn:hover {
    box-shadow: 0 8px 18px rgba(110, 27, 27, 0.38);
}

.m-btn:active {
    transform: translateY(1px);
    box-shadow: 0 3px 8px rgba(110, 27, 27, 0.3);
}

.m-btn-outline {
    background: transparent;
    color: var(--m-primary);
    box-shadow: none;
    border: 1px solid var(--m-border);
}

/* Progress / spinner */
.m-progress {
    display: block;
    margin-top: 12px;
    font-size: 12px;
    color: var(--m-muted);
}

.m-spinner {
    display: inline-block;
    width: 12px;
    height: 12px;
    margin-right: 6px;
    vertical-align: -2px;
    border: 2px solid #cfe0ec;
    border-top-color: var(--m-primary-light);
    border-radius: 50%;
    animation: m-spin .7s linear infinite;
}

@keyframes m-spin {
    to { transform: rotate(360deg); }
}

/* Errors. Visibility is controlled server-side (Panel.Visible), not CSS,
   since the mobile section has no client script dependency. */
.m-error {
    margin-top: 16px;
    padding: 10px 12px;
    border-radius: 8px;
    background-color: var(--m-danger-bg);
    border: 1px solid var(--m-danger-border);
    color: var(--m-danger);
    font-size: 12.5px;
    text-align: left;
}

.m-footer {
    margin-top: 22px;
    font-size: 11px;
    color: var(--m-muted);
    text-align: center;
}

.m-btn-danger {
    background: linear-gradient(135deg, #a3352b, #c9483c);
    box-shadow: 0 6px 14px rgba(163, 53, 43, 0.3);
}

.m-btn-success {
    background: linear-gradient(135deg, #1c7a44, #2ea25d);
    box-shadow: 0 6px 14px rgba(28, 122, 68, 0.3);
}

.m-hint {
    font-size: 11px;
    color: var(--m-muted);
    margin-top: 4px;
}

.m-field-notice {
    display: block;
    margin-top: 4px;
    font-size: 11.5px;
    font-weight: 600;
    color: #d32f2f;
}

.m-balance-badge {
    display: inline-block;
    margin-top: 6px;
    padding: 6px 10px;
    border-radius: 8px;
    font-size: 12.5px;
    font-weight: 600;
}

.m-balance-badge.BalanceNormal {
    background: var(--m-success-bg);
    color: var(--m-success);
}

.m-balance-badge.BalanceWarning {
    background: #fdf6e3;
    color: #8a6d1f;
}

.m-balance-badge.BalanceCritical {
    background: var(--m-danger-bg);
    color: var(--m-danger);
}

.m-balance-badge.BalanceUnknown {
    background: #f0ece0;
    color: var(--m-muted);
}

.m-autosuggest {
    position: relative;
}

.m-suggest-list {
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    z-index: 20;
    margin-top: 2px;
    max-height: 240px;
    overflow-y: auto;
    background: var(--m-card-bg, #fff);
    border: 1px solid var(--m-border, #e0d9c8);
    border-radius: 10px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.m-suggest-item {
    padding: 10px 14px;
    font-size: 13.5px;
    cursor: pointer;
    border-bottom: 1px solid var(--m-border, #efe8d8);
}

.m-suggest-item:last-child {
    border-bottom: none;
}

.m-suggest-item:hover,
.m-suggest-item:active {
    background: var(--m-hover-bg, #faf5e8);
}

.m-suggest-empty {
    padding: 10px 14px;
    font-size: 12.5px;
    color: var(--m-muted);
    font-style: italic;
}

.m-empty {
    font-size: 13px;
    color: var(--m-muted);
    font-style: italic;
    padding: 14px 4px;
}

.m-notice {
    background-color: #fdf6e3;
    border: 1px solid #f0dca0;
    color: #8a6d1f;
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 13px;
    margin-bottom: 16px;
}

/* Sticky top group: header + tab strip stacked together (used by any
   section with a nav menu, e.g. /mobile/student/, /mobile/instructor/),
   one sticky element so we don't have to hardcode a fixed header height. */
.m-top {
    position: sticky;
    top: 0;
    z-index: 20;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.m-top .m-header {
    box-shadow: none;
}

/* Tab bar: icon above label. When there are few enough tabs to fit, they
   space out to fill the width (m-tab's flex-grow); once there are too many
   for one row on a phone screen, they keep a fixed min-width instead of
   being squeezed and the bar scrolls horizontally instead. */
.m-tabbar {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
    -ms-overflow-style: none;
    -webkit-overflow-scrolling: touch;
    background: var(--m-card-bg);
    border-top: 1px solid rgba(255, 255, 255, 0.15);
}

.m-tabbar::-webkit-scrollbar {
    display: none;
}

.m-tab {
    flex: 1 1 68px;
    scroll-snap-align: start;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 8px 2px 7px 2px;
    color: var(--m-muted);
    text-decoration: none;
    font-size: 10.5px;
    text-align: center;
    white-space: nowrap;
}

.m-tab svg {
    width: 20px;
    height: 20px;
    fill: var(--m-muted);
}

.m-tab.active {
    color: var(--m-primary);
    font-weight: 600;
}

.m-tab.active svg {
    fill: var(--m-primary);
}

.m-tab.disabled {
    opacity: .55;
}

.m-tab-badge {
    font-size: 8px;
    font-style: normal;
    background: var(--m-border);
    color: var(--m-muted);
    border-radius: 6px;
    padding: 1px 5px;
}

/* Greeting */
.m-greeting {
    margin: 4px 0 16px 0;
}

.m-greeting h1 {
    margin: 0 0 2px 0;
    font-size: 20px;
    font-weight: 600;
    text-transform: capitalize;
    color: var(--m-text);
}

.m-greeting p {
    margin: 0;
    font-size: 13px;
    color: var(--m-muted);
}

/* Section heading */
.m-section-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--m-text);
    margin: 22px 0 10px 0;
}

/* Summary card: label/value rows grouped in one compact card instead of
   separate stat tiles. */
.m-summary-card {
    background: var(--m-card-bg);
    border-radius: var(--m-radius);
    margin-bottom: 20px;
    padding: 4px 16px;
    box-shadow: 0 2px 10px rgba(110, 27, 27, 0.06);
}

.m-summary-card-h {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .03em;
    color: var(--m-muted);
    padding: 12px 0 8px 0;
    border-bottom: 1px solid var(--m-border);
}

.m-summary-card-h svg {
    width: 14px;
    height: 14px;
    fill: var(--m-muted);
    flex: 0 0 auto;
}

.m-summary-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid var(--m-border);
}

.m-summary-row:last-child {
    border-bottom: none;
}

.m-summary-label {
    font-size: 13px;
    color: var(--m-muted);
}

.m-summary-value {
    font-size: 15px;
    font-weight: 700;
    color: var(--m-text);
}

.m-summary-value.balance-good {
    color: var(--m-success);
}

.m-summary-value.balance-low {
    color: var(--m-accent);
}

.m-summary-value.balance-negative {
    color: var(--m-danger);
}

/* Accent card holding a list of expandable/simple items - one prominent
   card instead of a card-per-item. Used for announcements (both sections)
   and license lists (both sections). */
.m-ann-card {
    background: var(--m-card-bg);
    border-radius: var(--m-radius);
    margin-bottom: 20px;
    box-shadow: 0 8px 26px rgba(110, 27, 27, 0.14);
    border-left: 5px solid var(--m-accent);
    overflow: hidden;
}

.m-ann-card-h {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 16px;
    font-size: 14px;
    font-weight: 700;
    color: var(--m-primary);
    background: linear-gradient(135deg, #fff8e8, #fdf3e0);
    border-bottom: 1px solid var(--m-border);
}

.m-ann-card-h svg {
    width: 18px;
    height: 18px;
    fill: var(--m-accent);
    flex: 0 0 auto;
}

.m-ann-item {
    display: block;
    border-bottom: 1px solid var(--m-border);
}

.m-ann-item:last-child {
    border-bottom: none;
}

.m-ann-item-h {
    display: block;
    padding: 12px 16px;
    font-size: 13px;
    font-weight: 600;
    color: var(--m-text);
    text-decoration: none;
    cursor: pointer;
}

.m-ann-item[open] .m-ann-item-h {
    background: #faf7f0;
}

.m-ann-item-body {
    padding: 0 16px 14px 16px;
    font-size: 13px;
    color: var(--m-text);
}

.m-ann-item-body a {
    color: var(--m-primary-light);
    text-decoration: none;
    font-size: 12px;
    font-weight: 600;
}

/* Licenses card: same layout as the announcements card, but a wine/burgundy
   shade (distinct from the brand's brick-maroon primary and the gold used
   for announcements) so the two cards don't read as the same thing. */
.m-license-card {
    border-left: none;
}

.m-license-card .m-ann-card-h {
    background: linear-gradient(135deg, #f7ecf1, #f3e3ea);
    color: #7a2848;
}

.m-license-card .m-ann-card-h svg {
    fill: #7a2848;
}

.m-license-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--m-border);
    border-left: 4px solid var(--m-success);
}

.m-license-item:last-child {
    border-bottom: none;
}

.m-license-item.expired {
    border-left-color: var(--m-danger);
}

.m-license-type {
    font-size: 14px;
    font-weight: 600;
    color: var(--m-text);
}

.m-license-meta {
    font-size: 12px;
    color: var(--m-muted);
    text-align: right;
}

.m-license-item.expired .m-license-meta {
    color: var(--m-danger);
    font-weight: 600;
}

/* Modal popup shell - used for things a user must actually notice on
   login (like an expired license), rather than a banner that can be
   scrolled past. Section-specific content (e.g. license rows) is styled
   in that section's own stylesheet. */
.m-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(20, 8, 8, 0.6);
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.m-modal-box {
    background: #ffffff;
    border-radius: var(--m-radius);
    padding: 26px 22px;
    max-width: 340px;
    width: 100%;
    text-align: center;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
}

.m-modal-icon {
    font-size: 34px;
    line-height: 1;
    margin-bottom: 10px;
}

.m-modal-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--m-danger);
    margin-bottom: 8px;
}

.m-modal-text {
    font-size: 13px;
    color: var(--m-text);
    margin: 0 0 14px 0;
}

.m-modal-box .m-btn {
    margin-top: 16px;
}

/* Expired-license rows inside the modal shell above - used by student and
   instructor Home pages. */
.m-modal-license-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    margin-bottom: 6px;
    background: var(--m-danger-bg);
    border: 1px solid var(--m-danger-border);
    border-radius: 8px;
    text-align: left;
}

.m-modal-license-type {
    font-size: 13px;
    font-weight: 700;
    color: var(--m-text);
}

.m-modal-license-date {
    font-size: 12px;
    font-weight: 600;
    color: var(--m-danger);
}

@media screen and (max-width: 380px) {
    .m-card {
        padding: 24px 18px;
        border-radius: 12px;
    }
}

/* Timetable date navigation - shared by student and instructor timetable
   pages. */
.m-date-nav {
    display: flex;
    align-items: center;
    gap: 8px;
}

.m-date-nav .m-input {
    flex: 1;
    text-align: center;
}

.m-date-nav-btn {
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    line-height: 1;
    color: var(--m-primary);
    background: #f7f2e6;
    border: 1px solid var(--m-border);
    border-radius: 8px;
    text-decoration: none;
    cursor: pointer;
}

.m-date-nav-btn:hover {
    background: var(--m-border);
}

/* Timetable agenda rows - used directly on an <a> by the timetable pages
   (row content is .m-tt-time/.m-tt-body straight inside it). */
.m-tt-item {
    display: flex;
    gap: 12px;
    background: var(--m-card-bg);
    border-radius: 12px;
    padding: 12px 14px;
    margin-bottom: 10px;
    box-shadow: 0 2px 10px rgba(110, 27, 27, 0.06);
    border-left: 4px solid var(--m-primary-light);
    text-decoration: none;
    color: inherit;
}

/* Staff Bookings list variant - the row has its own action button (Mark
   Complete) below the clickable time/body content, so the outer element
   can no longer be a single <a> covering the whole card; combined with
   .m-tt-item (for the card look + .status-* shading) on the same element,
   .m-tt-card switches it to a column layout and .m-tt-link recreates the
   original time+body flex row inside it. */
.m-tt-card {
    flex-direction: column;
    gap: 0;
}

.m-tt-link {
    display: flex;
    gap: 12px;
    text-decoration: none;
    color: inherit;
}

/* Status shading - same colors as .m-booking/.m-ins-booking, used by the
   staff Bookings list. */
.m-tt-item.status-cancelled { border-left-color: #b0b0b0; opacity: .75; }
.m-tt-item.status-delayed { border-left-color: #c98a1a; }
.m-tt-item.status-pending { border-left-color: #7c8a99; }
.m-tt-item.status-complete { border-left-color: var(--m-success); }
.m-tt-item.status-rejected { border-left-color: var(--m-danger); }

.m-tt-time {
    flex: 0 0 auto;
    width: 46px;
    font-size: 12px;
    font-weight: 600;
    color: var(--m-primary);
}

.m-tt-body {
    flex: 1 1 auto;
    min-width: 0;
}

.m-tt-subject {
    font-size: 14px;
    font-weight: 600;
    color: var(--m-text);
}

.m-tt-meta, .m-tt-notes {
    font-size: 12px;
    color: var(--m-muted);
    margin-top: 2px;
}

/* Search field with an inline button - used by instructor Students/Bookings
   list pages. */
.m-search-row {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.m-search-row .m-input {
    flex: 1 1 auto;
}

.m-search-row .m-btn {
    flex: 0 0 auto;
    width: auto;
    padding: 11px 16px;
    margin-top: 0;
}

/* Prev/page-info/next pager - used by instructor Students/Bookings list
   pages, reuses the timetable date-nav button look. */
.m-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    margin: 18px 0 6px 0;
}

.m-pagination-label {
    font-size: 13px;
    color: var(--m-muted);
}

.m-pagination .m-date-nav-btn[disabled] {
    opacity: .4;
    cursor: default;
}

/* Upcoming/Past bookings toggle - used by student and instructor bookings
   list pages. Sits at the bottom of the list, below pagination. */
.m-toggle-row {
    margin: 18px 0 6px 0;
    text-align: center;
}

.m-toggle-link {
    font-size: 12px;
    font-weight: 600;
    color: var(--m-primary);
    text-decoration: none;
}

.m-toggle-link:hover {
    text-decoration: underline;
}

/* Date group header - used by student and instructor bookings list pages
   to separate "Today's Bookings" / "Tomorrow" / etc. groups. */
.m-date-group-header {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .03em;
    color: var(--m-muted);
    margin: 18px 2px 8px 2px;
}

.m-date-group-header:first-child {
    margin-top: 0;
}

/* Aircraft group header - used by the "All Bookings" list to make the
   aircraft each group of bookings belongs to stand out clearly, since it's
   the main thing a student is scanning for (unlike the subtler date headers
   above). */
.m-aircraft-header {
    font-size: 15px;
    font-weight: 700;
    color: #ffffff;
    background-color: var(--m-primary);
    padding: 8px 12px;
    border-radius: 8px;
    margin: 18px 0 8px 0;
}

.m-aircraft-header:first-child {
    margin-top: 0;
}

/* Inline button row (Accept/Reject etc.) */
.m-btn-row {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.m-btn-row .m-btn, .m-btn-row .m-btn-outline, .m-btn-row .m-btn-danger, .m-btn-row .m-btn-success {
    margin-top: 0;
    padding: 9px;
    font-size: 13px;
}

/* Booking form - used by student and staff booking forms. */
.m-field-row {
    display: flex;
    gap: 10px;
}

.m-field-row .m-field {
    flex: 1;
    min-width: 0;
}

.m-checkfield {
    display: flex;
    align-items: center;
}

.m-checkfield input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-right: 8px;
    flex: 0 0 auto;
}

/* Full-page loading overlay - every interaction here is a real page
   navigation or postback (no AJAX), so there is otherwise zero feedback
   between a tap and the next page appearing. Hidden by default; each mobile
   master page's script shows it on tab-bar/link navigation and on form
   submit. It doesn't need explicit hiding on success since the next page's
   markup loads fresh (hidden) - the JS side only sets a timeout as a
   fallback for the case where client-side validation blocks the postback
   and no navigation actually happens. */
.m-page-loading-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, .75);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.m-page-loading-overlay.m-page-loading-active {
    display: flex;
}

.m-page-loading-spinner {
    width: 38px;
    height: 38px;
    border: 4px solid var(--m-border);
    border-top-color: var(--m-primary);
    border-radius: 50%;
    animation: m-page-loading-spin .7s linear infinite;
}

@keyframes m-page-loading-spin {
    to { transform: rotate(360deg); }
}

.m-checkfield label {
    font-size: 13px;
    color: var(--m-text);
}

.m-chip-list {
    background: #f7f2e6;
    border: 1px solid var(--m-border);
    border-radius: 8px;
    padding: 8px 10px;
    max-height: 260px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.m-chip-list-inner label {
    display: inline-flex;
    align-items: center;
    background: #ffffff;
    border: 1px solid var(--m-border);
    border-radius: 20px;
    padding: 5px 10px 5px 6px;
    margin: 3px;
    font-size: 12px;
    color: var(--m-text);
}

.m-chip-list-inner input[type="checkbox"] {
    margin-right: 5px;
}

/* Status radio list - used by the staff Edit Booking form. */
.m-radio-list label {
    display: inline-flex;
    align-items: center;
    background: #f7f2e6;
    border: 1px solid var(--m-border);
    border-radius: 20px;
    padding: 6px 12px 6px 8px;
    margin: 3px 6px 9px 0;
    font-size: 13px;
    color: var(--m-text);
}

.m-radio-list input[type="radio"] {
    margin-right: 6px;
}

/* Avatar - used by student and instructor profile pages. */
.m-avatar {
    text-align: center;
    margin-bottom: 16px;
}

.m-avatar-img {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #fff;
    box-shadow: 0 2px 10px rgba(110, 27, 27, 0.15);
}

/* Collapsible sections (profile groups etc.) - used by student and
   instructor profile pages. */
.m-section {
    background: var(--m-card-bg);
    border-radius: 12px;
    margin-bottom: 10px;
    box-shadow: 0 2px 10px rgba(110, 27, 27, 0.06);
    overflow: hidden;
}

.m-section-h {
    display: block;
    padding: 12px 14px;
    font-size: 13px;
    font-weight: 600;
    color: var(--m-text);
    background: #faf7f0;
    cursor: pointer;
}

.m-section[open] .m-section-h {
    border-bottom: 1px solid var(--m-border);
}

/* Definition list, label/value rows */
.m-dl {
    margin: 0;
    padding: 4px 14px;
}

.m-dl dt {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .02em;
    color: var(--m-muted);
    margin-top: 10px;
}

.m-dl dd {
    margin: 2px 0 0 0;
    font-size: 14px;
    color: var(--m-text);
}

.m-dl dd:last-of-type {
    margin-bottom: 10px;
}

.m-section > a.m-btn {
    margin: 0 14px 14px 14px;
    width: calc(100% - 28px);
}

/* Row-per-item data table (e.g. flying hours by aircraft/month) - wrapper
   scrolls horizontally on narrow phones instead of wrapping/truncating
   columns, since the numeric columns need to stay side-by-side to compare.
   Mobile browsers auto-hide their native scrollbar, so on its own this gives
   no visual clue there's more to see - the background-attachment:local/scroll
   layering below paints a soft shadow at whichever edge(s) still have
   unscrolled content, and it fades away once you've scrolled all the way to
   that edge. Pure CSS, no JS, no extra markup needed. */
.m-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    background-color: var(--m-bg);
    background-image:
        linear-gradient(to right, var(--m-bg) 30%, rgba(250, 247, 240, 0)),
        linear-gradient(to right, rgba(250, 247, 240, 0), var(--m-bg) 70%),
        radial-gradient(farthest-side at 0 50%, rgba(110, 27, 27, .35), rgba(110, 27, 27, 0)),
        radial-gradient(farthest-side at 100% 50%, rgba(110, 27, 27, .35), rgba(110, 27, 27, 0));
    background-repeat: no-repeat;
    background-size: 30px 100%, 30px 100%, 12px 100%, 12px 100%;
    background-position: 0 0, 100% 0, 0 0, 100% 0;
    background-attachment: local, local, scroll, scroll;
}

.m-table {
    width: 100%;
    min-width: 480px;
    border-collapse: collapse;
    font-size: 13px;
}

.m-table th,
.m-table td {
    padding: 10px 12px;
    text-align: right;
    white-space: nowrap;
}

.m-table th:first-child,
.m-table td:first-child {
    text-align: left;
}

.m-table thead th {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .02em;
    color: var(--m-muted);
    font-weight: 600;
    background: #faf7f0;
    border-bottom: 1px solid var(--m-border);
}

.m-table tbody td {
    border-bottom: 1px solid var(--m-border);
    color: var(--m-text);
}

.m-table tbody tr:last-child td {
    border-bottom: none;
}

.m-table tfoot td {
    border-top: 1px solid var(--m-border);
    font-weight: 600;
    color: var(--m-primary);
}
