/* ==========================================================================
 * Flights board / cargo operations styles
 * --------------------------------------------------------------------------
 * Matches leapdyn.com's existing design language (css/default.css): "Open
 * Sans" body font, the site's #F44336 red accent, light #ededed/#cccccc
 * content panels, the flat rounded button system shared with css/default.css's
 * .button, and the green/red/black status-color convention used on dispatch.php.
 * ========================================================================== */
:root{
  --cargo-red:#F44336;      /* site brand accent, matches header-bar/nav hover */
  --cargo-panel:#ededed;    /* content panel background, matches existing content tables */
  --cargo-line:#cccccc;     /* panel borders, matches .nav / .shadedlink        */
  --cargo-text:#383838;     /* body text, matches #container-main               */
  --cargo-dim:#686868;      /* secondary text, matches div.section.divider h2   */
  --cargo-ok:green;         /* matches dispatch.php's "DISPATCH ACTIVE" convention */
  --cargo-warn:#E80000;     /* matches .rules / .notam alert convention         */
}

.cargo-console{
  background:#fff;color:var(--cargo-text);
  font:11pt "Open Sans",Verdana,Arial,sans-serif;
  padding:0;
}
.cargo-console a{color:var(--cargo-red)}

.cargo-hint{color:var(--cargo-dim);font-size:10pt}

.cargo-flash{border-radius:.2em;padding:10px 16px;margin-bottom:16px;font-size:10pt;border:1px solid}
.cargo-flash-ok{background:#eef7ee;border-color:var(--cargo-ok);color:#1e5c1e}
.cargo-flash-warn{background:#fdeceb;border-color:var(--cargo-warn);color:#a30000}

/* ---- Buttons -------------------------------------------------------------
 * The site-wide button system, flat / rounded / bold — the look defined in
 * docs/reference_images "sitewide button style, colors and font reference".
 * The base .cargo-btn is the NEUTRAL action (white, e.g. "details"/"omit");
 * semantic variants add colour, composed as class="cargo-btn cargo-btn-approve":
 *   approve  green   primary / positive  (create, save, update)
 *   deny     soft red  reject / soft-negative
 *   danger   maroon    destructive       (ban, delete)
 * css/default.css's legacy .button is kept visually identical, so the two
 * class names render as one button. No gradients, bevels or inset shadows —
 * that grey, beveled treatment was the old look this replaces.
 *
 * inline-flex + centring, NOT inline-block: css/leap-ops.css gives every button
 * a 40px min-height, and an inline-block <a> leaves its text at the top of that
 * taller box while a native <button> centres its own content — so anchor buttons
 * ("details", "edit", "Back to logbook") rendered with the text high and, because
 * inline-blocks align on their BASELINES, the whole anchor sat ~6px below the
 * buttons beside it. Centring fixes the text; vertical-align:middle aligns the
 * boxes to each other by their middles instead of by mismatched baselines. */
.cargo-btn{
  display:inline-flex;align-items:center;justify-content:center;
  vertical-align:middle;
  white-space:nowrap;box-sizing:border-box;text-align:center;
  padding:.5em 1.05em;
  font:700 10pt/1.25 "Open Sans",Verdana,Arial,sans-serif;
  text-decoration:none;cursor:pointer;
  border:1px solid #cbd2d9;border-radius:8px;
  background:#fff;color:#2b2f36;
  transition:background .16s ease,border-color .16s ease,color .16s ease;
}
.cargo-btn:hover{background:#f4f6f8;border-color:#b4bcc6;color:#2b2f36}
.cargo-btn:active{background:#e9edf1}
.cargo-btn:focus-visible{outline:2px solid var(--cargo-red,#f44336);outline-offset:2px}
.cargo-btn:disabled,.cargo-btn[aria-disabled="true"]{opacity:.55;cursor:default}

/* Neutral is already the base; -outline stays an explicit alias so markup that
 * pairs it keeps reading as "plain / secondary" and stays valid. */
.cargo-btn-outline{background:#fff;color:#2b2f36}
.cargo-btn-outline:hover{background:#f4f6f8}

/* Green — primary / positive action ("Create flight", "Update"). */
.cargo-btn-approve{background:#e4f3e5;border-color:#69a96e;color:#1e6b2a}
.cargo-btn-approve:hover{background:#d6ecd9;border-color:#528f57;color:#175a22}

/* Soft red — reject / soft-negative ("deny"). */
.cargo-btn-deny{background:#fbdedb;border-color:#d98d88;color:#8a1f1a}
.cargo-btn-deny:hover{background:#f8cec9;border-color:#cd756e;color:#791813}

/* Maroon — destructive ("ban", "delete"). */
.cargo-btn-danger{background:#8f1512;border-color:#6d0f0c;color:#fff}
.cargo-btn-danger:hover{background:#a11a16;border-color:#6d0f0c;color:#fff}

/* ---- collapsible console sections (approvals) ----
 * The button reuses the .ld-acc toggle contract from scripts/leap-nav.js
 * (aria-controls/aria-expanded + panel.hidden) and the .ld-acc-chev chevron;
 * only the visual treatment is defined here, since the drawer's styling is
 * scoped to .ld-drawer-nav. */
.cargo-sec-h{margin:14px 0 6px 0}
.cargo-acc{
  display:flex;align-items:center;gap:10px;
  background:none;border:0;padding:4px 0;cursor:pointer;
  font:bold 11pt "Open Sans",Verdana,Arial,sans-serif;color:var(--cargo-text);
}
.cargo-acc:hover{color:var(--cargo-red)}
.cargo-acc .ld-acc-chev{border-color:currentColor}

/* Bulk decision bar under each approvals table. */
.cargo-bulkbar{
  display:flex;align-items:center;gap:8px;flex-wrap:wrap;
  margin:8px 0 4px 0;
}

/* ---- flights board / logbook flight replay ---- */
#flights-map,#pirep-map{
  width:100%;height:480px;border:1px solid var(--cargo-line);border-radius:.2em;
  background:#cfe5fb;
}
.flights-toolbar{
  margin:12px 0;display:flex;justify-content:space-between;align-items:center;gap:12px;
  flex-wrap:wrap;font-size:10pt;
}
/* Filter bar (network page and pilot freight board): the From/To search
   inputs and the airline/aircraft selects above the toolbar. */
.flights-filters{
  margin:12px 0 0 0;display:flex;align-items:center;gap:8px;flex-wrap:wrap;font-size:10pt;
}
.flights-filters label{color:var(--cargo-dim)}
.flights-filters select,
.flights-filters input[type="search"]{
  font:inherit;padding:4px 6px;border:1px solid var(--cargo-line);border-radius:.2em;
  background:#fff;color:var(--cargo-text);max-width:16em;
}
.flights-filters input[type="search"]{width:11em}
.flights-filters a{white-space:nowrap}
.flights-toolbar .selected-airport{font-weight:700;font-size:12pt;color:var(--cargo-text)}

table.flights-table{
  width:100%;border-collapse:collapse;font-size:9.5pt;background:#fff;
  border:1px solid var(--cargo-line);
}
table.flights-table th{
  background:var(--cargo-panel);border-bottom:1px solid var(--cargo-line);
  padding:7px 9px;text-align:left;font-size:8.5pt;letter-spacing:.05em;
  text-transform:uppercase;color:var(--cargo-dim);cursor:pointer;white-space:nowrap;
}
table.flights-table td{border-bottom:1px solid #e4e4e4;padding:7px 9px;vertical-align:middle}
table.flights-table td.num,table.flights-table th.num{text-align:right;font-variant-numeric:tabular-nums}
table.flights-table tr:hover td{background:#f7f7f7}
table.flights-table tr.clickable{cursor:pointer}
table.flights-table td.code{font-family:Menlo,Consolas,"Courier New",monospace;font-weight:700}

.dg-badge{
  display:inline-block;background:#fdeceb;border:1px solid var(--cargo-warn);color:#a30000;
  font:700 8pt/1.1 Arial,sans-serif;border-radius:.2em;padding:2px 6px;letter-spacing:.03em;
}
/* Net DG weight beside the badge — how much, not just how many lines. */
.dg-weight{color:#a30000;font-weight:700;white-space:nowrap}
.dg-none{color:var(--cargo-dim)}

/* ---- sortable column headings ----
 * Every th in this table already has cursor:pointer from the rule above (the
 * airport table has always been clickable), so this adds only the affordance
 * and the direction indicator. The arrow is a ::after so it never enters the
 * cell's text content and can't be picked up by a copy-paste of the table. */
table.flights-table th[data-sort]:hover{color:var(--cargo-text);background:#ececec}
table.flights-table th[data-sort]:focus-visible{outline:2px solid var(--cargo-red);outline-offset:-2px}
table.flights-table th[data-sort]::after{
  content:"\2195";opacity:.25;margin-left:.4em;font-size:9pt;
}
table.flights-table th.sorted{color:var(--cargo-text)}
table.flights-table th.sorted::after{content:"\2191";opacity:1}
table.flights-table th.sorted-desc::after{content:"\2193"}
table.flights-table th.no-sort{cursor:default}
table.flights-table th.no-sort::after{content:none}
.sort-hint{margin:0 0 6px 0}

/* Review + reserve sit side by side without the form forcing a line break. */
table.flights-table td.row-actions{white-space:nowrap}
.reserve-form{display:inline;margin:0}
.status-pill{
  display:inline-block;font:700 8pt/1.1 Arial,sans-serif;border-radius:.2em;
  padding:3px 8px;letter-spacing:.05em;text-transform:uppercase;border:1px solid;
}
.status-pill.available{background:#eef7ee;border-color:var(--cargo-ok);color:#1e5c1e}
.status-pill.locked{background:#fff7e6;border-color:#c98a00;color:#8a5f00}
.status-pill.completed{background:#eef2f7;border-color:#4a6b96;color:#2d4a6b}
.status-pill.expired{background:#f2f2f2;border-color:#999;color:#666}
/* PIREP review states (logbook) — same pill shape as the flight states. */
.status-pill.pending{background:#fff7e6;border-color:#c98a00;color:#8a5f00}
.status-pill.approved{background:#eef7ee;border-color:var(--cargo-ok);color:#1e5c1e}
.status-pill.denied{background:#fdeceb;border-color:var(--cargo-warn);color:#a30000}
.status-pill.omitted{background:#f2f2f2;border-color:#999;color:#666}
/* Member states (roster, account, approvals) — probation is the amber
   "new here" look, active the settled green. */
.status-pill.probation{background:#fff7e6;border-color:#c98a00;color:#8a5f00}
.status-pill.active{background:#eef7ee;border-color:var(--cargo-ok);color:#1e5c1e}
.status-pill.banned{background:#8c1410;border-color:#5c0c09;color:#fff}

/* ---- the printed manifest document ----
 * Monospace ruled-document treatment, the established convention for this
 * content (operations/generated_manifests/*.html uses the same Courier
 * look). Wide document scrolls inside its own box on narrow screens. */
.manifest-doc{
  display:block;background:#fff;color:#000;border:1px solid var(--cargo-line);
  border-radius:.2em;padding:20px 22px;margin:0;
  font:12px/1.38 "Courier New",Courier,monospace;
  white-space:pre;overflow-x:auto;
}
@media print{
  .no-print{display:none !important}
  .manifest-doc{border:none;padding:0;overflow:visible}
}
