/* TRUKIT theme.
   Loaded AFTER app.css and overrides it. app.css is untouched so the clerk
   screens keep their sizing, targets and contrast exactly as tested — this
   file changes colour and adds the presentation components, nothing else.

   Palette is the authority's: deep marine navy, harbour blue, a brass accent
   for the one thing on screen that wants a hand on it. Amber survives only
   where it means "look at this", never as decoration. */

:root {
  /* Authority blues */
  --navy-950: #041124;
  --navy-900: #07203f;
  --navy-800: #0b2f5c;
  --navy-700: #10437f;
  --navy-600: #1560a8;
  --blue-500: #1e7ac4;
  --blue-400: #4a9bd8;
  --blue-100: #dceaf7;
  --blue-50:  #f2f7fc;

  /* Brass accent */
  --brass:     #b8860b;
  --brass-dim: #fdf3d7;

  /* app.css slate ramp, re-pointed at the navy family so every existing
     component inherits the theme without being rewritten. */
  --slate-900: #071c33;
  --slate-800: #0b2f5c;
  --slate-700: #23496f;
  --slate-500: #5d7794;
  --slate-300: #c6d5e4;
  --slate-100: #eef3f9;
  --slate-50:  #f7fafd;

  --amber:     var(--brass);
  --amber-dim: var(--brass-dim);
  --blue:      var(--navy-600);
  --blue-dim:  var(--blue-100);
  --green:     #0f7a4d;
  --green-dim: #d8f3e6;
  --red:       #b02020;
  --red-dim:   #fbe4e4;

  --radius: 8px;
  --shadow-1: 0 1px 2px rgba(7, 32, 63, .07), 0 1px 3px rgba(7, 32, 63, .05);
  --shadow-2: 0 10px 28px rgba(7, 32, 63, .12);
}

body { background: var(--blue-50); }

/* --- chrome --------------------------------------------------------------
   The header is the first thing in the room when this is on a projector. */

.topbar {
  background: linear-gradient(100deg, var(--navy-950) 0%, var(--navy-800) 58%, var(--navy-700) 100%);
  border-bottom: 3px solid var(--brass);
  padding: 12px 24px;
  box-shadow: var(--shadow-1);
}
.brand a { letter-spacing: .10em; font-size: 19px; text-transform: uppercase; }
.brand .dept { letter-spacing: .04em; color: var(--blue-400); }
.mainnav a {
  color: #cfe0f0; padding: 5px 2px; border-bottom: 2px solid transparent;
}
.mainnav a:hover { color: #fff; border-bottom-color: var(--brass); }
.mainnav a.on { color: #fff; border-bottom-color: var(--brass); font-weight: 600; }
.who .role { color: var(--blue-400); }

.foot { color: var(--slate-500); border-top: 1px solid var(--slate-300);
        margin-top: 40px; }

.card { box-shadow: var(--shadow-1); border-color: var(--slate-300); }

h2 { color: var(--navy-700); font-weight: 700; }

/* --- executive header band ---------------------------------------------- */

.exec-head {
  background: linear-gradient(100deg, var(--navy-900), var(--navy-700));
  color: #fff; border-radius: var(--radius); padding: 22px 26px;
  margin-bottom: 20px; box-shadow: var(--shadow-2);
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 18px; flex-wrap: wrap;
}
.exec-head h1 { color: #fff; font-size: 25px; letter-spacing: .01em; }
.exec-head .sub { color: #b9d3ea; margin: 4px 0 0; }
.exec-head .asof { font-size: 12px; color: #9dc0de; text-transform: uppercase;
                   letter-spacing: .08em; }

.rangebar { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.rangebar a {
  padding: 6px 13px; border-radius: 999px; font-size: 12px; font-weight: 600;
  color: #cfe0f0; border: 1px solid rgba(255,255,255,.28);
  text-transform: uppercase; letter-spacing: .05em;
}
.rangebar a:hover { background: rgba(255,255,255,.12); text-decoration: none; color: #fff; }
.rangebar a.on { background: var(--brass); border-color: var(--brass);
                 color: var(--navy-950); }

/* --- KPI tiles ----------------------------------------------------------- */

.tile {
  border-top: 3px solid var(--navy-600); box-shadow: var(--shadow-1);
  position: relative; overflow: hidden;
}
.tile .value { color: var(--navy-900); font-size: 34px; letter-spacing: -.02em; }
.tile .label { color: var(--slate-500); }
.tile .foot { font-size: 12px; color: var(--slate-500); margin-top: 6px;
              border: 0; padding: 0; text-align: left; }
.tile.alert { border-top-color: var(--red); }
.tile.good  { border-top-color: var(--green); }
.tile.warn  { border-top-color: var(--brass); }

.delta { font-size: 12px; font-weight: 700; }
.delta.up { color: var(--green); }
.delta.down { color: var(--red); }

/* --- flow board ---------------------------------------------------------- */

.flow {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px;
  margin-bottom: 20px;
}
@media (max-width: 900px) { .flow { grid-template-columns: repeat(2, 1fr); } }

.flow .stage {
  background: #fff; border: 1px solid var(--slate-300); border-radius: var(--radius);
  padding: 16px 14px; position: relative; box-shadow: var(--shadow-1);
}
.flow .stage::after {
  content: ""; position: absolute; right: -11px; top: 50%; z-index: 2;
  width: 0; height: 0; margin-top: -7px;
  border-left: 11px solid var(--slate-300);
  border-top: 7px solid transparent; border-bottom: 7px solid transparent;
}
.flow .stage:last-child::after { display: none; }
@media (max-width: 900px) { .flow .stage::after { display: none; } }

.flow .stage .n { font-size: 30px; font-weight: 700; color: var(--navy-800);
                  line-height: 1.1; }
.flow .stage .nm { font-size: 11px; text-transform: uppercase; font-weight: 600;
                   letter-spacing: .06em; color: var(--slate-500); margin-top: 3px; }
.flow .stage .t { font-size: 12px; color: var(--slate-500); margin-top: 6px; }
.flow .stage.terminal { background: var(--navy-800); border-color: var(--navy-800); }
.flow .stage.terminal .n { color: #fff; }
.flow .stage.terminal .nm, .flow .stage.terminal .t { color: #9dc0de; }
.flow .stage.hot { border-color: var(--brass); border-top: 3px solid var(--brass); }

/* --- funnel -------------------------------------------------------------- */

.funnel { list-style: none; padding: 0; margin: 0; }
.funnel li { margin-bottom: 10px; }
.funnel .row { display: flex; justify-content: space-between; font-size: 13px;
               margin-bottom: 4px; }
.funnel .row .lbl { font-weight: 600; color: var(--navy-800); }
.funnel .row .val { font-variant-numeric: tabular-nums; color: var(--slate-500); }
.funnel .track { height: 22px; background: var(--slate-100); border-radius: 4px;
                 overflow: hidden; }
.funnel .track span {
  display: block; height: 100%;
  background: linear-gradient(90deg, var(--navy-700), var(--blue-500));
}
.funnel .drop { color: var(--red); font-weight: 600; }

/* --- bar chart (pure CSS, no JS, works on a projector offline) ----------- */

.chart { display: flex; align-items: flex-end; gap: 4px; height: 160px;
         padding: 10px 0 0; }
.chart .col { flex: 1; display: flex; flex-direction: column; justify-content: flex-end;
              align-items: center; height: 100%; gap: 2px; }
.chart .col .stack { display: flex; align-items: flex-end; gap: 2px; width: 100%;
                     height: 100%; justify-content: center; }
.chart .bar { width: 45%; border-radius: 3px 3px 0 0; min-height: 2px;
              background: var(--navy-700); }
.chart .bar.b2 { background: var(--blue-400); }
.chart .tick { font-size: 10px; color: var(--slate-500); white-space: nowrap;
               transform: rotate(-45deg); transform-origin: top left;
               height: 26px; }
.legend { display: flex; gap: 16px; font-size: 12px; color: var(--slate-500);
          margin-top: 22px; }
.legend i { display: inline-block; width: 11px; height: 11px; border-radius: 2px;
            margin-right: 5px; vertical-align: -1px; }
.legend i.a { background: var(--navy-700); }
.legend i.b { background: var(--blue-400); }

/* --- lag table ----------------------------------------------------------- */

.lagtable td.metric { font-variant-numeric: tabular-nums; font-weight: 600; }
.lagtable tr.over td.metric { color: var(--red); }
.meter { height: 6px; background: var(--slate-100); border-radius: 999px;
         overflow: hidden; min-width: 90px; }
.meter span { display: block; height: 100%; background: var(--blue-500); }
.meter span.over { background: var(--red); }

.pill.target { background: var(--blue-100); color: var(--navy-700); }
.pill.breach { background: var(--red-dim); color: var(--red); }
.pill.transfer { background: var(--brass-dim); color: var(--brass); }

/* --- misc ---------------------------------------------------------------- */

.bar span { background: linear-gradient(90deg, var(--navy-700), var(--blue-500)); }
.btn.primary { background: var(--navy-700); }
.btn.primary:hover { background: var(--navy-600); }
.btn.brass { background: var(--brass); color: var(--navy-950); }
.btn.brass:hover { background: #9a7009; color: #fff; }

.kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; font-size: 13px; }
.kv dt { color: var(--slate-500); }
.kv dd { margin: 0; font-weight: 600; color: var(--navy-800); }

.printnote { display: none; }
@media print {
  .topbar, .mainnav, .rangebar, .foot, .btn { display: none !important; }
  .exec-head { background: #fff !important; color: var(--navy-900); border: 1px solid var(--slate-300); }
  .exec-head h1, .exec-head .sub { color: var(--navy-900); }
  .card, .tile, .flow .stage { box-shadow: none; }
  .printnote { display: block; font-size: 11px; color: var(--slate-500); }
}

/* Stowage cell badge in the berth typeahead. The cell is what the clerk has in
   hand before the number is readable, so it gets weight of its own. */
.suggest .cell {
  float: right; font-family: ui-monospace, Menlo, monospace; font-weight: 700;
  color: var(--navy-700); background: var(--blue-100);
  padding: 1px 8px; border-radius: 4px; font-size: 13px;
}
