/* AMX Roster — crew directory + professional profile card */

.amx-roster-page .home-hero__lead { max-width: 36rem; }

.amx-roster.home-section--light {
    background: #fff;
    padding-top: 4.25rem;
    padding-bottom: 4.25rem;
}

.amx-roster__wrap {
    max-width: 72rem;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.amx-roster__tools {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    margin-bottom: 1.25rem;
}

@media (min-width: 1024px) {
    .amx-roster__tools { flex-direction: row; align-items: stretch; }
}

.amx-roster__search {
    position: relative;
    flex: 1;
}

.amx-roster__search i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    pointer-events: none;
}

.amx-roster__search input,
.amx-roster__filter select {
    width: 100%;
    height: 3.15rem;
    padding: 0 1rem 0 2.75rem;
    border-radius: 0.9rem;
    border: 1px solid rgba(3, 13, 117, 0.1);
    background: #fff;
    outline: none;
    font-weight: 600;
    color: #030d75;
    box-shadow: 0 8px 24px rgba(2, 12, 65, 0.04);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.amx-roster__filter select {
    padding-left: 1rem;
    cursor: pointer;
    min-width: 13rem;
}

.amx-roster__search input:focus,
.amx-roster__filter select:focus {
    border-color: #fa0073;
    box-shadow: 0 0 0 4px rgba(250, 0, 115, 0.1);
}

.amx-roster__panel {
    border: 1px solid rgba(3, 13, 117, 0.08);
    border-radius: 1.5rem;
    overflow: hidden;
    background: #fff;
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.8) inset,
        0 22px 56px rgba(2, 12, 65, 0.08);
}

.amx-roster__scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.compact-roster-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    min-width: 720px;
}

.compact-roster-table thead th {
    padding: 0.95rem 1.1rem;
    text-align: left;
    font-family: 'Space Grotesk', ui-sans-serif, system-ui, sans-serif;
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    background: #020c41;
    color: rgba(255, 255, 255, 0.78);
    position: sticky;
    top: 0;
    z-index: 10;
    border-bottom: 2px solid #fa0073;
}

.compact-roster-table thead th.text-center,
.compact-roster-table tbody td.text-center { text-align: center; }
.compact-roster-table thead th:first-child { padding-left: 1.35rem; }

/* Center category columns (callsign → status); keep Pilot left */
.compact-roster-table thead th:not(:first-child),
.compact-roster-table tbody td:not(:first-child) {
    text-align: center;
}

.compact-roster-table tbody td:not(:first-child) > .roster-rank,
.compact-roster-table tbody td:not(:first-child) > .roster-callsign,
.compact-roster-table tbody td:not(:first-child) > .roster-status,
.compact-roster-table tbody td:not(:first-child) > .roster-meta {
    margin-left: auto;
    margin-right: auto;
}

.compact-roster-table tbody tr {
    cursor: pointer;
    transition: background 0.2s ease;
    background: #fff;
}

.compact-roster-table tbody tr + tr td {
    border-top: 1px solid rgba(3, 13, 117, 0.06);
}

.compact-roster-table tbody tr:hover {
    background: linear-gradient(90deg, rgba(250, 0, 115, 0.05), rgba(3, 13, 117, 0.025));
}

.compact-roster-table tbody tr:active {
    background: rgba(250, 0, 115, 0.07);
}

.compact-roster-table tbody td {
    padding: 0.85rem 1rem;
    font-size: 0.875rem;
    vertical-align: middle;
}

.compact-roster-table tbody td:first-child { padding-left: 1.35rem; }

.roster-pilot {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 0;
}

.roster-pilot__name {
    font-weight: 700;
    color: #020c41;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 14rem;
}

.roster-pilot__id {
    font-size: 0.6875rem;
    font-weight: 600;
    color: #94a3b8;
    letter-spacing: 0.02em;
}

.roster-callsign {
    display: inline-flex;
    padding: 0.35rem 0.7rem;
    border-radius: 0.5rem;
    background: #020c41;
    color: #fff;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-weight: 700;
    font-size: 0.8125rem;
    letter-spacing: 0.03em;
}

.roster-rank {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    margin-left: auto;
    margin-right: auto;
    text-align: center;
    max-width: 100%;
}

.roster-rank__name {
    font-size: 0.8125rem;
    font-weight: 600;
    color: #334155;
    line-height: 1.25;
    text-align: center;
    white-space: nowrap;
}

.roster-rank-img {
    height: 1.4rem;
    width: auto;
    max-width: 3.5rem;
    object-fit: contain;
    object-position: center;
    display: block;
}

.roster-meta {
    color: #64748b;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.roster-meta--mono {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    color: #030d75;
}

.roster-status {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.3rem 0.7rem;
    border-radius: 999px;
    font-size: 0.6875rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    white-space: nowrap;
}

.roster-status--active {
    color: #047857;
    background: rgba(16, 185, 129, 0.12);
}

.roster-status--pending {
    color: #b45309;
    background: rgba(245, 158, 11, 0.14);
}

.roster-status--inactive {
    color: #475569;
    background: rgba(100, 116, 139, 0.12);
}

.roster-status--suspended,
.roster-status--on-leave {
    color: #b91c1c;
    background: rgba(239, 68, 68, 0.12);
}

.roster-empty {
    text-align: center;
    padding: 3.5rem 1.5rem !important;
    color: #94a3b8;
}

.roster-empty i {
    display: block;
    font-size: 2.25rem;
    margin-bottom: 0.85rem;
    color: #cbd5e1;
}

.network-offline {
    background: linear-gradient(135deg, #6b7280, #9ca3af);
    color: #fff;
}

/* —— Modern pilot profile modal —— */
.profile-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(2, 12, 65, 0.72);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.25s ease;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
    overflow-y: auto;
}

.profile-overlay.active {
    display: flex;
    opacity: 1;
}

.profile-shell {
    position: relative;
    width: min(100%, 28rem);
    transform: translateY(16px);
    transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.profile-overlay.active .profile-shell {
    transform: translateY(0);
}

.profile-close {
    position: absolute;
    top: 0.85rem;
    right: 0.85rem;
    z-index: 3;
    width: 2.15rem;
    height: 2.15rem;
    border: none;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s;
}

.profile-close:hover {
    background: #fa0073;
}

.profile-modal {
    background: #fff;
    border-radius: 1.35rem;
    overflow: hidden;
    box-shadow: 0 28px 64px rgba(2, 12, 65, 0.32);
}

.profile-modal__hero {
    position: relative;
    padding: 1.5rem 1.35rem 1.25rem;
    background:
        radial-gradient(ellipse 70% 90% at 100% 0%, rgba(250, 0, 115, 0.28), transparent 55%),
        linear-gradient(135deg, #020c41 0%, #030d75 55%, #05124a 100%);
    color: #fff;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow: hidden;
}

.profile-modal__logo-bg {
    position: absolute;
    left: 50%;
    top: 52%;
    transform: translate(-50%, -50%);
    width: min(55%, 9.5rem);
    height: auto;
    object-fit: contain;
    opacity: 0.16;
    pointer-events: none;
    user-select: none;
    z-index: 0;
}

.profile-modal__hero > *:not(.profile-modal__logo-bg) {
    position: relative;
    z-index: 1;
}

.profile-modal__name {
    margin: 0 0 0.4rem;
    padding: 0 2rem;
    font-family: 'Space Grotesk', ui-sans-serif, system-ui, sans-serif;
    font-size: 1.45rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.15;
    color: #fff;
    text-align: center;
}

.profile-modal__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.35rem 0.55rem;
    margin-bottom: 0.85rem;
    font-size: 0.8125rem;
    color: rgba(255, 255, 255, 0.78);
    text-align: center;
}

.profile-modal__meta .mono {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-weight: 700;
    color: #fff;
}

.profile-modal__meta .sep { opacity: 0.4; }

.profile-modal__badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    align-items: center;
    justify-content: center;
}

.profile-rank-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.3rem 0.65rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    font-size: 0.72rem;
    font-weight: 700;
    color: #fff;
}

.profile-rank-pill img {
    height: 1rem;
    width: auto;
    max-width: 2.5rem;
    object-fit: contain;
}

.profile-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.3rem 0.65rem;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
}

.profile-status-pill.status-active {
    background: rgba(16, 185, 129, 0.28);
    border-color: rgba(110, 231, 183, 0.4);
}

.profile-status-pill.status-pending {
    background: rgba(245, 158, 11, 0.28);
    border-color: rgba(252, 211, 77, 0.4);
}

.profile-status-pill.status-suspended,
.profile-status-pill.status-on-leave {
    background: rgba(239, 68, 68, 0.28);
    border-color: rgba(252, 165, 165, 0.4);
}

.profile-modal__body {
    padding: 1.1rem 1.2rem 1.25rem;
}

.profile-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.55rem;
    margin-bottom: 1rem;
}

.profile-stat {
    text-align: center;
    padding: 0.75rem 0.4rem;
    border-radius: 0.85rem;
    background: #f8fafc;
    border: 1px solid rgba(3, 13, 117, 0.06);
}

.profile-stat strong {
    display: block;
    font-family: 'Space Grotesk', ui-sans-serif, system-ui, sans-serif;
    font-size: 1.05rem;
    font-weight: 700;
    color: #020c41;
    letter-spacing: -0.02em;
}

.profile-stat span {
    font-size: 0.575rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #64748b;
}

.profile-locs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.55rem;
    margin-bottom: 0.9rem;
}

.profile-loc {
    padding: 0.75rem 0.85rem;
    border-radius: 0.85rem;
    background: #f8fafc;
    border: 1px solid rgba(3, 13, 117, 0.06);
    text-align: center;
}

.profile-loc__label {
    display: block;
    margin-bottom: 0.25rem;
    font-size: 0.575rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #94a3b8;
    text-align: center;
}

.profile-loc__icao {
    margin: 0;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 1rem;
    font-weight: 800;
    color: #020c41;
    text-align: center;
}

.profile-loc__name {
    margin: 0.2rem 0 0;
    font-size: 0.7rem;
    font-weight: 600;
    color: #64748b;
    line-height: 1.3;
    text-align: center;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.profile-networks {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 0.9rem;
    justify-content: center;
}

.network-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.65rem;
    border-radius: 0.55rem;
    font-size: 0.7rem;
    font-weight: 800;
}

.network-ivao {
    background: linear-gradient(135deg, #1e40af, #3b82f6);
    color: #fff;
}

.network-vatsim {
    background: linear-gradient(135deg, #047857, #10b981);
    color: #fff;
}

.network-badge-logo {
    height: 14px;
    width: auto;
    object-fit: contain;
    flex-shrink: 0;
}

.profile-tabs {
    display: flex;
    gap: 0.35rem;
    margin-bottom: 0.9rem;
    padding: 0.25rem;
    background: #f1f5f9;
    border-radius: 0.75rem;
}

.profile-overview.hidden {
    display: none;
}

.profile-tab {
    flex: 1;
    padding: 0.55rem 0.5rem;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #64748b;
    background: transparent;
    border: none;
    border-radius: 0.55rem;
    cursor: pointer;
    transition: color 0.2s, background 0.2s;
}

.profile-tab:hover { color: #030d75; }

.profile-tab.profile-tab--active {
    color: #020c41;
    background: #fff;
    box-shadow: 0 2px 8px rgba(2, 12, 65, 0.08);
}

.profile-body { padding: 0; }

.profile-flights-table {
    width: 100%;
    border-collapse: collapse;
}

.profile-flights-th {
    padding: 0.5rem 0.45rem;
    font-size: 0.55rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #64748b;
    background: #f1f5f9;
    text-align: left;
}

.profile-flights-table tbody tr {
    border-bottom: 1px solid #eef2f7;
}

.profile-flights-table tbody td {
    padding: 0.5rem 0.45rem;
    font-size: 0.72rem;
    color: #334155;
}

.profile-flights-table .flight-network img {
    height: 14px;
    width: auto;
    vertical-align: middle;
}

.profile-tab-panel.profile-tab-panel--fullwidth {
    margin: 0;
    padding: 0;
}

/* keep hidden hooks for JS */
.profile-avatar-container-hidden { display: none !important; }

@media (max-width: 560px) {
    .profile-shell { width: min(100%, 100%); }
    .profile-locs { grid-template-columns: 1fr; }
    .amx-roster.home-section--light {
        padding-top: 3rem;
        padding-bottom: 3rem;
    }
}
