/* =============================================================================
   MERC GAME — assets/css/main.css
   Global styles. Dark military aesthetic; monospace throughout.
   ============================================================================= */

/* =============================================================================
   RESET & BASE
   ============================================================================= */

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

html {
    font-size: 14px;
}

body {
    background: #0e0e0e;
    color: #c8c8c8;
    font-family: 'Courier New', Courier, monospace;
    line-height: 1.6;
    min-height: 100vh;
}

a {
    color: #88aacc;
    text-decoration: none;
}
a:hover {
    color: #aaccee;
    text-decoration: underline;
}

h1, h2, h3 {
    font-weight: bold;
    letter-spacing: 1px;
}

/* =============================================================================
   NAVIGATION — rendered by templates/header.php
   ============================================================================= */

.main-nav {
    background: #111;
    border-bottom: 1px solid #333;
    padding: 8px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.nav-brand {
    color: #ff8800;
    font-size: 16px;
    font-weight: bold;
    letter-spacing: 3px;
    text-decoration: none;
    margin-right: 8px;
}
.nav-brand:hover { color: #ffaa00; text-decoration: none; }

.nav-links {
    list-style: none;
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.nav-links li a {
    color: #888;
    padding: 4px 10px;
    border: 1px solid transparent;
    font-size: 12px;
    letter-spacing: 1px;
    text-transform: uppercase;
    transition: color 0.1s, border-color 0.1s;
}
.nav-links li a:hover {
    color: #c8c8c8;
    border-color: #444;
    text-decoration: none;
}
.nav-links li a.nav-active {
    color: #ff8800;
    border-color: #553300;
}

.nav-company-id {
    margin-left: auto;
    color: #555;
    font-size: 11px;
}

/* =============================================================================
   MAIN CONTENT AREA
   ============================================================================= */

.main-content {
    padding: 20px 24px;
    max-width: 1100px;
    margin: 0 auto;
}

/* =============================================================================
   AUTH PAGES (login / register)
   ============================================================================= */

body.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 16px;
}

.auth-box {
    background: #111;
    border: 1px solid #333;
    padding: 32px;
    width: 100%;
    max-width: 380px;
}

.auth-box--wide {
    max-width: 520px;
}

.auth-title {
    font-size: 24px;
    color: #ff8800;
    letter-spacing: 4px;
    text-align: center;
    margin-bottom: 4px;
}

.auth-subtitle {
    color: #666;
    text-align: center;
    font-size: 12px;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 24px;
}

.auth-link {
    text-align: center;
    color: #666;
    font-size: 12px;
    margin-top: 16px;
}

/* =============================================================================
   FORMS
   ============================================================================= */

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.form-section {
    border: 1px solid #2a2a2a;
    padding: 12px 16px;
    margin-bottom: 12px;
}

.form-section legend {
    color: #888;
    font-size: 11px;
    letter-spacing: 2px;
    text-transform: uppercase;
    padding: 0 6px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 8px;
}

.form-group label {
    color: #888;
    font-size: 11px;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.form-group input,
.form-group select,
.form-group textarea {
    background: #1a1a1a;
    border: 1px solid #333;
    color: #c8c8c8;
    padding: 8px 10px;
    font-family: inherit;
    font-size: 13px;
    width: 100%;
    border-radius: 2px;
    transition: border-color 0.1s;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #555;
}

.form-hint {
    color: #666;
    font-size: 11px;
    margin-bottom: 8px;
}

.form-error {
    background: #2a0000;
    border: 1px solid #660000;
    color: #ff6666;
    padding: 8px 12px;
    font-size: 12px;
    margin-bottom: 12px;
}

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

.btn {
    padding: 8px 18px;
    cursor: pointer;
    font-family: inherit;
    font-size: 12px;
    letter-spacing: 2px;
    text-transform: uppercase;
    border-radius: 2px;
    border: 1px solid transparent;
    transition: background 0.12s, border-color 0.12s;
    display: inline-block;
}

.btn-primary {
    background: #1c3a1c;
    color: #88cc88;
    border-color: #2a5a2a;
    width: 100%;
}
.btn-primary:hover {
    background: #224422;
    border-color: #3a7a3a;
    color: #aaeaaa;
    text-decoration: none;
}

.btn-secondary {
    background: #1a1a1a;
    color: #888;
    border-color: #333;
}
.btn-secondary:hover {
    background: #222;
    border-color: #555;
    color: #c8c8c8;
    text-decoration: none;
}

.btn-danger {
    background: #2a0000;
    color: #cc4444;
    border-color: #550000;
}
.btn-danger:hover {
    background: #3a0000;
    border-color: #880000;
    color: #ff6666;
    text-decoration: none;
}

/* =============================================================================
   ALERTS
   ============================================================================= */

.alert {
    padding: 8px 12px;
    margin: 8px 0;
    font-size: 12px;
    border-radius: 2px;
}

.alert-danger {
    background: #2a0000;
    border: 1px solid #660000;
    color: #ff6666;
}

.alert-warning {
    background: #2a1a00;
    border: 1px solid #663300;
    color: #ffaa44;
}

.alert-success {
    background: #002a00;
    border: 1px solid #004400;
    color: #66cc66;
}

/* =============================================================================
   DASHBOARD
   ============================================================================= */

.dashboard {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.dash-company-header h1 {
    font-size: 22px;
    color: #ff8800;
    letter-spacing: 2px;
    margin-bottom: 4px;
}

.dash-meta {
    color: #666;
    font-size: 12px;
    margin-bottom: 8px;
}

.dash-section h2 {
    color: #888;
    font-size: 11px;
    letter-spacing: 3px;
    text-transform: uppercase;
    margin-bottom: 12px;
    padding-bottom: 4px;
    border-bottom: 1px solid #222;
}

/* Quick stats row */
.stat-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.stat-card {
    background: #111;
    border: 1px solid #2a2a2a;
    padding: 14px 18px;
    min-width: 140px;
    flex: 1;
}

.stat-label {
    color: #666;
    font-size: 10px;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 4px;
}

.stat-value {
    color: #ff8800;
    font-size: 18px;
    font-weight: bold;
}

.stat-danger {
    color: #ff4444;
}

/* Navigation grid */
.nav-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 10px;
}

.nav-card {
    background: #111;
    border: 1px solid #2a2a2a;
    padding: 14px 16px;
    display: block;
    transition: border-color 0.12s, background 0.12s;
    text-decoration: none;
}
.nav-card:hover {
    background: #161616;
    border-color: #444;
    text-decoration: none;
}
.nav-card--logout {
    border-color: #2a1a1a;
}
.nav-card--logout:hover {
    border-color: #553333;
    background: #140e0e;
}

.nav-card-title {
    color: #c8c8c8;
    font-size: 13px;
    font-weight: bold;
    letter-spacing: 1px;
    margin-bottom: 4px;
}
.nav-card--logout .nav-card-title {
    color: #886666;
}

.nav-card-desc {
    color: #555;
    font-size: 11px;
}

/* Active contract summary */
.contract-summary {
    background: #111;
    border: 1px solid #2a2a2a;
    border-left: 3px solid #ff8800;
    padding: 12px 16px;
    font-size: 13px;
    line-height: 1.8;
}

.contract-type {
    color: #ff8800;
    font-weight: bold;
    letter-spacing: 1px;
}

.contract-status {
    color: #666;
    font-size: 11px;
    margin-top: 4px;
}

.badge {
    display: inline-block;
    padding: 1px 6px;
    font-size: 10px;
    letter-spacing: 1px;
    font-weight: bold;
    border-radius: 2px;
    vertical-align: middle;
}

.badge-rush {
    background: #330000;
    color: #ff4444;
    border: 1px solid #550000;
}

/* =============================================================================
   EVENTS TABLE
   ============================================================================= */

.events-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.events-table th {
    text-align: left;
    color: #666;
    font-size: 10px;
    letter-spacing: 2px;
    text-transform: uppercase;
    padding: 4px 10px 8px;
    border-bottom: 1px solid #222;
}

.events-table td {
    padding: 6px 10px;
    border-bottom: 1px solid #1a1a1a;
    border-right: 1px solid #2a2a2a;
    color: #999;
    vertical-align: top;
}
.events-table td:last-child { border-right: none; }

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

.events-table tbody tr:nth-child(even) td {
    background: #1e1e1e;
}

.events-table tr:hover td {
    background: #2e2e2e !important;
}

.events-table td:first-child {
    color: #b0b0b0;
}

/* =============================================================================
   UTILITY
   ============================================================================= */

.muted {
    color: #555;
    font-size: 12px;
    font-style: italic;
}

.text-right { text-align: right; }
.text-center { text-align: center; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }

/* =============================================================================
   BUTTON SIZE VARIANTS
   ============================================================================= */

.btn-sm {
    padding: 5px 12px;
    font-size: 11px;
}

.btn-xs {
    padding: 3px 8px;
    font-size: 10px;
    letter-spacing: 1px;
}

/* =============================================================================
   STATUS COLOURS (used in aircraft stats and system damage)
   ============================================================================= */

.stat-ok {
    color: #88cc88;
}

.stat-damaged {
    color: #ff4444;
}

/* =============================================================================
   HANGAR PAGE
   ============================================================================= */

.hangar-page {
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* Tab navigation */
.hangar-tabs {
    display: flex;
    gap: 2px;
    border-bottom: 1px solid #2a2a2a;
    margin-bottom: 16px;
}

.tab-btn {
    padding: 8px 18px;
    font-size: 11px;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: #666;
    border: 1px solid transparent;
    border-bottom: none;
    cursor: pointer;
    text-decoration: none;
    background: transparent;
    transition: color 0.1s, border-color 0.1s;
    position: relative;
    bottom: -1px;
}
.tab-btn:hover {
    color: #c8c8c8;
    text-decoration: none;
    border-color: #333;
}
.tab-btn.tab-active {
    color: #ff8800;
    border-color: #333;
    border-bottom-color: #0e0e0e;
    background: #0e0e0e;
}

/* Cash display below tabs */
.hangar-cash {
    font-size: 12px;
    color: #666;
    margin-bottom: 16px;
    text-align: right;
}
.hangar-cash span {
    color: #ff8800;
    font-weight: bold;
}

/* Notification area */
.hangar-msg {
    margin-bottom: 12px;
}

/* Section title */
.section-title {
    color: #888;
    font-size: 11px;
    letter-spacing: 3px;
    text-transform: uppercase;
    margin-bottom: 14px;
    padding-bottom: 4px;
    border-bottom: 1px solid #222;
}

/* =============================================================================
   HANGAR — FLEET SECTION (aircraft cards)
   ============================================================================= */

.aircraft-card {
    background: #111;
    border: 1px solid #2a2a2a;
    margin-bottom: 12px;
    padding: 14px 16px;
}

.aircraft-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
}

.ac-ident {
    display: flex;
    align-items: baseline;
    gap: 10px;
    flex-wrap: wrap;
}

.ac-designation {
    color: #c8c8c8;
    font-size: 15px;
    font-weight: bold;
    letter-spacing: 1px;
}

.ac-type-name {
    color: #888;
    font-size: 13px;
}

.soph-badge {
    background: #1a1a1a;
    border: 1px solid #333;
    color: #666;
    font-size: 10px;
    letter-spacing: 1px;
    padding: 1px 6px;
}

.ac-mfr {
    color: #555;
    font-size: 11px;
    letter-spacing: 1px;
}

/* Status badges */
.badge-airworthy  { background: #002200; color: #66cc66; border: 1px solid #004400; }
.badge-grounded   { background: #2a0000; color: #ff4444; border: 1px solid #550000; }
.badge-destroyed  { background: #1a0000; color: #ff2222; border: 1px solid #440000; font-weight: bold; }
.badge-repairing  { background: #1a1400; color: #ccaa00; border: 1px solid #443300; }

/* Aircraft stats row */
.ac-stats-row {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.ac-stat {
    min-width: 80px;
}

.ac-stat-label {
    color: #555;
    font-size: 10px;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-bottom: 2px;
}

.ac-stat-value {
    font-size: 13px;
    color: #999;
}

/* Loadout summary line */
.ac-loadout-summary {
    font-size: 12px;
    color: #888;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.loadout-tag {
    background: #1a1a2a;
    border: 1px solid #2a2a44;
    color: #8899cc;
    font-size: 10px;
    padding: 1px 6px;
    letter-spacing: 0.5px;
}

/* Weight status colours */
.weight-ok      { color: #88cc88; }
.weight-penalty { color: #ffaa44; }
.weight-grounded { color: #ff4444; }

/* Repair row */
.ac-repair-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
    font-size: 12px;
    color: #888;
    background: #0e1a0e;
    border: 1px solid #1a2a1a;
    padding: 6px 10px;
}

/* Action buttons row */
.ac-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 8px;
}

/* =============================================================================
   HANGAR — LOADOUT EDITOR (inline, per aircraft)
   ============================================================================= */

.loadout-editor {
    margin-top: 12px;
    border-top: 1px solid #222;
    padding-top: 12px;
}

.loadout-editor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    flex-wrap: wrap;
    gap: 8px;
}

.loadout-editor-title {
    color: #888;
    font-size: 11px;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.weight-display {
    font-size: 12px;
    padding: 4px 10px;
    border: 1px solid #222;
    background: #0e0e0e;
}

.hardpoints-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    margin-top: 6px;
}

.hardpoints-table th {
    text-align: left;
    color: #555;
    font-size: 10px;
    letter-spacing: 1px;
    text-transform: uppercase;
    padding: 4px 8px 6px;
    border-bottom: 1px solid #222;
}

.hardpoints-table td {
    padding: 5px 8px;
    border-bottom: 1px solid #1a1a1a;
    color: #888;
    vertical-align: middle;
}

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

.slot-type-large { color: #ffaa44; font-weight: bold; }
.slot-type-small { color: #88aacc; }

.hp-btn-cell {
    display: flex;
    gap: 4px;
    align-items: center;
}

.ord-select {
    background: #1a1a1a;
    border: 1px solid #333;
    color: #c8c8c8;
    padding: 4px 6px;
    font-family: inherit;
    font-size: 11px;
    max-width: 240px;
}
.ord-select:focus {
    outline: none;
    border-color: #555;
}

/* =============================================================================
   HANGAR — BUY AIRCRAFT SECTION
   ============================================================================= */

.buy-firm-block {
    margin-bottom: 24px;
}

.buy-firm-header {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 10px;
    padding-bottom: 6px;
    border-bottom: 1px solid #1a1a1a;
}

.buy-firm-name {
    color: #c8c8c8;
    font-size: 13px;
    font-weight: bold;
    letter-spacing: 1px;
}

.buy-firm-tier {
    font-size: 10px;
    letter-spacing: 2px;
    padding: 2px 8px;
    border: 1px solid #333;
}
.tier-known     { color: #88aacc; border-color: #2a3a4a; background: #0e1a2a; }
.tier-trusted   { color: #88cc88; border-color: #2a4a2a; background: #0e1a0e; }
.tier-allied    { color: #ccaa44; border-color: #4a3a0e; background: #1a1400; }
.tier-legendary { color: #ffaa00; border-color: #553300; background: #1a0e00; }

.buy-firm-discount {
    color: #88cc88;
    font-size: 12px;
    font-weight: bold;
}

.buy-firm-note {
    color: #555;
    font-size: 11px;
    flex: 1;
}

.buy-soph-group {
    margin-bottom: 16px;
}

.soph-group-label {
    color: #666;
    font-size: 10px;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 8px;
    padding-left: 2px;
}

.buy-aircraft-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 10px;
}

.ac-buy-card {
    background: #0e0e0e;
    border: 1px solid #2a2a2a;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ac-buy-card--unaffordable {
    opacity: 0.55;
}

.ac-buy-name {
    color: #c8c8c8;
    font-size: 12px;
    font-weight: bold;
    letter-spacing: 0.5px;
}

.ac-buy-mfr {
    color: #555;
    font-size: 10px;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-bottom: 2px;
}

.ac-buy-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    font-size: 11px;
    color: #888;
}

.ac-buy-stats span {
    background: #1a1a1a;
    padding: 1px 5px;
    border: 1px solid #252525;
}

.ac-buy-hp,
.ac-buy-hardpoints,
.ac-buy-upkeep {
    color: #666;
    font-size: 11px;
}

.ac-buy-price-row {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-top: 2px;
}

.ac-buy-price {
    color: #ff8800;
    font-size: 14px;
    font-weight: bold;
}

.ac-buy-original {
    color: #555;
    font-size: 11px;
    text-decoration: line-through;
}

/* =============================================================================
   HANGAR — ORDNANCE STORE SECTION
   ============================================================================= */

.ord-category-block {
    margin-bottom: 24px;
}

.ord-category-label {
    color: #888;
    font-size: 10px;
    letter-spacing: 3px;
    text-transform: uppercase;
    margin-bottom: 8px;
    padding-bottom: 4px;
    border-bottom: 1px solid #1a1a1a;
}

.ord-store-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    table-layout: fixed;
    border: 1px solid #333;
}

.ord-store-table th {
    text-align: left;
    color: #777;
    font-size: 10px;
    letter-spacing: 1px;
    text-transform: uppercase;
    padding: 6px 8px;
    background: #161616;
    border-bottom: 2px solid #333;
    border-right: 1px solid #2a2a2a;
}
.ord-store-table th:last-child { border-right: none; }

.ord-store-table td {
    padding: 7px 8px;
    border-bottom: 1px solid #1a1a1a;
    border-right: 1px solid #2a2a2a;
    color: #888;
    vertical-align: middle;
}
.ord-store-table td:last-child { border-right: none; }

.ord-store-table tr:last-child td {
    border-bottom: none;
}

/* Zebra striping — clearly visible on #0e0e0e background */
.ord-store-table tbody tr:nth-child(even) td {
    background: #1e1e1e;
}

.ord-store-table tr:hover td {
    background: #2e2e2e !important;
}

/* Name column — primary identifier */
.ord-store-table td:first-child {
    color: #c0c0c0;
    font-weight: 500;
}

/* Narrow stat columns — centred */
.ord-store-table th:nth-child(2),
.ord-store-table td:nth-child(2),
.ord-store-table th:nth-child(3),
.ord-store-table td:nth-child(3),
.ord-store-table th:nth-child(4),
.ord-store-table td:nth-child(4),
.ord-store-table th:nth-child(5),
.ord-store-table td:nth-child(5) {
    text-align: center;
}

/* Effect column — de-emphasised secondary info */
.ord-store-table td:nth-child(6) {
    color: #666;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ord-effect-note {
    color: #555;
    cursor: help;
    font-size: 11px;
    margin-left: 2px;
}

.ord-qty-input {
    background: #1a1a1a;
    border: 1px solid #333;
    color: #c8c8c8;
    padding: 3px 6px;
    font-family: inherit;
    font-size: 11px;
    width: 52px;
    text-align: center;
}
.ord-qty-input:focus {
    outline: none;
    border-color: #555;
}

.ord-buy-cell,
.ord-sell-cell {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* =============================================================================
   PILOTS PAGE
   ============================================================================= */

.pilots-page {
    max-width: 1100px;
    margin: 0 auto;
    padding: 20px 16px;
}

/* -- Tab navigation -------------------------------------------------------- */
.pilots-tabs {
    display: flex;
    gap: 2px;
    border-bottom: 1px solid #2a2a2a;
    margin-bottom: 0;
}

.pilots-tabs .tab-btn {
    padding: 8px 18px;
    background: #131313;
    color: #666;
    border: 1px solid #2a2a2a;
    border-bottom: none;
    cursor: pointer;
    font-family: inherit;
    font-size: 11px;
    letter-spacing: 1px;
    text-transform: uppercase;
    text-decoration: none;
}

.pilots-tabs .tab-btn:hover {
    color: #aaa;
    background: #1a1a1a;
}

.pilots-tabs .tab-btn.tab-active {
    color: #c8c8c8;
    background: #0e0e0e;
    border-color: #2a2a2a;
    border-bottom-color: #0e0e0e;
}

/* -- Notification bar ------------------------------------------------------- */
.pilots-msg {
    padding: 10px 14px;
    margin: 12px 0 6px;
    font-size: 12px;
    border-left: 3px solid #555;
    background: #131313;
}

.pilots-msg.msg-success { border-color: #4a7c4e; color: #7fbf85; }
.pilots-msg.msg-danger  { border-color: #7c3a3a; color: #c07070; }
.pilots-msg.msg-warning { border-color: #7c6a2a; color: #c0a850; }

/* -- Balance display ------------------------------------------------------- */
.pilots-cash {
    text-align: right;
    font-size: 12px;
    color: #666;
    padding: 6px 0;
    letter-spacing: 1px;
}

.pilots-cash span {
    color: #9dbf7a;
    font-size: 13px;
}

/* -- Section titles -------------------------------------------------------- */
.pilots-section {
    padding-top: 16px;
}

/* -- Pilot cards ----------------------------------------------------------- */
.pilot-card {
    border: 1px solid #222;
    background: #111;
    margin-bottom: 8px;
}

.pilot-card-warning {
    border-color: #5a4a1a;
    background: #131109;
}

.pilot-card-danger {
    border-color: #5a1a1a;
    background: #130909;
}

.pilot-card-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 10px 14px;
    flex-wrap: wrap;
}

/* Ident block */
.pilot-ident {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
    min-width: 220px;
}

.pilot-callsign {
    color: #c8c8c8;
    font-size: 13px;
}

.pilot-name {
    color: #777;
    font-size: 11px;
}

/* Tier badges */
.tier-badge {
    display: inline-block;
    font-size: 9px;
    font-weight: bold;
    letter-spacing: 1px;
    padding: 2px 6px;
    border: 1px solid;
}

.tier-badge.tier-green       { color: #7fc080; border-color: #4a7c4e; background: #0d1a0e; }
.tier-badge.tier-experienced { color: #88aacc; border-color: #3a5a7c; background: #0d1220; }
.tier-badge.tier-veteran     { color: #c0a050; border-color: #7c6030; background: #1a1205; }
.tier-badge.tier-ace         { color: #cc8888; border-color: #7c3a3a; background: #1a0808; }

/* Small tier badge for history table */
.tier-badge-sm {
    display: inline-block;
    font-size: 9px;
    letter-spacing: 1px;
    padding: 1px 5px;
    border: 1px solid;
}

.tier-badge-sm.tier-green       { color: #7fc080; border-color: #4a7c4e; }
.tier-badge-sm.tier-experienced { color: #88aacc; border-color: #3a5a7c; }
.tier-badge-sm.tier-veteran     { color: #c0a050; border-color: #7c6030; }
.tier-badge-sm.tier-ace         { color: #cc8888; border-color: #7c3a3a; }

/* State badges */
.pilot-badge {
    font-size: 9px;
    letter-spacing: 1px;
    padding: 2px 6px;
    border: 1px solid;
}

.badge-grounded { color: #c07070; border-color: #7c3a3a; background: #1a0808; }
.badge-stressed { color: #c0a050; border-color: #7c6030; background: #1a1205; }
.badge-mild     { color: #aaa;    border-color: #444;    background: #131313; }

/* Stats row */
.pilot-stats-row {
    display: flex;
    align-items: center;
    gap: 14px;
    flex: 1;
    flex-wrap: wrap;
}

.pilot-stat {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.stat-lbl {
    font-size: 9px;
    color: #555;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.stat-val {
    font-size: 12px;
    color: #aaa;
}

/* Stress stat inline */
.stress-stat {
    flex-direction: row;
    align-items: center;
    gap: 6px;
}

.stress-stat .stat-lbl {
    min-width: 42px;
}

.stress-bar-wrap {
    width: 80px;
    height: 8px;
    background: #1e1e1e;
    border: 1px solid #2a2a2a;
    overflow: hidden;
}

.stress-bar {
    height: 100%;
    transition: width 0.3s, background-color 0.3s;
}

.stress-bar.stress-ok      { background: #4a7c4e; }
.stress-bar.stress-warning { background: #8a6a20; }
.stress-bar.stress-danger  { background: #8a2a2a; }

.stress-num {
    font-size: 11px;
    color: #666;
    white-space: nowrap;
}

/* Action buttons */
.pilot-card-actions {
    display: flex;
    gap: 6px;
    margin-left: auto;
    flex: 0 0 auto;
}

/* -- Detail panel ---------------------------------------------------------- */
.pilot-detail {
    border-top: 1px solid #1e1e1e;
    background: #0d0d0d;
    padding: 14px;
}

.pilot-detail-inner {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
}

.detail-block {
    min-width: 160px;
    flex: 1 1 160px;
}

.detail-label {
    font-size: 9px;
    letter-spacing: 1px;
    color: #555;
    text-transform: uppercase;
    margin-bottom: 6px;
    border-bottom: 1px solid #1e1e1e;
    padding-bottom: 3px;
}

/* Skills grid */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 4px;
}

.skills-grid-sm {
    grid-template-columns: repeat(5, 1fr);
    font-size: 11px;
}

.skill-cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: #131313;
    border: 1px solid #1e1e1e;
    padding: 4px 2px;
    gap: 2px;
}

.skill-name {
    font-size: 9px;
    color: #555;
    letter-spacing: 0.5px;
}

.skill-val {
    font-size: 12px;
}

.skill-pos  { color: #7fc080; }
.skill-neg  { color: #c07070; }
.skill-zero { color: #444; }

/* XP bar */
.xp-bar-wrap {
    width: 100%;
    height: 6px;
    background: #1e1e1e;
    border: 1px solid #2a2a2a;
    overflow: hidden;
    margin-bottom: 4px;
}

.xp-bar {
    height: 100%;
    background: #3a5a7c;
    transition: width 0.3s;
}

.xp-label {
    font-size: 10px;
    color: #555;
}

/* Traits */
.traits-list {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.trait-tag {
    font-size: 10px;
    padding: 2px 7px;
    border: 1px solid;
    cursor: default;
}

.trait-tag.trait-positive { color: #7fc080; border-color: #3a5a3e; background: #0d150e; }
.trait-tag.trait-negative { color: #c07070; border-color: #5a2a2a; background: #150d0d; }

/* Stress effects */
.stress-effects-block {
    color: #c07070;
}

.effect-item {
    display: block;
    font-size: 11px;
    margin-bottom: 3px;
}

.effect-bad { color: #c07070; }

/* Recovery buttons */
.recovery-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

/* =============================================================================
   BROKER PANELS
   ============================================================================= */

.broker-panels {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-top: 8px;
}

@media (max-width: 800px) {
    .broker-panels {
        grid-template-columns: 1fr;
    }
}

.broker-panel {
    border: 1px solid #222;
    background: #111;
}

.broker-panel.broker-locked {
    opacity: 0.6;
}

.broker-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 10px 14px;
    border-bottom: 1px solid #1e1e1e;
    background: #131313;
}

.broker-name {
    font-size: 13px;
    color: #c8c8c8;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.broker-sub {
    font-size: 10px;
    color: #555;
    margin-top: 2px;
}

.broker-locked-msg {
    padding: 24px 14px;
    text-align: center;
    color: #555;
    font-size: 12px;
}

.lock-icon {
    font-size: 20px;
    margin-bottom: 8px;
}

.broker-pool {
    padding: 8px;
    max-height: 620px;
    overflow-y: auto;
}

/* Individual broker pilot cards */
.broker-pilot-card {
    border: 1px solid #1e1e1e;
    background: #0d0d0d;
    margin-bottom: 8px;
    padding: 10px 12px;
}

.broker-pilot-card:last-child {
    margin-bottom: 0;
}

.bp-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.bp-callsign {
    color: #c8c8c8;
    font-size: 12px;
}

.bp-name {
    color: #666;
    font-size: 11px;
}

.bp-stats {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
    font-size: 11px;
}

.bp-wage {
    color: #9dbf7a;
}

.hire-fee-note {
    color: #c07070;
}

.hire-free-note {
    color: #555;
}

.bp-hire {
    margin-top: 8px;
}

/* =============================================================================
   PILOT HISTORY TABLE
   ============================================================================= */

.pilots-history-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.pilots-history-table th {
    text-align: left;
    font-size: 10px;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #555;
    padding: 5px 8px 6px;
    border-bottom: 1px solid #222;
}

.pilots-history-table td {
    padding: 7px 8px;
    border-bottom: 1px solid #1a1a1a;
    border-right: 1px solid #2a2a2a;
    color: #888;
    vertical-align: middle;
}
.pilots-history-table td:last-child { border-right: none; }

.pilots-history-table tr:last-child td {
    border-bottom: none;
}

.pilots-history-table tbody tr:nth-child(even) td {
    background: #1e1e1e;
}

.pilots-history-table tr:hover td {
    background: #2e2e2e !important;
}

.pilots-history-table td:first-child {
    color: #b8b8b8;
}

.pilot-callsign-sm {
    color: #aaa;
}

.history-status {
    font-size: 10px;
    letter-spacing: 1px;
    padding: 2px 6px;
    border: 1px solid;
}

.status-dismissed { color: #888; border-color: #333; }
.status-kia       { color: #c07070; border-color: #5a2a2a; }

/* =============================================================================
   CONTRACTS PAGE
   ============================================================================= */

.contracts-page {
    max-width: 1100px;
    margin: 0 auto;
    padding: 20px 16px;
}

/* -- Notification bar ------------------------------------------------------- */
.contracts-msg {
    padding: 10px 14px;
    margin: 0 0 8px;
    font-size: 12px;
    border-left: 3px solid #555;
    background: #131313;
}

.contracts-msg.msg-success { border-color: #4a7c4e; color: #7fbf85; }
.contracts-msg.msg-danger  { border-color: #7c3a3a; color: #c07070; }
.contracts-msg.msg-warning { border-color: #7c6a2a; color: #c0a850; }

/* -- Balance display ------------------------------------------------------- */
.contracts-cash {
    text-align: right;
    font-size: 12px;
    color: #666;
    padding: 4px 0 8px;
    letter-spacing: 1px;
}

.contracts-cash span {
    color: #9dbf7a;
    font-size: 13px;
}

/* -- God Mode bar ---------------------------------------------------------- */
.god-contract-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 10px;
    background: #130d1a;
    border: 1px solid #3a1a5a;
    margin-bottom: 12px;
    font-size: 11px;
}

.god-label {
    color: #aa55cc;
    letter-spacing: 1px;
    font-size: 10px;
}

/* -- Tab navigation -------------------------------------------------------- */
.contracts-tabs {
    display: flex;
    gap: 2px;
    border-bottom: 1px solid #2a2a2a;
    margin-top: 16px;
}

.contracts-tabs .tab-btn {
    padding: 8px 18px;
    background: #131313;
    color: #666;
    border: 1px solid #2a2a2a;
    border-bottom: none;
    cursor: pointer;
    font-family: inherit;
    font-size: 11px;
    letter-spacing: 1px;
    text-transform: uppercase;
    text-decoration: none;
}

.contracts-tabs .tab-btn:hover { color: #aaa; background: #1a1a1a; }
.contracts-tabs .tab-btn.tab-active {
    color: #c8c8c8;
    background: #0e0e0e;
    border-bottom-color: #0e0e0e;
}

.contracts-section { padding-top: 12px; }

/* =============================================================================
   CONTRACT TYPE BADGES
   ============================================================================= */

.type-badge {
    display: inline-block;
    font-size: 9px;
    font-weight: bold;
    letter-spacing: 1px;
    text-transform: uppercase;
    padding: 2px 8px;
    border: 1px solid;
}

.type-badge.type-strike          { color: #cc8060; border-color: #7c3a20; background: #1a0d07; }
.type-badge.type-air_superiority { color: #88aacc; border-color: #2a4a7c; background: #070d1a; }
.type-badge.type-escort          { color: #7fc080; border-color: #3a6a3a; background: #071207; }
.type-badge.type-sead            { color: #bb88cc; border-color: #5a3a7c; background: #110714; }
.type-badge.type-recon           { color: #70c0c0; border-color: #2a5a5a; background: #071212; }
.type-badge.type-interdiction    { color: #c0a050; border-color: #7c5a20; background: #141005; }

/* Small type badges for history table */
.type-badge-sm {
    display: inline-block;
    font-size: 9px;
    letter-spacing: 1px;
    padding: 1px 6px;
    border: 1px solid;
}

.type-badge-sm.type-strike          { color: #cc8060; border-color: #7c3a20; }
.type-badge-sm.type-air_superiority { color: #88aacc; border-color: #2a4a7c; }
.type-badge-sm.type-escort          { color: #7fc080; border-color: #3a6a3a; }
.type-badge-sm.type-sead            { color: #bb88cc; border-color: #5a3a7c; }
.type-badge-sm.type-recon           { color: #70c0c0; border-color: #2a5a5a; }
.type-badge-sm.type-interdiction    { color: #c0a050; border-color: #7c5a20; }

/* -- Threat badges --------------------------------------------------------- */
.threat-badge {
    display: inline-block;
    font-size: 9px;
    letter-spacing: 1px;
    padding: 2px 6px;
    border: 1px solid;
    text-transform: uppercase;
}

.threat-badge.threat-low    { color: #7fc080; border-color: #3a6a3a; }
.threat-badge.threat-medium { color: #c0a050; border-color: #7c6030; }
.threat-badge.threat-high   { color: #c07070; border-color: #7c3a3a; }

.threat-txt-low    { color: #7fc080; }
.threat-txt-medium { color: #c0a050; }
.threat-txt-high   { color: #c07070; }

/* -- Distance badges ------------------------------------------------------- */
.dist-badge {
    display: inline-block;
    font-size: 9px;
    letter-spacing: 1px;
    padding: 2px 6px;
    color: #888;
    border: 1px solid #2a2a2a;
    text-transform: uppercase;
}

/* -- Rush / special event badges ------------------------------------------- */
.badge-rush {
    display: inline-block;
    font-size: 9px;
    font-weight: bold;
    letter-spacing: 1px;
    padding: 2px 6px;
    color: #cc8888;
    border: 1px solid #7c3a3a;
    background: #1a0808;
    text-transform: uppercase;
}

.badge-special {
    display: inline-block;
    font-size: 9px;
    font-weight: bold;
    letter-spacing: 1px;
    padding: 2px 6px;
    color: #c0a050;
    border: 1px solid #7c6030;
    background: #1a1205;
    text-transform: uppercase;
}

/* =============================================================================
   ACTIVE CONTRACT SECTION (Section C)
   ============================================================================= */

.active-contract-section {
    background: #0d110d;
    border: 1px solid #2a4a2a;
    margin-bottom: 16px;
    padding: 14px;
}

.active-contract-label {
    font-size: 9px;
    letter-spacing: 2px;
    color: #4a7c4e;
    text-transform: uppercase;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.active-contract-card {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 16px;
}

@media (max-width: 900px) {
    .active-contract-card {
        grid-template-columns: 1fr;
    }
}

.ac-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.ac-firm {
    font-size: 13px;
    color: #c8c8c8;
}

.ac-tier {
    font-size: 10px;
    color: #555;
    letter-spacing: 1px;
}

.ac-target {
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.ac-area {
    font-size: 13px;
    color: #aaa;
}

.ac-payment {
    margin-bottom: 10px;
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.payment-main {
    font-size: 22px;
    color: #9dbf7a;
    letter-spacing: 1px;
}

.payment-label {
    font-size: 10px;
    color: #555;
}

.payment-bonuses {
    font-size: 11px;
    color: #6a8a50;
}

.payment-bonus-hint {
    font-size: 12px;
    color: #6a8a50;
}

.ac-mission-status {
    margin-bottom: 10px;
}

.mission-status-badge {
    display: inline-block;
    font-size: 9px;
    letter-spacing: 1px;
    padding: 3px 8px;
    border: 1px solid;
    text-transform: uppercase;
}

.status-not-launched { color: #666;    border-color: #333; }
.status-planned      { color: #88aacc; border-color: #3a5a7c; }
.status-in-progress  { color: #c0a050; border-color: #7c6030; }

.ac-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* =============================================================================
   AVAILABLE CONTRACT CARDS (Section A)
   ============================================================================= */

.contract-card {
    border: 1px solid #1e1e1e;
    background: #111;
    margin-bottom: 8px;
}

.contract-card.contract-special {
    border-color: #5a4a1a;
    background: #131108;
}

.contract-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    flex-wrap: wrap;
}

.contract-ident {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
}

.contract-firm {
    font-size: 12px;
    color: #aaa;
}

.contract-tier {
    font-size: 10px;
    color: #555;
    letter-spacing: 1px;
}

.contract-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    flex-wrap: wrap;
}

.contract-area {
    font-size: 12px;
    color: #888;
}

.contract-payment-summary {
    display: flex;
    align-items: baseline;
    gap: 6px;
    flex: 0 0 auto;
}

.contract-card-actions {
    display: flex;
    gap: 6px;
    margin-left: auto;
    flex: 0 0 auto;
}

/* -- Contract detail panel ------------------------------------------------- */
.contract-detail {
    border-top: 1px solid #1e1e1e;
    background: #0d0d0d;
    padding: 14px;
}

.contract-detail-inner {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 20px;
}

.detail-col { }

.detail-value-lg {
    font-size: 20px;
    color: #9dbf7a;
    margin-bottom: 4px;
}

.detail-value {
    font-size: 13px;
    color: #aaa;
    margin-bottom: 3px;
}

.detail-sub {
    font-size: 11px;
    color: #666;
    margin-bottom: 2px;
}

.rush-note { color: #c07070; }

.bonus-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 4px;
    font-size: 11px;
}

.bonus-name { color: #888; }
.bonus-amt  { color: #9dbf7a; }

/* -- Intel cost preview (inside available detail panel) -------------------- */
.intel-preview-row {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 4px;
    font-size: 11px;
}

.intel-t-num  { color: #555; letter-spacing: 1px; min-width: 16px; }
.intel-t-name { color: #888; flex: 1; }
.intel-t-cost { color: #9dbf7a; }
.intel-free   { color: #7fc080; }

.intel-preview-note {
    font-size: 10px;
    color: #444;
    margin-top: 6px;
    font-style: italic;
}

/* =============================================================================
   INTEL PANEL (inside Active Contract section)
   ============================================================================= */

.intel-panel {
    background: #0a0a0a;
    border: 1px solid #1e1e1e;
    padding: 12px;
}

.intel-panel-title {
    font-size: 9px;
    letter-spacing: 2px;
    color: #555;
    text-transform: uppercase;
    margin-bottom: 10px;
    border-bottom: 1px solid #1e1e1e;
    padding-bottom: 4px;
}

.intel-tier-block {
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid #1a1a1a;
}

.intel-tier-block:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.intel-tier-block.intel-locked {
    opacity: 0.45;
    pointer-events: none;
}

.intel-tier-header {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 4px;
}

.intel-tier-num {
    font-size: 10px;
    color: #c8c8c8;
    letter-spacing: 1px;
    text-transform: uppercase;
    flex: 1;
}

.intel-cost {
    font-size: 10px;
    color: #9dbf7a;
}

.intel-purchased-badge {
    font-size: 9px;
    letter-spacing: 1px;
    color: #7fc080;
    border: 1px solid #3a6a3a;
    padding: 1px 5px;
    text-transform: uppercase;
}

.intel-tier-desc {
    font-size: 10px;
    color: #555;
    margin-bottom: 6px;
}

/* Zone reveal list */
.intel-zone-list,
.intel-enemy-list {
    margin-top: 6px;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.intel-zone-row,
.intel-enemy-row {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 11px;
    flex-wrap: wrap;
}

.zone-type {
    color: #666;
    min-width: 90px;
    text-transform: capitalize;
}

.zone-id {
    color: #555;
    min-width: 20px;
}

.zone-enc {
    font-size: 11px;
}

.enc-yes { color: #c07070; }
.enc-no  { color: #7fc080; }

/* Enemy composition */
.enemy-comp {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 2px;
}

.enemy-tag {
    font-size: 10px;
    padding: 1px 6px;
    border: 1px solid #2a2a2a;
    color: #c07070;
    text-transform: capitalize;
}

.enemy-sam { color: #c0a050; border-color: #6a5a20; }
.enemy-aaa { color: #cc8888; border-color: #6a2020; }

.intel-reroll-history {
    font-size: 11px;
    color: #666;
    margin-top: 4px;
}

/* =============================================================================
   CONTRACT HISTORY TABLE
   ============================================================================= */

.contracts-history-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.contracts-history-table th {
    text-align: left;
    font-size: 10px;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #555;
    padding: 5px 8px 6px;
    border-bottom: 1px solid #222;
}

.contracts-history-table td {
    padding: 7px 8px;
    border-bottom: 1px solid #1a1a1a;
    border-right: 1px solid #2a2a2a;
    color: #888;
    vertical-align: middle;
}
.contracts-history-table td:last-child { border-right: none; }

.contracts-history-table tr:last-child td { border-bottom: none; }

.contracts-history-table tbody tr:nth-child(even) td {
    background: #1e1e1e;
}

.contracts-history-table tr:hover td { background: #2e2e2e !important; }

.contracts-history-table td:first-child {
    color: #b8b8b8;
}

.history-status {
    font-size: 10px;
    letter-spacing: 1px;
    padding: 2px 6px;
    border: 1px solid;
}

.status-completed { color: #7fc080; border-color: #3a6a3a; }
.status-dropped   { color: #888;    border-color: #333; }
.status-failed    { color: #c07070; border-color: #7c3a3a; }
.status-aborted   { color: #c0a050; border-color: #7c6030; }

/* =============================================================================
   SHARED MISSION COMPONENTS (used by both prep + fly pages)
   ============================================================================= */

/* HP pips */
.hp-pip  { font-size: 10px; margin-right: 1px; letter-spacing: 1px; }
.hp-full { color: #7fc080; }
.hp-lost { color: #333; }

/* Stress chips */
.stress-chip {
    display: inline-block;
    font-size: 11px;
    padding: 1px 7px;
    border: 1px solid;
}
.stress-ok       { color: #7fc080; border-color: #3a6a3a; background: #061006; }
.stress-mild     { color: #c0a050; border-color: #7c6030; background: #141005; }
.stress-moderate { color: #c07070; border-color: #7c3a3a; background: #140707; }

.stress-penalty-note {
    font-size: 10px;
    letter-spacing: 0.5px;
    margin-left: 4px;
    opacity: 0.75;
}

/* Skill chips */
.skill-chip {
    display: inline-block;
    font-size: 10px;
    padding: 1px 5px;
    background: #131313;
    border: 1px solid #252525;
    color: #888;
}

/* System damage tag */
.dmg-tag {
    display: inline-block;
    font-size: 10px;
    padding: 1px 5px;
    color: #c0a050;
    background: #1a1200;
    border: 1px solid #4a3800;
    margin-right: 3px;
}

/* Pilot tier badge (experience tier) */
.pilot-tier-badge {
    font-size: 10px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    padding: 1px 6px;
    border: 1px solid #333;
    color: #888;
}
.pilot-tier-badge.tier-green   { color: #7fc080; border-color: #3a6a3a; background: #061006; }
.pilot-tier-badge.tier-veteran { color: #88aacc; border-color: #2a4a7c; background: #07101a; }
.pilot-tier-badge.tier-elite   { color: #ccaa44; border-color: #7c6020; background: #140e00; }

/* =============================================================================
   MISSION PREP PAGE
   ============================================================================= */

.prep-page {
    max-width: 1100px;
    margin: 0 auto;
    padding: 20px 16px 60px;
}

.prep-msg {
    padding: 9px 14px;
    margin-bottom: 14px;
    font-size: 12px;
    letter-spacing: 0.5px;
    border: 1px solid;
}
.prep-msg.msg-success { color: #7fc080; border-color: #3a6a3a; background: #061006; }
.prep-msg.msg-danger  { color: #c07070; border-color: #7c3a3a; background: #140707; }
.prep-msg.msg-warning { color: #c0a050; border-color: #7c6030; background: #141005; }
.prep-msg.msg-info    { color: #88aacc; border-color: #2a4a7c; background: #07101a; }

/* Contract summary header */
.prep-contract-header {
    background: #0e0e0e;
    border: 1px solid #2a2a2a;
    border-left: 3px solid #446688;
    padding: 12px 16px;
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

.prep-contract-ident {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.prep-firm-name {
    color: #c8c8c8;
    font-size: 13px;
    font-weight: bold;
    letter-spacing: 0.5px;
}

.prep-tier-badge {
    font-size: 10px;
    letter-spacing: 2px;
    text-transform: uppercase;
    padding: 1px 6px;
    border: 1px solid #333;
    color: #666;
}

.prep-contract-details {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    flex-wrap: wrap;
}

.prep-target {
    color: #888;
    font-size: 12px;
}

.prep-payout {
    color: #ff8800;
    font-size: 13px;
    font-weight: bold;
}

.prep-header-cash {
    color: #555;
    font-size: 12px;
    margin-left: auto;
}
.prep-header-cash span { color: #c8c8c8; }

/* Two-column layout */
.prep-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 18px;
    align-items: start;
}
@media (max-width: 800px) {
    .prep-layout { grid-template-columns: 1fr; }
}

.prep-left,
.prep-right {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/* Section panels */
.prep-section {
    background: #0a0a0a;
    border: 1px solid #222;
    padding: 14px 16px;
}

/* Pilot cards */
.prep-pilot-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.prep-pilot-card {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 10px 12px;
    background: #0e0e0e;
    border: 1px solid #222;
    cursor: pointer;
    transition: border-color 0.1s, background 0.1s;
}
.prep-pilot-card:hover                  { border-color: #446688; background: #0f1520; }
.prep-pilot-card:has(input:checked)     { border-color: #446688; background: #0a1220; }
.prep-pilot-card.pilot-mild             { border-left: 3px solid #7c6030; }
.prep-pilot-card.pilot-moderate         { border-left: 3px solid #7c3a3a; }

.prep-pilot-checkbox {
    padding-top: 2px;
    flex-shrink: 0;
}
.prep-pilot-checkbox input {
    accent-color: #446688;
    width: 14px;
    height: 14px;
}

.prep-pilot-body {
    display: flex;
    flex-direction: column;
    gap: 5px;
    flex: 1;
}

.prep-pilot-name-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.prep-callsign {
    color: #c8c8c8;
    font-size: 13px;
    font-weight: bold;
    letter-spacing: 0.5px;
}

.prep-skill-row {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.prep-pilot-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.prep-wage {
    color: #555;
    font-size: 11px;
}

.prep-val-msg {
    font-size: 11px;
    color: #c07070;
    margin-top: 6px;
    min-height: 16px;
}

/* Aircraft cards */
.prep-aircraft-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.prep-aircraft-card {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 10px 12px;
    background: #0e0e0e;
    border: 1px solid #222;
    cursor: pointer;
    transition: border-color 0.1s, background 0.1s;
}
.prep-aircraft-card:hover               { border-color: #446688; background: #0f1520; }
.prep-aircraft-card:has(input:checked)  { border-color: #446688; background: #0a1220; }
.prep-aircraft-card.aircraft-sys-dmg   { border-left: 3px solid #7c6030; }

.prep-aircraft-radio {
    padding-top: 2px;
    flex-shrink: 0;
}
.prep-aircraft-radio input {
    accent-color: #446688;
    width: 14px;
    height: 14px;
}

.prep-aircraft-body {
    display: flex;
    flex-direction: column;
    gap: 5px;
    flex: 1;
}

.prep-aircraft-name-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.ac-designation { color: #c8c8c8; font-size: 13px; font-weight: bold; }
.ac-type-name   { color: #888; font-size: 11px; }
.ac-custom-name { color: #666; font-size: 11px; font-style: italic; }

.prep-aircraft-stat-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}
.prep-ac-stat { font-size: 11px; color: #666; }

.prep-sysdmg-warn {
    font-size: 11px;
    color: #c0a050;
    margin-top: 2px;
}

/* Loadout review */
.prep-loadout-panel {
    margin-top: 10px;
    padding: 10px 12px;
    background: #0e0e0e;
    border: 1px solid #1e1e1e;
}

.loadout-weight-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}
.loadout-weight-label {
    color: #555;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.weight-badge {
    font-size: 10px;
    letter-spacing: 1.5px;
    padding: 2px 7px;
    border: 1px solid;
}
.weight-badge.weight-ok       { color: #7fc080; border-color: #3a6a3a; background: #061006; }
.weight-badge.weight-penalty  { color: #c0a050; border-color: #7c6030; background: #141005; }
.weight-badge.weight-grounded { color: #c07070; border-color: #7c3a3a; background: #140707; }

.weight-over-warn { color: #c07070; font-size: 11px; }

.loadout-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}
.loadout-table th {
    text-align: left;
    color: #555;
    font-size: 10px;
    letter-spacing: 1px;
    text-transform: uppercase;
    padding: 3px 8px 5px;
    border-bottom: 1px solid #1e1e1e;
}
.loadout-table td {
    padding: 4px 8px;
    border-bottom: 1px solid #181818;
    color: #888;
}
.loadout-table tr:last-child td { border-bottom: none; }

.prep-fuel-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    padding: 8px 12px;
    background: #0e0e0e;
    border: 1px solid #1e1e1e;
    font-size: 12px;
    color: #888;
}
.fuel-label { color: #555; font-size: 11px; }

/* Route overview */
.prep-route-section {
    position: sticky;
    top: 80px;
}

.route-summary {
    display: flex;
    gap: 8px;
    align-items: center;
    color: #666;
    font-size: 11px;
    margin-bottom: 12px;
    letter-spacing: 0.5px;
}
.route-summary strong { color: #aaa; }

.route-leg-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.route-leg {
    display: flex;
    align-items: stretch;
    background: #0e0e0e;
    border: 1px solid #1e1e1e;
    border-left: 3px solid #1e1e1e;
    overflow: hidden;
}
.route-leg.route-target { border-left-color: #7c3a3a; background: #120a0a; }
.route-leg.route-return { border-left-color: #1e3a1e; background: #0a0f0a; opacity: 0.85; }

.route-leg-num {
    width: 28px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    color: #444;
    background: #0a0a0a;
    border-right: 1px solid #2a2a2a;
}

.route-leg-body {
    flex: 1;
    padding: 6px 8px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.route-leg-type {
    font-size: 11px;
    color: #aaa;
    font-weight: bold;
    letter-spacing: 0.5px;
}
.route-zone-badge {
    font-size: 10px;
    color: #666;
    margin-left: 4px;
}
.route-leg-area {
    font-size: 10px;
    color: #555;
    letter-spacing: 0.5px;
}

.route-leg-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: center;
    gap: 3px;
    padding: 4px 8px;
    flex-shrink: 0;
}
.route-fuel-badge { font-size: 10px; color: #555; letter-spacing: 0.5px; }

/* Launch bar (sticky footer) */
.prep-launch-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #0a0a0a;
    border-top: 1px solid #222;
    padding: 10px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    z-index: 200;
}

.launch-status-msg { font-size: 12px; }

.prep-launch-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.prep-launch-btn:not([disabled]) {
    background: #2a5a2a;
    border-color: #3a8a3a;
    color: #a0e0a0;
}
.prep-launch-btn:not([disabled]):hover { background: #2f6a2f; }

/* =============================================================================
   MISSION FLY PAGE
   ============================================================================= */

.fly-page {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 16px 40px;
}

/* Status bar */
.fly-status-bar {
    position: sticky;
    top: 50px;
    z-index: 100;
    background: #080808;
    border-bottom: 1px solid #2a2a2a;
    padding: 8px 0;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

.fly-status-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.fly-mission-firm {
    color: #aaa;
    font-size: 12px;
    letter-spacing: 0.5px;
}

.fly-status-center {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    justify-content: center;
}

.fly-leg-progress { color: #666; font-size: 12px; }
.fly-leg-progress strong { color: #aaa; }

.fly-mission-status {
    font-size: 10px;
    letter-spacing: 2px;
    padding: 2px 7px;
    border: 1px solid #333;
    color: #888;
}
.fly-mission-status.status-planned { color: #88aacc; border-color: #2a4a7c; }
.fly-mission-status.status-active  { color: #7fc080; border-color: #3a6a3a; }

.fly-status-right { margin-left: auto; }
.fly-current-zone { font-size: 11px; color: #666; letter-spacing: 0.5px; }

/* Main layout */
.fly-layout {
    display: grid;
    grid-template-columns: 1fr 260px;
    gap: 18px;
    align-items: start;
}
@media (max-width: 800px) {
    .fly-layout { grid-template-columns: 1fr; }
}

.fly-main {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/* Compact leg track */
.fly-leg-track {
    display: flex;
    flex-direction: column;
    gap: 2px;
    background: #0a0a0a;
    border: 1px solid #1e1e1e;
    padding: 8px;
}

.fly-leg-track-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 8px;
    border: 1px solid transparent;
    font-size: 11px;
    color: #555;
}
.fly-leg-track-item.leg-done .fly-leg-track-label,
.fly-leg-track-item.leg-done .fly-leg-track-area { opacity: 0.55; }
.fly-leg-track-item.leg-current {
    background: #0e1520;
    border-color: #446688;
    color: #88aacc;
}
.fly-leg-track-item.leg-target { border-left: 2px solid #7c3a3a; }
.fly-leg-track-item.leg-target.leg-current {
    background: #150e0e;
    border-color: #7c3a3a;
    color: #c07070;
}
.fly-leg-track-item.leg-return { opacity: 0.7; }

.fly-leg-track-num {
    width: 20px;
    text-align: center;
    flex-shrink: 0;
    color: #333;
    font-size: 10px;
}
.leg-current .fly-leg-track-num { color: #88aacc; font-weight: bold; }

.fly-leg-track-label {
    font-size: 11px;
    font-weight: bold;
    letter-spacing: 0.5px;
    min-width: 90px;
}
.fly-leg-track-area { font-size: 10px; color: #444; flex: 1; }

.fly-leg-track-enc {
    font-size: 10px;
    padding: 1px 6px;
    border: 1px solid #2a2a2a;
    flex-shrink: 0;
}
.enc-victory    { color: #7fc080; border-color: #3a6a3a; }
.enc-defeat     { color: #c07070; border-color: #7c3a3a; }
.enc-disengaged { color: #c0a050; border-color: #7c6030; }
.enc-clear      { color: #444; border-color: #1e1e1e; }

/* Active leg panel */
.fly-active-leg {
    background: #0c0c0c;
    border: 1px solid #333;
    border-top: 2px solid #446688;
    padding: 16px;
}

.fly-active-leg-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.fly-active-leg-ident {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.fly-active-type {
    font-size: 13px;
    font-weight: bold;
    color: #c8c8c8;
    letter-spacing: 0.5px;
}

.fly-zone-badge {
    font-size: 11px;
    color: #c07070;
    padding: 1px 6px;
    border: 1px solid #7c3a3a;
    background: #140707;
}

.fly-active-area { color: #888; font-size: 12px; }

.fly-active-leg-meta {
    display: flex;
    align-items: center;
    gap: 10px;
}
.fly-leg-fuel { font-size: 11px; color: #555; }

/* Encounter warning */
.fly-encounter-warning {
    background: #120606;
    border: 1px solid #7c3a3a;
    border-left: 3px solid #c07070;
    padding: 8px 12px;
    font-size: 12px;
    color: #c0a080;
    margin-bottom: 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.enc-group {
    font-size: 10px;
    padding: 1px 6px;
    background: #1a0a0a;
    border: 1px solid #5a2a2a;
    color: #c07070;
}
.enc-group.enc-sam { color: #c0a050; border-color: #7c6030; background: #140e00; }
.enc-group.enc-aaa { color: #cc8888; border-color: #8a3030; background: #1a0808; }

/* Action row */
.fly-action-row {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}
.fly-btn { font-size: 13px; padding: 8px 20px; letter-spacing: 0.5px; }
.fly-abort-btn { font-size: 12px; }

/* Leg result area */
.fly-leg-result { margin-top: 14px; }

.fly-msg {
    padding: 8px 12px;
    font-size: 12px;
    border: 1px solid;
}
.fly-msg.msg-danger { color: #c07070; border-color: #7c3a3a; background: #140707; }
.fly-msg.msg-info   { color: #88aacc; border-color: #2a4a7c; background: #07101a; }

/* Clear transit result */
.fly-result-clear {
    padding: 12px 14px;
    background: #0a120a;
    border: 1px solid #2a4a2a;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.fly-result-icon  { font-size: 20px; color: #7fc080; line-height: 1; }
.fly-result-title { font-size: 13px; font-weight: bold; color: #7fc080; }
.fly-result-sub   { font-size: 11px; color: #555; margin-left: 4px; }
.fly-result-radar { font-size: 11px; color: #c0a050; width: 100%; margin-top: 4px; }

/* Combat result header */
.fly-result-summary {
    padding: 12px 14px;
    border: 1px solid;
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}
.result-victory    { border-color: #3a6a3a; background: #060e06; }
.result-defeat     { border-color: #7c3a3a; background: #0e0606; }
.result-disengaged { border-color: #7c6030; background: #100c04; }

.fly-result-outcome-icon { font-size: 22px; line-height: 1; }
.result-victory .fly-result-outcome-icon    { color: #7fc080; }
.result-defeat .fly-result-outcome-icon     { color: #c07070; }
.result-disengaged .fly-result-outcome-icon { color: #c0a050; }

.fly-result-outcome-label {
    font-size: 14px;
    font-weight: bold;
    letter-spacing: 1px;
}
.result-victory .fly-result-outcome-label    { color: #7fc080; }
.result-defeat .fly-result-outcome-label     { color: #c07070; }
.result-disengaged .fly-result-outcome-label { color: #c0a050; }

.fly-result-kills { font-size: 11px; color: #888; margin-left: auto; }

/* Combat log */
.fly-combat-log {
    background: #080808;
    border: 1px solid #1a1a1a;
    padding: 10px 12px;
    max-height: 280px;
    overflow-y: auto;
    font-size: 11px;
}

.fly-round { margin-bottom: 8px; }
.fly-round-header {
    font-size: 10px;
    color: #444;
    letter-spacing: 2px;
    text-transform: uppercase;
    border-bottom: 1px solid #1a1a1a;
    padding-bottom: 3px;
    margin-bottom: 4px;
}

.fly-event {
    padding: 2px 0 2px 6px;
    line-height: 1.5;
    color: #666;
    border-left: 2px solid transparent;
    margin-bottom: 1px;
}
.fly-event.friendly-event { border-left-color: #2a4a2a; color: #7a9a7a; }
.fly-event.enemy-event    { border-left-color: #4a2a2a; color: #9a7a7a; }

/* Post-fly actions */
.fly-post-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    flex-wrap: wrap;
}

/* Objective panel */
.fly-objective-panel {
    background: #0a0e0a;
    border: 1px solid #3a6a3a;
    border-top: 2px solid #7fc080;
    padding: 16px;
}
.fly-objective-header {
    font-size: 14px;
    font-weight: bold;
    color: #7fc080;
    letter-spacing: 1px;
    margin-bottom: 8px;
}
.fly-execute-btn {
    background: #1a4a1a;
    border-color: #3a8a3a;
    color: #a0e0a0;
    font-size: 13px;
    padding: 8px 20px;
}
.fly-execute-btn:hover { background: #2a5a2a; }

.fly-complete-placeholder { padding: 20px; text-align: center; }

/* Mission complete box */
.mission-complete-box {
    background: #080e08;
    border: 1px solid #3a6a3a;
    border-top: 3px solid #7fc080;
    padding: 20px;
    text-align: center;
}
.mission-complete-box h3 {
    color: #7fc080;
    font-size: 16px;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin: 0 0 16px;
}
.mission-result-failed  { border-top-color: #c07070; border-color: #7c3a3a; background: #0e0808; }
.mission-result-failed h3  { color: #c07070; }
.mission-result-aborted { border-top-color: #c0a050; border-color: #7c6030; background: #0e0c06; }
.mission-result-aborted h3 { color: #c0a050; }

.mission-complete-stats {
    display: flex;
    justify-content: center;
    gap: 24px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}
.mission-stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}
.mission-stat-label {
    font-size: 10px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: #555;
}
.mission-stat-value { font-size: 18px; font-weight: bold; color: #c8c8c8; }
.mission-stat-value.positive { color: #7fc080; }
.mission-stat-value.negative { color: #c07070; }

.mission-rep-row    { font-size: 12px; color: #888; margin-bottom: 4px; }
.rep-delta-pos { color: #7fc080; }
.rep-delta-neg { color: #c07070; }

.mission-pilot-row {
    font-size: 11px;
    color: #666;
    padding: 3px 0;
    border-bottom: 1px solid #1a1a1a;
    display: flex;
    gap: 10px;
    align-items: center;
}
.mission-pilot-row:last-child { border-bottom: none; }
.pilot-row-callsign { color: #aaa; font-weight: bold; }
.pilot-row-kia      { color: #c07070; }

/* Sidebar */
.fly-sidebar {
    display: flex;
    flex-direction: column;
    gap: 10px;
    position: sticky;
    top: 90px;
}

.fly-sidebar-title {
    font-size: 10px;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: #444;
    padding-bottom: 6px;
    border-bottom: 1px solid #1e1e1e;
}

.fly-crew-card {
    background: #0a0a0a;
    border: 1px solid #1e1e1e;
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    font-size: 11px;
}

.fly-crew-pilot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
}
.fly-crew-callsign { color: #c8c8c8; font-size: 12px; font-weight: bold; }
.fly-crew-status   { font-size: 10px; letter-spacing: 1px; color: #444; text-transform: uppercase; }
.fly-crew-status.status-kia { color: #c07070; }

.fly-crew-stress {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #555;
    font-size: 11px;
}

.fly-crew-aircraft {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.fly-ac-name { color: #888; font-size: 11px; }
.fly-ac-hp   { font-size: 11px; color: #666; }
.fly-sys-dmg { min-height: 4px; }

.fly-ordnance {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
    margin-top: 2px;
}
.fly-ord-tag {
    font-size: 10px;
    padding: 1px 5px;
    background: #111;
    border: 1px solid #222;
    color: #666;
}

/* =============================================================================
   SHARED PAGE COMPONENTS (used by base, firms, and other pages)
   ============================================================================= */

.page-section-header {
    display: flex;
    align-items: baseline;
    gap: 12px;
    margin-bottom: 14px;
    padding-bottom: 8px;
    border-bottom: 1px solid #222;
    flex-wrap: wrap;
}

.page-section-title {
    font-size: 13px;
    font-weight: bold;
    color: #c8c8c8;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.page-section-meta {
    font-size: 11px;
    color: #555;
}

/* Shared modal overlay + base modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 500;
}

.base-modal {
    background: #0e0e0e;
    border: 1px solid #333;
    border-top: 2px solid #446688;
    padding: 24px;
    min-width: 340px;
    max-width: 480px;
    width: 90%;
}

.modal-title {
    font-size: 14px;
    font-weight: bold;
    color: #c8c8c8;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-bottom: 16px;
}

.modal-body { margin-bottom: 16px; }

.modal-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 12px;
}

.modal-label {
    font-size: 11px;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.modal-select {
    background: #1a1a1a;
    border: 1px solid #333;
    color: #c8c8c8;
    padding: 6px 8px;
    font-family: inherit;
    font-size: 12px;
    width: 100%;
}
.modal-select:focus { outline: none; border-color: #555; }

.modal-cost-row {
    font-size: 12px;
    color: #888;
    margin-top: 8px;
}
.modal-cost-row strong { color: #c8c8c8; }

.modal-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

/* =============================================================================
   BASE MANAGEMENT PAGE
   ============================================================================= */

.base-page {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px 16px 40px;
}

/* Flash message */
.base-msg {
    padding: 9px 14px;
    margin-bottom: 14px;
    font-size: 12px;
    letter-spacing: 0.5px;
    border: 1px solid;
}
.base-msg.msg-success { color: #7fc080; border-color: #3a6a3a; background: #061006; }
.base-msg.msg-danger  { color: #c07070; border-color: #7c3a3a; background: #140707; }
.base-msg.msg-warning { color: #c0a050; border-color: #7c6030; background: #141005; }

/* Base list */
.base-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 24px;
}

/* Individual base card */
.base-card {
    background: #0a0a0a;
    border: 1px solid #2a2a2a;
}

.base-card-header {
    padding: 14px 16px;
    border-bottom: 1px solid #1a1a1a;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.base-card-title-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.base-name {
    font-size: 14px;
    font-weight: bold;
    color: #c8c8c8;
    letter-spacing: 0.5px;
}

.base-primary-badge {
    font-size: 9px;
    letter-spacing: 2px;
    padding: 2px 6px;
    background: #0a1a0a;
    border: 1px solid #3a6a3a;
    color: #7fc080;
}
.base-secondary-badge {
    font-size: 9px;
    letter-spacing: 2px;
    padding: 2px 6px;
    background: #0e0e14;
    border: 1px solid #2a2a4a;
    color: #7080a0;
}

.base-area-name {
    font-size: 12px;
    color: #888;
}

.base-card-meta-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.base-upkeep-label { font-size: 11px; color: #555; }
.base-upkeep-val   { font-size: 12px; color: #ff8800; font-weight: bold; }
.base-slot-count   { font-size: 11px; color: #555; margin-left: auto; }

.base-installed-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 2px;
}

.upg-chip {
    font-size: 10px;
    padding: 1px 7px;
    background: #0e1a0e;
    border: 1px solid #2a4a2a;
    color: #7fc080;
    letter-spacing: 0.5px;
}

.base-no-upgrades { font-size: 11px; margin-top: 2px; }

/* Manage bar + full tag */
.base-manage-bar {
    padding: 8px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    background: #080808;
    border-bottom: 1px solid #1a1a1a;
}

.base-full-tag {
    font-size: 10px;
    letter-spacing: 2px;
    color: #c0a050;
    border: 1px solid #7c6030;
    padding: 1px 6px;
}

/* Upgrade management panel */
.base-upgrade-panel {
    padding: 0;
}

.base-upg-subsection {
    padding: 14px 16px;
    border-bottom: 1px solid #1a1a1a;
}
.base-upg-subsection:last-child { border-bottom: none; }

.base-upg-subsection-title {
    font-size: 10px;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: #555;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.base-upg-count { color: #888; }

/* Installed upgrades list */
.base-installed-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.base-installed-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 8px 10px;
    background: #0e0e0e;
    border: 1px solid #1e1e1e;
    border-left: 3px solid #2a4a2a;
}

.base-installed-info { flex: 1; }

.base-installed-name {
    font-size: 12px;
    font-weight: bold;
    color: #c8c8c8;
    margin-bottom: 2px;
}

.base-installed-desc {
    font-size: 11px;
    color: #666;
    line-height: 1.4;
}

.base-installed-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 5px;
    flex-shrink: 0;
}

.base-installed-upkeep {
    font-size: 11px;
    color: #c07070;
    font-weight: bold;
}

/* Available upgrade cards */
.base-upg-available-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 8px;
}

.base-upg-card {
    background: #0e0e0e;
    border: 1px solid #222;
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.base-upg-card.upg-card-disabled {
    opacity: 0.45;
}

.base-upg-card-name {
    font-size: 12px;
    font-weight: bold;
    color: #aaa;
}

.base-upg-card-desc {
    font-size: 11px;
    color: #666;
    line-height: 1.4;
    flex: 1;
}

.base-upg-card-costs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 4px 0;
    font-size: 11px;
}

.base-upg-one-time { color: #ff8800; font-weight: bold; }
.base-upg-weekly   { color: #888; }

/* Buy new base bar */
.base-buy-bar {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 16px;
    background: #0a0a0a;
    border: 1px solid #2a2a2a;
    border-left: 3px solid #446688;
    flex-wrap: wrap;
}

.base-buy-info {
    display: flex;
    flex-direction: column;
    gap: 3px;
    flex: 1;
}

.base-buy-label {
    font-size: 13px;
    font-weight: bold;
    color: #c8c8c8;
}

/* =============================================================================
   FIRMS PAGE
   ============================================================================= */

.firms-page {
    max-width: 1100px;
    margin: 0 auto;
    padding: 20px 16px 40px;
}

/* Firms grid: two columns */
.firms-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(460px, 1fr));
    gap: 14px;
    margin-bottom: 28px;
}

@media (max-width: 760px) {
    .firms-grid { grid-template-columns: 1fr; }
}

/* Firm card */
.firm-card {
    background: #0a0a0a;
    border: 1px solid #2a2a2a;
    display: flex;
    flex-direction: column;
}

.firm-card-header {
    padding: 14px 16px;
    border-bottom: 1px solid #1a1a1a;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.firm-card-title-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.firm-name {
    font-size: 14px;
    font-weight: bold;
    color: #c8c8c8;
    letter-spacing: 0.5px;
}

/* Tier badges */
.rep-tier-badge {
    font-size: 10px;
    letter-spacing: 2px;
    text-transform: uppercase;
    padding: 2px 7px;
    border: 1px solid;
}
.rep-tier-badge.tier-unknown   { color: #666;    border-color: #2a2a2a; background: #0a0a0a; }
.rep-tier-badge.tier-known     { color: #88aacc; border-color: #2a4a7c; background: #07101a; }
.rep-tier-badge.tier-trusted   { color: #7fc080; border-color: #3a6a3a; background: #061006; }
.rep-tier-badge.tier-allied    { color: #ccaa44; border-color: #7c6020; background: #140e00; }
.rep-tier-badge.tier-legendary { color: #ff8800; border-color: #7c3a00; background: #1a0a00; }

.firm-suspended-tag {
    font-size: 10px;
    letter-spacing: 1.5px;
    padding: 2px 6px;
    background: #1a0707;
    border: 1px solid #7c3a3a;
    color: #c07070;
}

.firm-hq {
    font-size: 11px;
    letter-spacing: 0.5px;
}

.firm-description {
    font-size: 11px;
    color: #888;
    line-height: 1.5;
}

/* Reputation bar area */
.firm-rep-area {
    padding: 10px 16px 4px;
    border-bottom: 1px solid #1a1a1a;
}

.firm-rep-score-row {
    display: flex;
    align-items: baseline;
    gap: 6px;
    margin-bottom: 8px;
}

.firm-rep-score {
    font-size: 20px;
    font-weight: bold;
    color: #c8c8c8;
}

.firm-rep-max {
    font-size: 13px;
    color: #555;
}

.firm-rep-next {
    font-size: 11px;
    margin-left: 4px;
}

/* Rep bar */
.rep-bar-container {
    position: relative;
    margin-bottom: 18px;
}

.rep-bar-track {
    position: relative;
    height: 6px;
    background: #1a1a1a;
    border: 1px solid #252525;
    overflow: visible;
}

.rep-bar-fill {
    height: 100%;
    transition: width 0.3s ease;
}
.tier-fill-unknown   { background: #333; }
.tier-fill-known     { background: #2a4a7c; }
.tier-fill-trusted   { background: #3a6a3a; }
.tier-fill-allied    { background: #7c6020; }
.tier-fill-legendary { background: #7c3a00; }

.rep-bar-tick {
    position: absolute;
    top: -3px;
    width: 1px;
    height: 12px;
    background: #444;
    transform: translateX(-50%);
}

.rep-bar-labels {
    position: relative;
    height: 16px;
    margin-top: 4px;
}
.rep-bar-labels span {
    position: absolute;
    font-size: 9px;
    color: #444;
    transform: translateX(-50%);
    white-space: nowrap;
}

/* Benefits row */
.firm-benefits-row {
    display: flex;
    padding: 10px 16px;
    gap: 0;
    border-bottom: 1px solid #1a1a1a;
    flex-wrap: wrap;
}

.firm-benefit-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    min-width: 100px;
    padding: 0 10px;
    border-right: 1px solid #1a1a1a;
}
.firm-benefit-item:first-child { padding-left: 0; }
.firm-benefit-item:last-child  { border-right: none; }

.benefit-label {
    font-size: 10px;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #555;
}
.benefit-val {
    font-size: 13px;
    font-weight: bold;
    color: #c8c8c8;
}

/* Rival warning */
.firm-rival-warn {
    padding: 7px 16px;
    background: #120c06;
    border-bottom: 1px solid #1a1a1a;
    border-left: 3px solid #7c6030;
    font-size: 11px;
    color: #c0a050;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}
.rival-icon { font-size: 12px; }
.rival-note { font-size: 10px; }

/* Equipment access toggle */
.firm-access-toggle {
    padding: 8px 16px;
    background: #080808;
}

/* Equipment access panel */
.firm-access-panel {
    padding: 12px 16px;
    background: #080808;
    border-top: 1px solid #1a1a1a;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.firm-access-section {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.firm-access-label {
    font-size: 10px;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: #555;
}

.firm-access-detail {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.access-soph {
    font-size: 12px;
    color: #aaa;
    font-weight: bold;
    padding: 1px 6px;
    background: #131313;
    border: 1px solid #252525;
}

.access-mfr {
    font-size: 11px;
    color: #888;
}

.access-discount {
    font-size: 11px;
    color: #7fc080;
    font-weight: bold;
    padding: 1px 5px;
    background: #061006;
    border: 1px solid #2a4a2a;
}

.firm-access-note {
    font-size: 11px;
    line-height: 1.4;
}

/* Legendary perk box */
.legendary-perk-box {
    padding: 10px 12px;
    background: #120e00;
    border: 1px solid #7c5500;
    border-left: 3px solid #ff8800;
}

.legendary-perk-label {
    font-size: 11px;
    font-weight: bold;
    color: #ff8800;
    letter-spacing: 1px;
    margin-bottom: 4px;
}

.legendary-perk-text {
    font-size: 12px;
    color: #c8a060;
    line-height: 1.4;
}

/* Reputation history section */
.rep-history-section {
    margin-top: 4px;
}

.rep-history-toggle {
    margin-bottom: 10px;
}

.rep-history-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.rep-history-table th {
    text-align: left;
    font-size: 10px;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #555;
    padding: 5px 8px 6px;
    border-bottom: 1px solid #222;
}

.rep-history-table td {
    padding: 7px 8px;
    border-bottom: 1px solid #1a1a1a;
    border-right: 1px solid #2a2a2a;
    color: #888;
    vertical-align: middle;
}
.rep-history-table td:last-child { border-right: none; }

.rep-history-table tbody tr:nth-child(even) td { background: #1e1e1e; }
.rep-history-table tr:last-child td { border-bottom: none; }
.rep-history-table tr:hover td      { background: #2e2e2e !important; }

.rep-hist-week  { color: #666; font-size: 11px; }
.rep-hist-score { color: #888; font-size: 11px; }
.rep-hist-reason { max-width: 300px; }

.rep-delta-pill {
    display: inline-block;
    font-size: 11px;
    font-weight: bold;
    padding: 1px 6px;
    border: 1px solid;
}
.rep-delta-pos { color: #7fc080; border-color: #3a6a3a; background: #061006; }
.rep-delta-neg { color: #c07070; border-color: #7c3a3a; background: #140707; }

/* =============================================================================
   MARKET PAGE
   ============================================================================= */

.market-ac-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
    margin-bottom: 8px;
}

.market-ac-card {
    background: #111;
    border: 1px solid #2a2a2a;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.market-ac-card:hover { border-color: #3a3a3a; }
.market-special-card  { border-color: #4a3a0a; background: #0e0c04; }
.market-special-card:hover { border-color: #6a5a1a; }

.market-ac-header {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.market-ac-name {
    font-weight: bold;
    color: #d0d0d0;
    flex: 1;
    min-width: 120px;
}

.market-cond-badge {
    font-size: 10px;
    font-weight: bold;
    letter-spacing: 0.05em;
    padding: 2px 6px;
    border: 1px solid;
    text-transform: uppercase;
}
.cond-good    { color: #7fc080; border-color: #3a6a3a; background: #071207; }
.cond-fair    { color: #c0b870; border-color: #6a5a1a; background: #0e0c04; }
.cond-poor    { color: #c07070; border-color: #7c3a3a; background: #140707; }
.cond-special { color: #a07ce0; border-color: #5a3a9a; background: #0a0614; }

.market-soph-badge {
    font-size: 10px;
    color: #666;
    padding: 2px 6px;
    border: 1px solid #2a2a2a;
}

.market-ac-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 14px;
}
.market-ac-stat   { display: flex; flex-direction: column; gap: 2px; }
.market-stat-label {
    font-size: 10px;
    color: #555;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.market-stat-val  { font-size: 12px; color: #bbb; }

.market-ac-price-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 4px;
    border-top: 1px solid #1e1e1e;
    padding-top: 10px;
}
.market-price-block    { display: flex; flex-direction: column; gap: 2px; }
.market-asking-price   { font-size: 18px; font-weight: bold; color: #c8a84a; }
.market-base-was       { font-size: 11px; }
.market-repair-est     { font-size: 11px; color: #c07070; }
.market-was            { font-size: 11px; }
.market-surplus-table  { margin-bottom: 8px; }

/* =============================================================================
   HISTORY PAGE
   ============================================================================= */

.hist-nav {
    display: flex;
    gap: 4px;
    border-bottom: 1px solid #2a2a2a;
    margin-bottom: 20px;
}
.hist-tab-btn {
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: #666;
    font-family: inherit;
    font-size: 13px;
    font-weight: bold;
    letter-spacing: 0.05em;
    padding: 8px 16px;
    cursor: pointer;
    text-transform: uppercase;
    margin-bottom: -1px;
    transition: color 0.15s, border-color 0.15s;
}
.hist-tab-btn:hover  { color: #aaa; }
.hist-tab-btn.active { color: #c8a84a; border-bottom-color: #c8a84a; }

.hist-mission-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    margin-bottom: 8px;
}
.hist-mission-table th {
    text-align: left;
    padding: 6px 10px;
    color: #555;
    font-size: 11px;
    font-weight: bold;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    border-bottom: 1px solid #2a2a2a;
}
.hist-mission-table td {
    padding: 8px 10px;
    border-bottom: 1px solid #191919;
    border-right: 1px solid #2a2a2a;
    color: #bbb;
    vertical-align: middle;
}
.hist-mission-table td:last-child { border-right: none; }
.hist-mission-table tbody tr:nth-child(even) td { background: #1e1e1e; }
.hist-mission-row:hover td { background: #2e2e2e !important; }
.hist-week { color: #666; font-size: 11px; white-space: nowrap; }

.mission-status-pill {
    display: inline-block;
    font-size: 10px;
    font-weight: bold;
    letter-spacing: 0.05em;
    padding: 2px 7px;
    border: 1px solid;
    text-transform: uppercase;
}
.mission-ok    { color: #7fc080; border-color: #3a6a3a; background: #071207; }
.mission-fail  { color: #c07070; border-color: #7c3a3a; background: #140707; }
.mission-abort { color: #c0a060; border-color: #7c5a1a; background: #120d04; }

.hist-mission-detail td {
    background: #0b0b0b !important;
    border-bottom: 2px solid #2a2a2a;
}
.mission-detail-inner {
    padding: 10px 4px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.mission-crew-title {
    font-size: 11px;
    font-weight: bold;
    color: #555;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 4px;
}
.mission-crew-table { border-collapse: collapse; font-size: 12px; width: 100%; }
.mission-crew-table th {
    text-align: left;
    padding: 4px 8px;
    color: #444;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-bottom: 1px solid #222;
}
.mission-crew-table td {
    padding: 5px 8px;
    color: #aaa;
    border-bottom: 1px solid #181818;
    border-right: 1px solid #161616;
}
.mission-crew-table td:last-child { border-right: none; }
.mission-crew-table tbody tr:nth-child(even) td { background: rgba(255,255,255,0.025); }

.mission-flags { display: flex; gap: 12px; flex-wrap: wrap; }
.flag-ok       { font-size: 12px; color: #7fc080; }
.flag-warn     { font-size: 12px; color: #c0a060; }
.mission-notes { font-size: 12px; font-style: italic; }

.hist-pagination { display: flex; align-items: center; gap: 10px; margin-top: 12px; }
.hist-page-info  { color: #555; font-size: 12px; }

.pilot-sub-tabs { display: flex; gap: 4px; margin-bottom: 14px; }
.pilot-sub-btn {
    background: none;
    border: 1px solid #2a2a2a;
    color: #666;
    font-family: inherit;
    font-size: 12px;
    padding: 5px 14px;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.pilot-sub-btn:hover  { border-color: #444; color: #aaa; }
.pilot-sub-btn.active { border-color: #c8a84a; color: #c8a84a; background: #0e0b02; }

.hist-pilot-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.hist-pilot-table th {
    text-align: left;
    padding: 6px 10px;
    color: #555;
    font-size: 11px;
    font-weight: bold;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    border-bottom: 1px solid #2a2a2a;
}
.hist-pilot-table td {
    padding: 8px 10px;
    border-bottom: 1px solid #191919;
    border-right: 1px solid #2a2a2a;
    color: #bbb;
}
.hist-pilot-table td:last-child { border-right: none; }
.hist-pilot-table tbody tr:nth-child(even) td { background: #1e1e1e; }
.hist-pilot-table tr:hover td { background: #2e2e2e !important; }
.pilot-callsign { color: #888; font-style: italic; }

.pilot-row-kia td        { color: #555; font-style: italic; opacity: 0.7; }
.pilot-row-dismissed td  { color: #555; opacity: 0.6; }
.kia-mark { color: #7c3a3a; font-size: 12px; margin-left: 4px; }

.hist-fin-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.hist-fin-table th {
    text-align: left;
    padding: 6px 10px;
    color: #555;
    font-size: 11px;
    font-weight: bold;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    border-bottom: 1px solid #2a2a2a;
}
.hist-fin-table td {
    padding: 7px 10px;
    border-bottom: 1px solid #191919;
    border-right: 1px solid #2a2a2a;
    color: #bbb;
}
.hist-fin-table td:last-child { border-right: none; }
.hist-fin-table tbody tr:nth-child(even) td { background: #1e1e1e; }
.hist-fin-table tr:hover td { background: #2e2e2e !important; }
.fin-credit { color: #7fc080; }
.fin-debit  { color: #c07070; }
.fin-amount { font-weight: bold; font-size: 13px; }

.world-events-list  { display: flex; flex-direction: column; }
.world-event-row {
    display: flex;
    align-items: baseline;
    gap: 10px;
    padding: 8px 10px;
    border-bottom: 1px solid #191919;
    font-size: 13px;
}
.world-event-row:hover { background: #0e0e0e; }
.world-ev-week {
    flex-shrink: 0;
    width: 40px;
    font-size: 11px;
    color: #555;
}
.world-ev-type {
    flex-shrink: 0;
    width: 130px;
    font-size: 10px;
    font-weight: bold;
    color: #555;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.world-ev-body { color: #bbb; flex: 1; }
.ev-type-world_news        .world-ev-type { color: #c8a84a; }
.ev-type-territory_change  .world-ev-type { color: #7fc080; }
.ev-type-threat_change     .world-ev-type { color: #c07070; }
.ev-type-reputation_change .world-ev-type { color: #7a9cc0; }

/* =============================================================================
   SESSION 15 — UI POLISH
   ============================================================================= */

/* --- Status strip ---------------------------------------------------------- */
.status-strip {
    background: #0a0a0a;
    border-bottom: 1px solid #1e1e1e;
    padding: 4px 16px;
    font-size: 11px;
    color: #555;
    letter-spacing: 0.03em;
    text-align: right;
}
.ss-cash { color: #7fc080; font-weight: bold; }
.ss-cash-neg { color: #c07070 !important; }

/* --- Site footer ----------------------------------------------------------- */
.site-footer {
    margin-top: 32px;
    padding: 10px 24px;
    border-top: 1px solid #1a1a1a;
    font-size: 11px;
    color: #333;
    text-align: center;
}
.god-mode-warn {
    color: #c8a840;
    font-weight: bold;
}

/* --- Button overhaul ------------------------------------------------------- */
.btn-primary {
    background: #1a0a00;
    color: #ff8800;
    border-color: #cc6600;
    width: 100%;
}
.btn-primary:hover {
    background: #2a1200;
    color: #ffaa44;
    border-color: #dd7700;
    text-decoration: none;
}

.btn-danger {
    background: transparent;
    color: #cc4444;
    border-color: #7c2a2a;
}
.btn-danger:hover {
    background: #1a0000;
    color: #ff6666;
    border-color: #aa3333;
    text-decoration: none;
}

/* --- Disabled buttons ------------------------------------------------------ */
.btn[disabled], .btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* --- Flash message aliases ------------------------------------------------- */
.msg-success, .alert-success { background: #0a1a0a; color: #7fc080; border: 1px solid #2a5a2a; padding: 8px 14px; border-radius: 3px; margin-bottom: 12px; }
.msg-danger,  .alert-danger  { background: #1a0a0a; color: #c07070; border: 1px solid #5a2a2a; padding: 8px 14px; border-radius: 3px; margin-bottom: 12px; }
.msg-warning, .alert-warning { background: #1a1400; color: #c8a840; border: 1px solid #5a4a00; padding: 8px 14px; border-radius: 3px; margin-bottom: 12px; }

/* --- Overweight pulse animation -------------------------------------------- */
@keyframes pulse-border {
    0%   { border-color: #7c2a2a; }
    50%  { border-color: #cc4444; }
    100% { border-color: #7c2a2a; }
}
.overweight-pulse {
    animation: pulse-border 1s ease infinite;
    border: 1px solid #cc4444;
    border-radius: 2px;
    padding: 0 3px;
}

/* --- Stress bar transition ------------------------------------------------- */
.stress-bar {
    transition: width 0.6s ease;
}

/* --- Dashboard: no-contract CTA ------------------------------------------- */
.no-contract-cta {
    padding: 12px 16px;
    border: 1px solid #5a4a00;
    border-radius: 3px;
    background: #0e0c00;
    color: #c8a840;
    font-size: 13px;
}
.no-contract-cta a { color: #ffcc44; text-decoration: underline; }
.no-contract-cta a:hover { color: #ffe080; }

/* --- Contracts: active card prominence ------------------------------------- */
.contract-active-prominent {
    border: 1px solid #cc6600 !important;
    background: #120a00 !important;
}

/* --- Mission prep: readiness checklist ------------------------------------- */
.prep-checklist {
    display: flex;
    gap: 16px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}
.prep-check {
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 2px;
    border: 1px solid #2a2a2a;
    background: #0e0e0e;
}
.prep-check-ok   { color: #7fc080; border-color: #2a5a2a; background: #0a150a; }
.prep-check-fail { color: #888;    border-color: #2a2a2a; }

/* --- Mission fly: CONTACT header ------------------------------------------- */
.fly-contact-header {
    font-size: 22px;
    font-weight: bold;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: #ff4400;
    border-bottom: 2px solid #cc3300;
    padding-bottom: 6px;
    margin-bottom: 10px;
    text-shadow: 0 0 10px #ff440088;
}

/* --- Firms: rep bar tier labels -------------------------------------------- */
.rep-bar-tier-labels {
    position: relative;
    height: 14px;
    margin-bottom: 2px;
}
.rep-bar-tier-labels span {
    position: absolute;
    transform: translateX(-50%);
    font-size: 9px;
    color: #555;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
}

/* --- Firms: legendary perk glow -------------------------------------------- */
.legendary-perk-box {
    box-shadow: 0 0 12px #c8a840, 0 0 24px #6a4a00;
}
.ev-type-week_start        .world-ev-type { color: #444; }

/* ── Tooltip ──────────────────────────────────────────────────────── */
.game-tooltip {
    position: fixed;
    background: #0e0e0e;
    color: #b8b8b8;
    border: 1px solid #333;
    border-radius: 3px;
    padding: 7px 11px;
    font-size: 11px;
    line-height: 1.55;
    max-width: 260px;
    white-space: pre-line;
    pointer-events: none;
    z-index: 9999;
    box-shadow: 0 3px 10px rgba(0,0,0,0.7);
    opacity: 0;
    transition: opacity 0.1s;
}
.game-tooltip.tt-visible { opacity: 1; }
[data-tooltip] { cursor: help; }

/* =============================================================================
   WEEK CYCLE REDESIGN — Session B additions
   ============================================================================= */

/* --- Urgency badges --------------------------------------------------------- */
.urgency-badge {
    display: inline-block;
    font-size: 10px;
    font-weight: bold;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 1px 7px;
    border-radius: 3px;
    margin-left: 4px;
    vertical-align: middle;
}
.urgency-low      { background: #14294a; color: #6aaee0; border: 1px solid #1d4a80; }
.urgency-normal   { background: #222;    color: #888;    border: 1px solid #333; }
.urgency-high     { background: #3a2200; color: #e08020; border: 1px solid #6a3800; }
.urgency-critical { background: #3a0a0a; color: #e04040; border: 1px solid #801010; }

/* --- Stage indicator (dashboard) ------------------------------------------- */
.stage-indicator {
    border-radius: 5px;
    padding: 12px 16px;
    margin-bottom: 16px;
    border: 1px solid #333;
    background: #111;
}
.stage-planning { border-left: 4px solid #2a7a2a; }
.stage-flying   { border-left: 4px solid #c07820; }
.stage-debrief  { border-left: 4px solid #1a4a8a; }

.stage-badge-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 4px;
}
.stage-week-label { font-size: 13px; font-weight: bold; color: #b8b8b8; }
.stage-sep        { color: #444; }
.stage-name       { font-size: 13px; font-weight: bold; letter-spacing: 0.08em; }
.stage-planning .stage-name { color: #5ec05e; }
.stage-flying   .stage-name { color: #e09820; }
.stage-debrief  .stage-name { color: #4a8adf; }

.stage-sub      { font-size: 11px; color: #666; margin-bottom: 8px; }
.stage-action-link { color: #c8c8c8; text-decoration: underline; margin-left: 8px; }

.stage-steps    { display: flex; align-items: center; gap: 6px; margin-top: 6px; }
.stage-step     { font-size: 10px; letter-spacing: 0.06em; text-transform: uppercase; color: #444; }
.stage-step-active { color: #c8c8c8; font-weight: bold; }
.stage-step-done   { color: #555; text-decoration: line-through; }
.stage-arrow    { color: #333; }

/* --- Stage sub-header (mission_prep / mission_fly / debrief pages) ---------- */
.stage-sub-header {
    padding: 8px 14px;
    border-radius: 4px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 12px;
}
.stage-sub-header.stage-planning { background: #0a1a0a; border: 1px solid #1a3a1a; }
.stage-sub-header.stage-flying   { background: #1a0e00; border: 1px solid #4a2800; }
.stage-sub-header.stage-debrief  { background: #080e1a; border: 1px solid #1a2a4a; }
.stage-sub-hint { color: #666; }

/* --- Dashboard: contract list ----------------------------------------------- */
.dash-contract-list   { display: flex; flex-direction: column; gap: 6px; }
.dash-contract-row    { display: flex; align-items: center; gap: 10px; padding: 6px 10px; background: #111; border: 1px solid #222; border-radius: 4px; flex-wrap: wrap; font-size: 12px; }
.dash-contract-urgent { border-left: 3px solid #c06060; }
.dash-contract-firm   { color: #888; }
.dash-contract-area   { color: #b0b0b0; }
.dash-contract-pay    { color: #8dc88d; font-weight: bold; }
.dash-contract-deadline { font-size: 11px; color: #777; }
.dash-contract-status   { font-size: 10px; letter-spacing: 0.05em; text-transform: uppercase; color: #555; }
.deadline-urgent        { color: #c06060 !important; }

/* --- Dashboard: mission queue (mini) --------------------------------------- */
.dash-mission-queue  { display: flex; flex-direction: column; gap: 5px; }
.dash-mq-row         { display: flex; align-items: center; gap: 10px; padding: 5px 10px; background: #111; border: 1px solid #222; border-radius: 4px; font-size: 12px; }
.mq-area             { color: #b0b0b0; }
.mq-firm             { color: #777; font-size: 11px; }
.mq-status-badge     { font-size: 10px; font-weight: bold; letter-spacing: 0.06em; text-transform: uppercase; }
.mq-badge-assigned   { color: #888; }
.mq-badge-in_flight  { color: #e09820; }
.mq-badge-complete,
.mq-badge-completed  { color: #5ec05e; }
.mq-badge-aborted    { color: #c06060; }

/* --- Nav lock (flying phase) ----------------------------------------------- */
a.nav-locked { opacity: 0.45; cursor: not-allowed; position: relative; }
a.nav-locked:hover { color: #888; }

.nav-lock-banner {
    position: fixed;
    top: 0; left: 0; right: 0;
    background: #3a1a00;
    color: #e09820;
    border-bottom: 1px solid #6a3800;
    padding: 10px 20px;
    font-size: 13px;
    font-weight: bold;
    text-align: center;
    z-index: 10000;
}

/* --- Flying lock badge on contracts page ------------------------------------ */
.flying-lock-badge {
    font-size: 10px;
    background: #1a0e00;
    color: #e09820;
    border: 1px solid #6a3800;
    border-radius: 3px;
    padding: 2px 8px;
    margin-left: 10px;
    letter-spacing: 0.04em;
}

/* --- Contract: time limit inline + deadline urgency ------------------------- */
.contract-timelimit { font-size: 10px; color: #666; }
.ac-deadline-row    { font-size: 11px; color: #777; margin: 3px 0; }
.contract-deadline-urgent { border-left: 3px solid #c06060 !important; }

/* --- Mission Prep: new layout sections ------------------------------------- */
.prep-sub-section    { margin-bottom: 18px; }
.section-subtitle    { font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: #555; margin-bottom: 8px; font-weight: bold; }
.prep-contract-list  { display: flex; flex-direction: column; gap: 8px; }
.prep-contract-card  { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; background: #111; border: 1px solid #222; border-radius: 5px; padding: 10px 14px; }
.prep-contract-ident { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.prep-contract-meta  { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 11px; color: #777; flex: 1; }
.prep-contract-actions { margin-left: auto; }
.prep-pay            { font-size: 13px; font-weight: bold; color: #8dc88d; }
.prep-penalty-note   { font-size: 10px; color: #c06060; }
.prep-deadline       { font-size: 11px; color: #888; }
.prep-firm-name      { color: #b0b0b0; font-size: 12px; }

.prep-assign-panel   { background: #0e1a0e; border: 1px solid #1a3a1a; border-radius: 5px; padding: 14px 16px; }
.prep-assign-bar     { display: flex; align-items: center; justify-content: flex-end; gap: 12px; padding-top: 12px; border-top: 1px solid #1a2a1a; margin-top: 10px; }

.prep-assigned-list  { display: flex; flex-direction: column; gap: 8px; }
.prep-assigned-row   { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; background: #111; border: 1px solid #1a3a1a; border-radius: 4px; padding: 8px 12px; }
.prep-assigned-ident { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 12px; flex: 1; }
.prep-assigned-crew  { font-size: 11px; color: #777; }
.prep-assigned-actions { margin-left: auto; }
.crew-chip           { background: #1a1a1a; border: 1px solid #2a2a2a; border-radius: 3px; padding: 1px 6px; font-size: 11px; color: #b0b0b0; }

.prep-commit-section  { background: #0a0a0a; border: 1px solid #222; border-radius: 5px; padding: 14px 16px; }
.prep-commit-bar      { display: flex; flex-direction: column; gap: 10px; }
.prep-commit-bar--empty { align-items: center; }
.prep-commit-warn     { font-size: 11px; color: #888; }
.prep-commit-actions  { display: flex; gap: 10px; }
.prep-commit-btn      { font-size: 14px; padding: 10px 22px; }

/* --- Mission fly: queue view ----------------------------------------------- */
.fly-queue-header  { margin-bottom: 10px; }
.fly-queue-list    { display: flex; flex-direction: column; gap: 8px; margin-bottom: 20px; }
.fly-queue-row     { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; background: #111; border: 1px solid #222; border-radius: 4px; padding: 10px 14px; }
.fly-queue-ident   { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.fly-queue-area    { font-size: 13px; color: #b0b0b0; }
.fly-queue-firm    { font-size: 11px; color: #666; }
.fly-queue-crew    { display: flex; gap: 6px; flex-wrap: wrap; }
.fly-queue-status  { display: flex; align-items: center; gap: 10px; }
.fly-queue-footer  { border-top: 1px solid #222; padding-top: 14px; display: flex; align-items: center; gap: 14px; }

.mq-status-in_flight { border-left: 3px solid #e09820; }
.mq-status-complete,
.mq-status-completed { border-left: 3px solid #2a7a2a; opacity: 0.75; }
.mq-status-aborted   { border-left: 3px solid #6a1a1a; opacity: 0.75; }

/* --- Debrief page ----------------------------------------------------------- */
.debrief-page          { max-width: 980px; margin: 0 auto; padding: 0 10px 40px; }
.debrief-section       { background: #0d0d0d; border: 1px solid #222; border-radius: 5px; padding: 16px 18px; margin-bottom: 16px; }
.debrief-section-title { font-size: 13px; letter-spacing: 0.1em; text-transform: uppercase; color: #888; margin: 0 0 12px; font-weight: bold; border-bottom: 1px solid #1a1a1a; padding-bottom: 8px; }
.debrief-table         { width: 100%; border-collapse: collapse; font-size: 12px; }
.debrief-table th      { text-align: left; color: #555; font-size: 10px; letter-spacing: 0.06em; text-transform: uppercase; padding: 4px 8px; border-bottom: 1px solid #1a1a1a; }
.debrief-table td      { padding: 5px 8px; border-bottom: 1px solid #141414; color: #b0b0b0; }
.debrief-row-ok        { border-left: 3px solid #2a5a2a; }
.debrief-row-fail      { border-left: 3px solid #6a1a1a; }
.debrief-row-aborted   { border-left: 3px solid #4a3a00; }
.debrief-row-warn      { border-left: 3px solid #8a4000; }

.debrief-pilot-grid     { display: flex; flex-wrap: wrap; gap: 10px; }
.debrief-pilot-card     { background: #111; border: 1px solid #222; border-radius: 4px; padding: 10px 14px; min-width: 200px; }
.debrief-levelup        { border-color: #2a7a2a; background: #0a150a; }
.debrief-kia            { border-color: #6a1a1a; background: #150a0a; opacity: 0.8; }
.debrief-pilot-name     { font-size: 13px; font-weight: bold; color: #c8c8c8; margin-bottom: 6px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.debrief-pilot-stats    { display: flex; flex-wrap: wrap; gap: 6px; }
.debrief-stat           { font-size: 11px; background: #1a1a1a; border: 1px solid #2a2a2a; border-radius: 3px; padding: 1px 6px; color: #b0b0b0; }
.debrief-levelup-badge  { font-size: 10px; color: #5ec05e; background: #0a200a; border: 1px solid #2a7a2a; border-radius: 3px; padding: 1px 6px; }
.debrief-kia-badge      { font-size: 10px; color: #e04040; background: #200a0a; border: 1px solid #801010; border-radius: 3px; padding: 1px 6px; }
.debrief-injured-badge  { font-size: 10px; color: #e09820; background: #200e00; border: 1px solid #803800; border-radius: 3px; padding: 1px 6px; }

.debrief-deadline-failed { background: #1a0808; border: 1px solid #6a1a1a; border-radius: 4px; padding: 10px 14px; margin-bottom: 12px; }
.debrief-deadline-row   { font-size: 12px; color: #e04040; padding: 3px 0; }

.debrief-financials      { display: flex; flex-direction: column; gap: 6px; max-width: 420px; }
.debrief-fin-row         { display: flex; justify-content: space-between; align-items: center; font-size: 12px; padding: 4px 0; border-bottom: 1px solid #141414; }
.debrief-fin-total       { font-size: 14px; font-weight: bold; border-bottom: none; padding-top: 8px; border-top: 1px solid #333; }
.debrief-fin-label       { color: #888; }
.debrief-fin-value       { color: #c8c8c8; font-weight: bold; }
.debrief-fin-warn        { font-size: 11px; color: #c06060; margin-top: 6px; }

.debrief-end-bar         { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; padding: 16px; background: #0a0a0a; border: 1px solid #222; border-radius: 5px; }
.debrief-end-note        { font-size: 11px; color: #666; text-align: right; }
.debrief-end-btn         { font-size: 14px; padding: 12px 28px; }
