﻿/* ============================================================
   THEME SYSTEM (MATCHED CONTRAST DESIGN)
   ============================================================ */

/* ─────────────────────────────────────────────
   LIGHT (default brand)
───────────────────────────────────────────── */
:root,
[data-app-theme="light"] {
    --app-brand: #127497;
    --app-brand-hover: #0f5f7a;
    --app-brand-alt: #3276bb;
    --app-brand-text: #ffffff;
    --app-bg: #ffffff;
    --app-surface: #ffffff;
    --app-surface-alt: #f8f9fa;
    --app-text: #2a2a2a;
    --app-text-muted: #6c757d;
    --app-border: rgba(0,0,0,0.08);
    --app-nav-bg: #127497;
    --app-nav-text: #ffffff;
    --app-nav-muted: rgba(255,255,255,0.85);
    --app-nav-hover: rgba(255,255,255,0.15);
    --app-nav-active: rgba(255,255,255,0.25);
    --app-card-header: #127497;
}

/* ─────────────────────────────────────────────
   DARK
───────────────────────────────────────────── */
[data-app-theme="dark"] {
    --app-brand: #0d3a4d;
    --app-brand-hover: #0a2d3c;
    --app-brand-alt: #1f5e7d;
    --app-bg: #1a1d20;
    --app-surface: #212529;
    --app-surface-alt: #2b3035;
    --app-text: #e9ecef;
    --app-text-muted: #adb5bd;
    --app-border: rgba(255,255,255,0.10);
    --app-nav-bg: #0d3a4d;
    --app-nav-text: #e9ecef;
    --app-nav-muted: rgba(233,236,239,0.85);
    --app-nav-hover: rgba(255,255,255,0.10);
    --app-nav-active: rgba(255,255,255,0.18);
    --app-card-header: #0d3a4d;
}

/* ─────────────────────────────────────────────
   SUNSET
───────────────────────────────────────────── */
[data-app-theme="sunset"] {
    --app-brand: #c7543a;
    --app-brand-hover: #a8462f;
    --app-bg: #fff8f5;
    --app-surface: #ffffff;
    --app-text: #3d2419;
    --app-text-muted: #8a6a5d;
    --app-border: rgba(199,84,58,0.15);
    --app-nav-bg: #c7543a;
    --app-nav-text: #ffffff;
    --app-nav-hover: rgba(255,255,255,0.15);
    --app-nav-active: rgba(255,255,255,0.25);
    --app-card-header: #c7543a;
    --app-surface-alt: #fdeee9;
}

/* ─────────────────────────────────────────────
   FOREST
───────────────────────────────────────────── */
[data-app-theme="forest"] {
    --app-brand: #2d5f3f;
    --app-bg: #f7faf7;
    --app-surface: #ffffff;
    --app-text: #1f3326;
    --app-text-muted: #5a7062;
    --app-border: rgba(45,95,63,0.15);
    --app-nav-bg: #2d5f3f;
    --app-nav-text: #ffffff;
    --app-nav-hover: rgba(255,255,255,0.15);
    --app-nav-active: rgba(255,255,255,0.25);
    --app-card-header: #2d5f3f;
    --app-surface-alt: #eef4ee;
}

/* ─────────────────────────────────────────────
   MIDNIGHT
───────────────────────────────────────────── */
[data-app-theme="midnight"] {
    --app-brand: #2a2350;
    --app-bg: #15122a;
    --app-text-muted: #a8a2c8;
    --app-nav-bg: #2a2350;
    --app-nav-text: #ffffff;
    --app-nav-hover: rgba(255,255,255,0.10);
    --app-nav-active: rgba(255,255,255,0.18);
    /* table body — match dark */
    --app-surface: #212529;
    --app-surface-alt: #2b3035;
    --app-text: #e9ecef;
    --app-border: rgba(255,255,255,0.10);
    /* keep midnight purple for page header + card headers */
    --app-card-header: #2a2350;
}

/* ─────────────────────────────────────────────
   SEPIA
───────────────────────────────────────────── */
[data-app-theme="sepia"] {
    --app-brand: #8b6f47;
    --app-bg: #f5ecd4;
    --app-surface: #faf5e8;
    --app-text: #3d2f1f;
    --app-text-muted: #8a7857;
    --app-border: rgba(139,111,71,0.2);
    --app-nav-bg: #8b6f47;
    --app-nav-text: #ffffff;
    --app-nav-hover: rgba(255,255,255,0.15);
    --app-nav-active: rgba(255,255,255,0.25);
    --app-card-header: #8b6f47;
    --app-surface-alt: #f0e6cf;
}

/* ============================================================
   GLOBAL STRUCTURE
   ============================================================ */

html {
    font-size: 14px;
}

body {
    background: var(--app-bg);
    color: var(--app-text);
    overflow-x: hidden;
}

/* ============================================================
   HEADER (TOP NAVBAR)
   ============================================================ */

.app-header {
    background: var(--app-nav-bg) !important;
    border-bottom: 1px solid var(--app-border);
}

    .app-header .nav-link {
        color: var(--app-nav-text) !important;
    }

        .app-header .nav-link:hover {
            background: var(--app-nav-hover);
            border-radius: 0.375rem;
        }

.theme-picker-toggle {
    background: transparent !important;
    border: 1px solid rgba(255,255,255,0.35) !important;
    color: var(--app-nav-text) !important;
}

/* ============================================================
   SIDEBAR
   ============================================================ */

.app-sidebar {
    background: var(--app-nav-bg) !important;
}

    .app-sidebar .nav-link {
        color: var(--app-nav-muted) !important;
        border-radius: 0.4rem;
        margin: 0.15rem 0.25rem;
    }

        .app-sidebar .nav-link:hover {
            background: var(--app-nav-hover);
            color: var(--app-nav-text) !important;
        }

        .app-sidebar .nav-link.active {
            background: var(--app-nav-active);
            color: var(--app-nav-text) !important;
        }

#sidebarLogo {
    transition: all 0.2s ease;
}

.user-panel {
    border-bottom: 1px solid rgba(255,255,255,0.2);
}

.sidebar-mini.sidebar-collapse .main-sidebar:hover,
.sidebar-mini.sidebar-collapse .main-sidebar:hover::before {
    width: 4.6rem !important;
}

.sidebar-mini.sidebar-collapse .content-wrapper,
.sidebar-mini.sidebar-collapse .main-footer,
.sidebar-mini.sidebar-collapse .main-header {
    margin-left: 4.6rem !important;
}

/*The following bellow prevents the sidebar and its content from expanding while hovering over it*/

/* Disable hover-expansion behavior */
.sidebar-mini.sidebar-collapse .main-sidebar:hover,
.sidebar-mini.sidebar-collapse .main-sidebar:hover .brand-link,
.sidebar-mini.sidebar-collapse .main-sidebar:hover .sidebar {
    width: 4.6rem !important;
}

/* Don't reveal text on hover */
.sidebar-mini.sidebar-collapse .main-sidebar:hover .nav-sidebar .nav-link p,
.sidebar-mini.sidebar-collapse .main-sidebar:hover .brand-text,
.sidebar-mini.sidebar-collapse .main-sidebar:hover .user-panel .info {
    display: none !important;
}

@media (max-width: 767.98px) {
    .sidebar-mini.sidebar-collapse .content-wrapper,
    .sidebar-mini.sidebar-collapse .main-footer,
    .sidebar-mini.sidebar-collapse .main-header {
        margin-left: 0 !important;
    }
}


/* ============================================================
   CONTENT AREA
   ============================================================ */
.app-content {
    background: var(--app-bg);
    min-height: 0;
}


/* ============================================================
   CARDS
   ============================================================ */

.card {
    background: var(--app-surface);
    border: 1px solid var(--app-border);
    border-radius: 0.5rem;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
    color: var(--app-text);
}

.card-header {
    background: var(--app-card-header) !important;
    color: #fff !important;
    border: none !important;
}

/* ============================================================
   BUTTONS
   ============================================================ */

.btn-primary {
    background: var(--app-brand);
    border-color: var(--app-brand);
}

    .btn-primary:hover {
        background: var(--app-brand-hover);
    }


/* ============================================================
   TABLES (THEMED)
   ============================================================ */

.flightsTable {
    background: var(--app-surface);
    color: var(--app-text);
    border-collapse: separate;
    border-spacing: 0;
    border: 1px solid var(--app-border);
    width: max-content;
    min-width: 100%;
    font-size: clamp(0.55rem, 0.75vw, 0.85rem);
}

    .flightsTable th,
    .flightsTable td {
        white-space: nowrap;
/*        overflow: hidden;*/
        text-overflow: ellipsis;
        text-align: center;
        padding: 0.3rem 0.2rem;
    }

    .flightsTable thead tr:first-child th {
        font-size: 0.9em;
        padding: 0.2rem 0.15rem;
    }

    .flightsTable thead th {
        background: var(--app-card-header);
        color: #fff;
        position: sticky;
        top: 0;
        z-index: 2;
        font-weight: 600;
        box-shadow: inset 1px 0 0 rgba(255,255,255,0.35), inset -1px 0 0 rgba(255,255,255,0.35), inset 0 1px 0 rgba(255,255,255,0.35), inset 0 -1px 0 rgba(255,255,255,0.35);
    }

    .flightsTable tbody td {
        vertical-align: middle;
        border: 1px solid var(--app-border);
        height: 42px;
        line-height: 1.4;
    }

    .flightsTable tbody tr:nth-child(odd) {
        background: var(--app-surface);
    }

    .flightsTable tbody tr:nth-child(even) {
        background: var(--app-surface-alt);
    }

    .flightsTable tbody tr:hover {
        background: color-mix(in srgb, var(--app-brand) 8%, var(--app-surface));
    }

    /* Add-row / new-row anchors */
    .flightsTable tbody tr.add-flight-row td,
    .flightsTable tbody tr.new-flights-anchor td {
        height: 48px;
        padding-top: 0.75rem;
        padding-bottom: 0.75rem;
    }

    .flightsTable tbody tr.new-flights-anchor td {
        padding: 0 !important;
        height: 20px !important;
    }

    /* Row action buttons */
    .flightsTable .edit-row-btn,
    .flightsTable .delete-button,
    .flightsTable .save-row-btn,
    .flightsTable .cancel-row-btn {
        padding: 0.35rem 0.55rem;
        font-size: 0.8rem;
        line-height: 1;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    /* Control column — keep all action buttons in a tidy horizontal row */
    .flightsTable td[data-field="actions"] {
        white-space: nowrap;
    }

        .flightsTable td[data-field="actions"] .btn {
            margin: 0 0.1rem;
            padding: 0.3rem 0.5rem;
            font-size: 0.8rem;
            line-height: 1;
            vertical-align: middle;
        }

        .flightsTable td[data-field="actions"] .row-status-icon {
            vertical-align: middle;
        }

.flight-logs-body .flight-table-wrapper:not(.d-none) {
    overflow: auto;
}
/* Column widths — second header row (the one with actual field names) */
.flightsTable thead tr:nth-child(2) th {
    /* default: all columns share equally — override specific ones below */
}

    /* Date, Registration, Type, From, To — need more room for text */
    .flightsTable thead tr:nth-child(2) th:nth-child(1),
    .flightsTable thead tr:nth-child(2) th:nth-child(2),
    .flightsTable thead tr:nth-child(2) th:nth-child(3),
    .flightsTable thead tr:nth-child(2) th:nth-child(5),
    .flightsTable thead tr:nth-child(2) th:nth-child(6) {
        width: 5%;
    }

    /* Engines — just a single digit */
    .flightsTable thead tr:nth-child(2) th:nth-child(4) {
        width: 2.5%;
    }

    /* H/M columns (7–28) — 2-digit numbers, squeeze them */
    .flightsTable thead tr:nth-child(2) th:nth-child(n+7):nth-child(-n+28) {
        width: 2.5%;
    }

    /* Actions column (29th) — needs room for buttons */
    .flightsTable thead tr:nth-child(2) th:nth-child(29) {
        width: 8%;
    }
/* ============================================================
   INLINE EDITING — force inputs to respect fixed column widths
   ============================================================ */
.flightsTable tr.new-flight-row td,
.flightsTable tr[data-row-state="editing"] td {
    overflow: hidden;
    max-width: 0; /* lets table-layout: fixed fully control width */
}

.flightsTable tr.new-flight-row input,
.flightsTable tr[data-row-state="editing"] input {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
    padding: 0.15rem 2px;
    font-size: inherit;
}

    /* Date inputs are extra wide by default — override the browser chrome */
    .flightsTable tr.new-flight-row input[type="date"],
    .flightsTable tr[data-row-state="editing"] input[type="date"] {
        min-width: 0;
      
    }

/* Autocomplete dropdown wrapper must not push the cell wider */
.flightsTable tr.new-flight-row .position-relative,
.flightsTable tr[data-row-state="editing"] .position-relative {
    max-width: 100%;
    overflow: visible; /* so the dropdown still floats out */
}
/* ============================================================
   FOOTER
   ============================================================ */

.app-footer {
    background: var(--app-surface);
    border-top: 1px solid var(--app-border);
    color: var(--app-text-muted);
}

/* ============================================================
   MOBILE — COLLAPSIBLE / TIME BREAKDOWN
   ============================================================ */
.collapsible-heading {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    user-select: none;
}

.collapse-chevron {
    transition: transform 0.2s ease;
    margin-left: auto;
}

.collapsible-heading[aria-expanded="true"] .collapse-chevron {
    transform: rotate(180deg);
}

.time-breakdown-item {
    margin-bottom: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--app-border);
}

    .time-breakdown-item:last-child {
        border-bottom: none;
        margin-bottom: 0;
        padding-bottom: 0;
    }

    .time-breakdown-item > .form-label {
        font-weight: 600;
        margin-bottom: 0.25rem;
    }

/* ============================================================
   MOBILE FLIGHT MODAL
   ============================================================ */
.mobile-flight-modal .section-heading {
    background-color: var(--app-card-header);
    color: #fff;
    padding: 0.65rem 0.85rem;
    border-radius: 0.375rem;
    margin: 0 0 0.85rem 0;
    font-size: 0.95rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

    .mobile-flight-modal .section-heading i {
        font-size: 1rem;
    }

/* Collapsible heading variant — same header bar, shows it's tappable */
.mobile-flight-modal .collapsible-heading {
    cursor: pointer;
    user-select: none;
    transition: background-color 0.15s ease;
}

    .mobile-flight-modal .collapsible-heading:hover,
    .mobile-flight-modal .collapsible-heading:active {
        background-color: var(--app-brand-hover);
    }

.mobile-flight-modal .collapse-chevron {
    margin-left: auto;
    transition: transform 0.2s ease;
}

.mobile-flight-modal .collapsible-heading[aria-expanded="true"] .collapse-chevron {
    transform: rotate(180deg);
}

/* Section spacing */
.mobile-flight-modal .mobile-form-section {
    margin-bottom: 1.25rem;
}

    .mobile-flight-modal .mobile-form-section:last-child {
        margin-bottom: 0;
    }

.mobile-flight-modal .modal-header {
    background-color: var(--app-card-header);
    color: #fff;
    border-bottom: none;
}

    .mobile-flight-modal .modal-header .modal-title {
        color: #fff;
        font-weight: 600;
    }

    /* Make the close X visible on the dark header */
    .mobile-flight-modal .modal-header .close {
        color: #fff;
        text-shadow: none;
        opacity: 0.9;
    }

        .mobile-flight-modal .modal-header .close:hover {
            opacity: 1;
        }

/* The modal body/content should follow the theme surface */
.mobile-flight-modal {
    background: var(--app-surface);
    color: var(--app-text);
}

/* ============================================================
   MOBILE FLIGHT CARD VIEW
   ============================================================ */
.mobile-month-header {
    background-color: var(--app-card-header);
    color: #fff;
    padding: 0.5rem 0.85rem;
    border-radius: 0.375rem;
    margin: 1rem 0 0.5rem 0;
    font-weight: 600;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.flight-card {
    background: var(--app-surface);
    border: 1px solid var(--app-border);
    border-radius: 0.5rem;
    padding: 0.85rem 1rem;
    margin-bottom: 0.5rem;
    cursor: pointer;
    transition: box-shadow 0.15s ease, transform 0.05s ease;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}

    .flight-card:hover {
        box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    }

    .flight-card:active {
        transform: scale(0.98);
    }

.flight-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.4rem;
}

.flight-card-date {
    font-weight: 600;
    color: var(--app-brand);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.flight-card-reg {
    font-family: monospace;
    font-size: 0.95rem;
    color: var(--app-text);
    background: var(--app-surface-alt);
    padding: 0.15rem 0.5rem;
    border-radius: 0.25rem;
}

.flight-card-route {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--app-text);
    margin: 0.5rem 0;
    padding: 0.4rem 0;
    border-top: 1px solid var(--app-border);
    border-bottom: 1px solid var(--app-border);
}

    .flight-card-route .airport {
        font-family: monospace;
        letter-spacing: 0.05em;
    }

    .flight-card-route .bi-arrow-right {
        color: var(--app-brand);
    }

.flight-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.4rem;
    font-size: 0.9rem;
    color: var(--app-text-muted);
}

.flight-card-total {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-weight: 500;
}

    .flight-card-total .bi-clock {
        color: var(--app-brand);
    }

/* Detail modal list styling */
.detail-list {
    margin: 0;
    display: grid;
    grid-template-columns: 40% 60%;
    gap: 0.4rem 0.75rem;
}

    .detail-list dt {
        font-weight: 500;
        color: var(--app-text-muted);
        font-size: 0.9rem;
    }

    .detail-list dd {
        margin: 0;
        color: var(--app-text);
        font-weight: 500;
        word-break: break-word;
    }

        .detail-list dd:empty::before {
            content: "—";
            color: var(--app-text-muted);
            opacity: 0.5;
        }

.detail-time-row {
    font-family: monospace;
    font-size: 1rem;
    font-weight: 500;
    color: var(--app-text);
}

    .detail-time-row:empty::before {
        content: "—";
        color: var(--app-text-muted);
        opacity: 0.5;
        font-family: inherit;
    }

.detail-list dd.time-edit-row .row {
    margin: 0;
}

.detail-list dd.time-edit-row input {
    text-align: center;
}
@media (max-width: 767.98px) {
    /* AdminLTE's layout-fixed pins heights; let mobile scroll naturally */
    html, body {
        overflow-y: auto !important;
        height: auto !important;
    }

    .wrapper,
    .content-wrapper {
        overflow-y: visible !important;
        height: auto !important;
        min-height: 100vh;
    }
}
/* ============================================================
   DESKTOP / MOBILE VISIBILITY TOGGLE
   ============================================================ */
.desktop-only {
    display: block;
}

.mobile-only {
    display: none;
}

@media (max-width: 767.98px) {
    .desktop-only {
        display: none !important;
    }

    .mobile-only {
        display: block !important;
    }

    /* ============================================================
       PAGE HEADER (the card-header at the top of the list)
       ============================================================ */

    /* Stack title column and form column vertically */
    .card-header .d-flex.flex-wrap.align-items-start {
        flex-direction: column;
        align-items: stretch !important;
        gap: 0.5rem;
    }

    /* Title + Add button column takes full width */
    .card-header .d-flex.flex-column {
        width: 100%;
        margin: 0 !important;
    }

    /* Title sizing so long titles don't overflow */
    .card-header h2 {
        font-size: 1.5rem;
        margin-bottom: 0.5rem !important;
    }

    /* Add button full width */
    .card-header .btn-header.align-self-start {
        align-self: stretch !important;
        width: 100%;
    }

    /* Search/filter form full width, no auto-margin pushing it right */
    .card-header form.ml-md-auto {
        margin-left: 0 !important;
        width: 100%;
    }

    /* Inside the form, stack the inputs/buttons vertically */
    .card-header form .d-flex.flex-wrap {
        flex-direction: column;
        align-items: stretch !important;
    }

    /* Filter label on its own line, full width */
    .card-header form label {
        margin-right: 0 !important;
        margin-bottom: 0.25rem !important;
        width: 100%;
    }

    /* Filter dropdown full width */
    .card-header form select.form-control {
        width: 100% !important;
        margin-right: 0 !important;
        margin-bottom: 0.5rem !important;
    }

    /* Search input and form buttons full width */
    .card-header form .form-control,
    .card-header form .btn {
        margin-right: 0 !important;
        margin-bottom: 0.5rem;
        width: 100%;
    }
    /* Search input wrapper: override the inline width:280px so it
   matches the full-width button instead of staying at 280px */
    .card-header form .position-relative {
        width: 100% !important;
    }
    .card-fill .table-responsive thead th {
        position: sticky;
        top: 0;
        z-index: 20;
        background: var(--app-card-header);
        color: #fff;
        box-shadow: inset 0 -1px 0 var(--app-border);
    }

    /* ============================================================
       MOBILE ENTITY CARDS (Airport, Aircraft, AircraftType)
       ============================================================ */

    .entity-card-name {
        font-weight: 600;
        font-size: 1rem;
    }

    .entity-card-meta div {
        margin-bottom: 0.15rem;
    }

    /* Card header strip — themed */
    .entity-card-header {
        background-color: var(--app-card-header);
        color: #fff;
        padding: 0.75rem 1rem !important;
        gap: 0.75rem;
    }

        .entity-card-header .entity-card-name {
            color: #fff;
            line-height: 1.2;
        }

        .entity-card-header .badge.badge-light {
            background-color: rgba(255, 255, 255, 0.9);
            color: var(--app-card-header);
            font-weight: 600;
        }

        /* Action buttons: horizontal row in the corner instead of stacked */
        .entity-card-header .d-flex.flex-column {
            flex-direction: row !important;
            flex-wrap: wrap;
            justify-content: flex-end;
            gap: 0.25rem;
            flex-shrink: 0;
            width: auto !important; /* override the page-header width:100% rule above */
        }

            .entity-card-header .d-flex.flex-column .btn {
                margin: 0 !important;
                padding: 0.25rem 0.5rem;
                font-size: 0.85rem;
                width: auto !important; /* override the form-button width:100% rule above */
            }

        /* Title area: allow long names to wrap rather than push buttons off-screen */
        .entity-card-header .flex-grow-1 {
            min-width: 0;
        }

    /* Badge row inside the card header */
    .entity-card-codes {
        display: flex;
        flex-wrap: wrap;
        gap: 0.25rem;
    }

        .entity-card-codes .badge {
            margin: 0 !important;
            white-space: normal;
            text-align: left;
        }
    .mobile-fab {
        position: fixed;
        right: 1rem;
        bottom: 1rem;
        width: 56px;
        height: 56px;
        border-radius: 50%;
        background: var(--app-brand);
        color: #fff;
        border: none;
        box-shadow: 0 4px 12px rgba(0,0,0,0.3);
        font-size: 1.6rem;
        display: flex;
        align-items: center;
        justify-content: center;
        z-index: 1040;
    }

        .mobile-fab:hover,
        .mobile-fab:active {
            background: var(--app-brand-hover);
        }
}
/* ============================================================
   DASHBOARD — make AdminLTE stat boxes follow the theme
   ============================================================ */
.small-box.bg-gradient-cyan {
    background: var(--app-card-header) !important;
    background-image: none !important;
    color: #fff !important;
}

    .small-box.bg-gradient-cyan .icon i,
    .small-box.bg-gradient-cyan h3,
    .small-box.bg-gradient-cyan p {
        color: #fff !important;
    }

    /* footer strip — slightly darker than the box */
    .small-box.bg-gradient-cyan .small-box-footer {
        background: rgba(0,0,0,0.15) !important;
        color: rgba(255,255,255,0.9) !important;
    }

        .small-box.bg-gradient-cyan .small-box-footer:hover {
            background: rgba(0,0,0,0.25) !important;
            color: #fff !important;
        }

/* Info-box icon squares */
.info-box .info-box-icon.bg-info {
    background: var(--app-brand) !important;
    color: #fff !important;
}

/* Info-box body should follow the surface, not stay white */
.info-box {
    background: var(--app-surface) !important;
    color: var(--app-text) !important;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

    .info-box .info-box-text {
        color: var(--app-text-muted) !important;
    }

    .info-box .info-box-number {
        color: var(--app-text) !important;
    }
.small-box .icon i {
    opacity: 0.3;
}

.small-box.bg-gradient-cyan {
    background: var(--app-card-header) !important;
    background-image: none !important;
}
/* ============================================================
   THEME COMPLETION
   ------------------------------------------------------------
   Append this to your existing site stylesheet (the file with
   the --app-* variables). It fills the gaps where Bootstrap /
   AdminLTE defaults were showing through instead of the theme.

   Nothing here requires editing any .cshtml file — every rule
   targets classes that already exist in the markup.
   ============================================================ */


/* ============================================================
   BUTTONS — full theme coverage
   (base stylesheet only themed .btn-primary)
   ============================================================ */

.btn-primary,
.btn-info {
    background: var(--app-brand);
    border-color: var(--app-brand);
    color: var(--app-brand-text, #fff);
}

    .btn-primary:hover,
    .btn-info:hover,
    .btn-primary:focus,
    .btn-info:focus {
        background: var(--app-brand-hover);
        border-color: var(--app-brand-hover);
        color: var(--app-brand-text, #fff);
    }

/* Success — uses brand-alt where a theme defines it, else a green */
.btn-success {
    background: var(--app-brand-alt, #2d7d46);
    border-color: var(--app-brand-alt, #2d7d46);
    color: #fff;
}

    .btn-success:hover,
    .btn-success:focus {
        background: color-mix(in srgb, var(--app-brand-alt, #2d7d46) 85%, #000);
        border-color: color-mix(in srgb, var(--app-brand-alt, #2d7d46) 85%, #000);
        color: #fff;
    }

/* Secondary / outline-secondary — neutral surface tone */
.btn-secondary,
.btn-outline-secondary {
    background: var(--app-surface-alt);
    border: 1px solid color-mix(in srgb, var(--app-text) 28%, transparent);
    color: var(--app-text);
}

    .btn-secondary:hover,
    .btn-outline-secondary:hover,
    .btn-secondary:focus,
    .btn-outline-secondary:focus {
        background: color-mix(in srgb, var(--app-text) 12%, var(--app-surface-alt));
        border-color: color-mix(in srgb, var(--app-text) 40%, transparent);
        color: var(--app-text);
    }

/* Danger stays red on purpose — destructive actions should read
   as red in every theme. Only the hover is normalized. */
.btn-danger:hover,
.btn-danger:focus {
    filter: brightness(0.92);
}

/* btn-header — the translucent button on the page header bar */
.btn-header {
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.35);
    color: #fff;
}

    .btn-header:hover,
    .btn-header:focus {
        background: rgba(255,255,255,0.25);
        color: #fff;
    }


/* ============================================================
   CARDS — info / primary / outline variants follow the theme
   ============================================================ */

.card-info > .card-header,
.card-primary > .card-header {
    background: var(--app-card-header) !important;
    color: #fff !important;
}

.card-primary.card-outline {
    border-top: 3px solid var(--app-brand);
}

.card-info .card-title,
.card-primary .card-title {
    color: #fff;
}


/* ============================================================
   NAV PILLS / ACCOUNT-PAGE TABS (.btn-secondary-me)
   ------------------------------------------------------------
   btn-secondary-me is a custom class with no base-stylesheet
   rule, so these tabs were showing Bootstrap defaults.
   ============================================================ */

.nav-pills .nav-link {
    color: var(--app-text);
    background: transparent;
}

    .nav-pills .nav-link:hover {
        background: var(--app-surface-alt);
    }

    .nav-pills .nav-link.btn-secondary-me {
        background: var(--app-surface-alt);
        color: var(--app-text);
        border: 1px solid var(--app-border);
        margin-right: 0.25rem;
        font-weight: 500;
    }

        .nav-pills .nav-link.btn-secondary-me:hover {
            background: color-mix(in srgb, var(--app-brand) 12%, var(--app-surface-alt));
            color: var(--app-text);
        }

        /* Active tab — !important needed to beat Bootstrap's own
   high-specificity .nav-pills .nav-link.active rule. */
        .nav-pills .nav-link.active,
        .nav-pills .nav-link.btn-secondary-me.active {
            background: var(--app-brand) !important;
            border-color: var(--app-brand) !important;
            color: #fff !important;
        }


/* ============================================================
   SIDEBAR USER PANEL — username link follows the theme
   ------------------------------------------------------------
   The link is `.d-block.text-truncate` inside `.user-panel`,
   not a `.nav-link`, so the base sidebar rules never hit it.
   Both `.app-sidebar` and `.sidebar` are targeted so it works
   regardless of which is the sidebar root element.
   ============================================================ */

.app-sidebar .user-panel .info a,
.sidebar .user-panel .info a {
    color: var(--app-nav-text) !important;
    text-decoration: none;
    /* match the nav-link hover target shape */
    border-radius: 0.4rem;
    padding: 0.35rem 0.5rem;
    transition: background-color 0.15s ease;
}

    .app-sidebar .user-panel .info a:hover,
    .sidebar .user-panel .info a:hover,
    .app-sidebar .user-panel .info a:focus,
    .sidebar .user-panel .info a:focus {
        background: var(--app-nav-hover);
        color: var(--app-nav-text) !important;
        text-decoration: none;
    }
 


/* ============================================================
   COLUMN-HEADER FILTER DROPDOWNS
   ------------------------------------------------------------
   The base stylesheet had no rules for the filter UI, so the
   dropdown rendered as a horizontal strip inside the nowrap
   centered <th>. These rules float it as a vertical list.
   ============================================================ */

.filterable-header {
    position: relative; /* anchor for the absolute dropdown */
    cursor: pointer;
    white-space: nowrap;
}

.filter-icon {
    margin-left: 0.35rem;
    font-size: 0.75rem;
    opacity: 0.6;
}

.filterable-header.has-active-filter .filter-icon {
    opacity: 1;
    color: #ffd84d; /* highlight when a filter is set */
}

.filter-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 1000;
    min-width: 220px;
    max-width: 300px;
    background: var(--app-surface);
    color: var(--app-text);
    border: 1px solid var(--app-border);
    border-radius: 0.375rem;
    box-shadow: 0 4px 16px rgba(0,0,0,0.18);
    padding: 0.5rem;
    text-align: left; /* override the th's center align */
    white-space: normal; /* override the th's nowrap */
    font-weight: 400;
}

    .filter-dropdown .filter-search {
        margin-bottom: 0.4rem;
    }

.filter-options {
    max-height: 220px;
    overflow-y: auto;
    display: flex; /* stack options vertically */
    flex-direction: column;
    gap: 0.1rem;
}

.filter-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
    padding: 0.25rem 0.35rem;
    border-radius: 0.25rem;
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--app-text);
}

    .filter-option:hover {
        background: var(--app-surface-alt);
    }

    .filter-option input[type="checkbox"] {
        margin: 0;
        flex-shrink: 0;
    }

.filter-actions {
    display: flex;
    justify-content: flex-end;
    border-top: 1px solid var(--app-border);
    margin-top: 0.4rem;
    padding-top: 0.35rem;
}
.app-sidebar .user-panel,
.sidebar .user-panel {
    border-bottom: none;
}
/* kill the border of the element directly above the user panel */
.app-sidebar .brand-link,
.sidebar .brand-link {
    border-bottom: none;
}
/* ============================================================
   LOCKED CARD — header + footer fixed, body scrolls
   ============================================================ */
/* Locked-card layout is a DESKTOP pattern only.
   On mobile the page scrolls normally and card lists flow. */
@media (min-width: 768px) {
    .card-fill {
        display: flex;
        flex-direction: column;
        max-height: calc(100vh - 57px - 46px - 0.5rem);
        overflow: auto;
    }

        .card-fill .card-body {
            flex: 1;
            overflow: auto;
            min-height: 0;
        }
}
    .card-fill .table-responsive thead th {
        position: sticky;
        top: 0;
        z-index: 20;
        background: var(--app-surface);
        color: var(--app-card-header);
        font-weight: 600;
        box-shadow: inset 0 -1px 0 var(--app-border);
    }

[data-app-theme="dark"] .card-fill .table-responsive thead th,
[data-app-theme="midnight"] .card-fill .table-responsive thead th {
    color: #fff;
}

.btn-header-outline {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.6);
    color: #fff;
}

    .btn-header-outline:hover,
    .btn-header-outline:focus {
        background: rgba(255,255,255,0.15);
        color: #fff;
    }
tr.new-flight-row input[type="number"],
tr.new-flight-row input[type="text"],
tr.new-flight-row input[type="date"] {
    min-width: 0;
    width: 100%;
    padding-left: 2px;
    padding-right: 2px;
}
/* ============================================================
   FLIGHT TABLE FOOTER LABELS
   ------------------------------------------------------------
   The "Page Total / Previous Page Total / Total To Date" label
   cells are <th> elements inside <tbody>. In create/edit mode the
   row inputs widen the data columns and steal width from these
   label cells, which makes long translated strings (e.g. Spanish
   "Total hasta la página anterior:") wrap to 3 lines and break
   the footer layout. Forcing nowrap keeps them on one line.
   ============================================================ */
.flightsTable tbody th {
    white-space: nowrap;
}


/* Tighten cells so the table starts smaller before scaling */
/*@media (max-width: 1600px) {
    .flightsTable {
        font-size: 0.78rem;
    }

        .flightsTable tbody td,
        .flightsTable thead th {
            padding: 0.35rem 0.25rem;
        }
}*/
/* Ensure flight table wrappers scroll horizontally */
.flight-table-wrapper.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.app-sidebar .brand-link {
    height: 3.5rem !important;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 0 !important;
    line-height: normal !important;
}

    .app-sidebar .brand-link img {
        height: 3rem !important;
        max-width: 100% !important;
        object-fit: contain;
    }
.login-logo {
    margin-bottom: 0;
    padding-bottom: .5rem;
}

.login-box .card {
    margin-top: 0;
}
/* ============================================================
   DASHBOARD — MOBILE FIT (all phones, down to 320px)
   ============================================================ */
.login-logo {
    margin-bottom: 0;
    padding-bottom: .5rem;
}

.login-box .card {
    margin-top: 0;
}

@media (max-width: 767.98px) {

    /* ---- Content area: prevent any horizontal overflow ---- */
    .content,
    .content .container-fluid {
        padding-left: 0.4rem;
        padding-right: 0.4rem;
        overflow-x: hidden;
    }

        /* ---- Stat-box grid: tighter gutters ---- */
        .content .row {
            margin-left: -0.3rem;
            margin-right: -0.3rem;
        }

            .content .row > [class*="col-"] {
                padding-left: 0.3rem;
                padding-right: 0.3rem;
            }

    /* ---- Stat boxes ---- */
    .small-box {
        margin-bottom: 0.5rem;
        min-height: 0;
        overflow: hidden;
        border-radius: 0.4rem;
    }

        .small-box .inner {
            padding: 0.55rem 0.5rem;
        }

            .small-box .inner h3 {
                font-size: clamp(0.95rem, 4.5vw, 1.5rem);
                margin-bottom: 0.1rem;
                white-space: nowrap;
                overflow: hidden;
                text-overflow: ellipsis;
            }

            .small-box .inner p {
                font-size: clamp(0.65rem, 2.5vw, 0.85rem);
                margin-bottom: 0;
                white-space: nowrap;
                overflow: hidden;
                text-overflow: ellipsis;
            }

        .small-box .icon {
            display: none; /* free up horizontal space */
        }

        .small-box .small-box-footer {
            font-size: 0.75rem;
            padding: 0.3rem 0.5rem;
        }

    /* ---- Info boxes: full width on mobile ---- */
    .content .row > .col-md-4 {
        flex: 0 0 100%;
        max-width: 100%;
    }

    .info-box {
        margin-bottom: 0.5rem;
        min-width: 0;
        overflow: hidden;
    }

        .info-box .info-box-icon {
            width: 55px;
            min-width: 55px;
            height: 55px;
            font-size: 1.2rem;
            line-height: 55px;
        }

        .info-box .info-box-content {
            padding: 0.35rem 0.6rem;
            min-width: 0; /* let flexbox shrink text */
        }

        .info-box .info-box-text {
            font-size: 0.78rem;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .info-box .info-box-number {
            font-size: 1rem;
        }

    /* ---- Page header ---- */
    .content-header {
        padding: 0.5rem 0;
    }

        .content-header h1 {
            font-size: clamp(1.1rem, 4vw, 1.4rem);
        }

        .content-header .breadcrumb {
            font-size: 0.75rem;
            margin-bottom: 0;
        }
}

/* ---- Very small phones (SE, Galaxy A01, etc.) ---- */
@media (max-width: 359px) {

    .small-box .inner h3 {
        font-size: 0.85rem;
    }

    .small-box .inner p {
        font-size: 0.6rem;
    }

    .small-box .inner {
        padding: 0.4rem;
    }

    .small-box .small-box-footer {
        font-size: 0.7rem;
        padding: 0.25rem 0.4rem;
    }
}
/* ============================================================
   SPONSOR BANNER IN FOOTER — remove extra spacing
   ============================================================ */
.app-footer {
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
}

    .app-footer #sponsor-banners {
        margin-bottom: 0.35rem;
    }

        .app-footer #sponsor-banners .carousel-item a {
            padding: 0;
            line-height: 0;
        }

.footer-version-text {
    color: var(--app-brand) !important;
}

@media (max-width: 767.98px) {
    .app-sidebar .bottom-div {
        color: #fff;
    }
}
@media (max-width: 767.98px) {
    .card-header .nav-pills {
        flex-wrap: nowrap;
        gap: 0.25rem;
    }

        .card-header .nav-pills .nav-link.btn-secondary-me {
            margin-right: 0;
            padding: 0.3rem 0.4rem;
            font-size: 1rem;
            white-space: nowrap;
            text-align: center;
            flex: 1 1 0;
        }
}

.impersonation-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 2000;
    background: #ffc107;
    color: #1f2d3d;
    text-align: center;
    padding: 8px 12px;
    font-size: .9rem;
    box-shadow: 0 -2px 6px rgba(0,0,0,.25);
}

    .impersonation-banner a {
        color: #0b3d91;
        font-weight: 600;
        text-decoration: underline;
        margin-left: 8px;
    }

body.is-impersonating .wrapper {
    padding-bottom: 44px;
}
.filterable-header {
    overflow: visible;
}

/* full size by default (desktop) */
.pilot-contact-text {
    font-size: 1rem;
}

/* shrink below the lg breakpoint (mobile/tablet) */
@media (max-width: 991.98px) {
    .pilot-contact-text {
        font-size: 0.79rem;
    }
}

/* Account-page tabs sit ON the colored card-header bar */
.card-header .nav-pills .nav-link.btn-secondary-me {
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.45);
    color: #fff;
}

    .card-header .nav-pills .nav-link.btn-secondary-me:hover {
        background: rgba(255,255,255,0.28);
        color: #fff;
    }

    /* Active tab — solid white box, brand-colored text, so it stands out
   against the bar instead of blending into it */
    .card-header .nav-pills .nav-link.active,
    .card-header .nav-pills .nav-link.btn-secondary-me.active {
        background: #fff !important;
        border-color: #fff !important;
        color: var(--app-brand) !important;
    }
/* ---- Info boxes: 2-up on mobile ---- */
/*.content .row > .col-md-4 {
    flex: 0 0 50%;
    max-width: 50%;
}
*/
/* Center hours/minutes (and other number) inputs in create/edit flows */
.flightsTable tr.new-flight-row input[type="number"],
.flightsTable tr[data-row-state="editing"] input[type="number"],
.mobile-flight-modal .time-row input[type="number"],
.mobile-flight-modal .time-breakdown-item input[type="number"] {
    text-align: center;
}