/* MARKINT -- LCARS shell.
 *
 * Okudagram palette on black, framed double-elbow layout. Two deliberate
 * departures from screen-accurate LCARS, both required by the brief:
 *   - operator names render mixed-case (all-caps costs scanning speed
 *     across 1,024 rows -- the operator name is the most-read field here)
 *   - every numeral on screen is a real value; LCARS's decorative random
 *     digits would actively mislead next to real dollar figures
 * Uppercase is kept for labels, headers and short tags, which is where
 * LCARS's typographic character actually lives.
 */

@font-face {
  font-family: "Antonio";
  src: url("/static/antonio.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --apricot: #ff9c00;
  --tan: #ffcc99;
  --mauve: #cc99cc;
  --lilac: #9999ff;
  --salmon: #cc6666;
  --blue: #6688cc;
  --gold: #ffcc66;
  --ink: #ffe4c4;
  --black: #000;

  --font-display: "Antonio", "Oswald", "Liberation Sans Narrow", "Arial Narrow", sans-serif;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--black);
  color: var(--ink);
  font-family: var(--font-display);
}

a {
  color: var(--gold);
}

/* ---- frame: 112px rail + content, 62px header / 1fr body / 34px footer,
   5px gaps -- the black grid gutters ARE the seams between LCARS panels. */
.frame {
  display: grid;
  grid-template-columns: 112px 1fr;
  grid-template-rows: 62px 1fr 34px;
  grid-template-areas:
    "elbow hdr"
    "rail  body"
    "foot-l foot";
  gap: 5px;
  height: 100vh;
  min-height: 640px;
  padding: 5px;
}

/* ---- the elbow: an outer convex sweep at the frame's outer corner, and a
   small concave bite at the INNER corner where the header bar and rail
   would otherwise meet in a hard right angle. The bite is a black square
   with its own radius, parked over the inner corner -- the classic LCARS
   trick for making a rectangle read as an interlocking joint piece rather
   than a plain rounded rect. */
.elbow {
  grid-area: elbow;
  position: relative;
  background: var(--apricot);
  border-top-left-radius: 46px;
  overflow: hidden;
}

.elbow::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  width: 28px;
  height: 28px;
  background: var(--black);
  border-top-left-radius: 28px;
}

.elbow-tag {
  position: absolute;
  left: 14px;
  bottom: 6px;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--black);
  text-transform: uppercase;
}

.hdr {
  grid-area: hdr;
  background: var(--tan);
  color: var(--black);
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  padding: 0 1.5rem;
}

.hdr-title {
  font-size: 1.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.hdr-sub {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  opacity: 0.75;
}

.rail {
  grid-area: rail;
  background: var(--black);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 5px;
  padding: 8px 0;
}

.rail-btn {
  display: block;
  border: none;
  border-radius: 999px;
  padding: 0.5rem 0.6rem 0.5rem 1.1rem;
  margin-right: 8px;
  text-align: right;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--black);
  background: var(--mauve);
  cursor: default;
  text-decoration: none;
}

a.rail-btn {
  cursor: pointer;
}

.rail-btn--active {
  background: var(--blue);
  color: var(--black);
}

.rail-btn--salmon,
button.rail-btn--salmon {
  background: var(--salmon);
  cursor: pointer;
  width: 100%;
}

.rail-logout-form {
  margin-top: auto;
}

.foot-l {
  grid-area: foot-l;
  position: relative;
  background: var(--apricot);
  border-bottom-left-radius: 30px;
  overflow: hidden;
}

.foot-l::after {
  content: "";
  position: absolute;
  right: 0;
  top: 0;
  width: 20px;
  height: 20px;
  background: var(--black);
  border-bottom-left-radius: 20px;
}

.foot {
  grid-area: foot;
  background: var(--tan);
  color: var(--black);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  font-weight: 700;
}

.foot-stat + .foot-stat {
  margin-left: 1.5rem;
}

.pager {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.pager a {
  color: var(--black);
  text-decoration: underline;
}

.body {
  grid-area: body;
  background: var(--black);
  overflow-y: auto;
  padding: 1rem 1.5rem;
}

/* ---- filters bar ---- */
.filters {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--mauve);
  margin-bottom: 0.75rem;
}

.f-field {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.f-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--lilac);
}

.f-field input,
.f-field select {
  background: #111;
  color: var(--ink);
  border: 1px solid var(--blue);
  border-radius: 4px;
  padding: 0.3rem 0.4rem;
  font-family: inherit;
}

.f-check {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--tan);
}

.f-submit {
  background: var(--gold);
  color: var(--black);
  border: none;
  border-radius: 999px;
  padding: 0.4rem 1.2rem;
  font-family: var(--font-display);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  cursor: pointer;
}

.f-clear {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--salmon);
  align-self: center;
}

.active-filters {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  margin-bottom: 0.75rem;
}

.active-filters a {
  color: var(--tan);
  text-decoration: none;
  word-break: break-all;
}

/* ---- operators table ---- */
.table-wrap {
  overflow-x: auto;
}

.ops-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.ops-table th {
  text-align: left;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.7rem;
  color: var(--black);
  background: var(--blue);
  padding: 0.4rem 0.6rem;
  position: sticky;
  top: 0;
}

.ops-table th.num,
.ops-table td.num {
  text-align: right;
}

.ops-table td {
  padding: 0.35rem 0.6rem;
  border-bottom: 1px solid #1a1a1a;
  color: var(--ink);
}

.ops-table tbody tr:nth-child(odd) {
  background: #0a0a0a;
}

.ops-table .op-name {
  /* Mixed-case, on purpose -- see the file header comment. */
  font-weight: 700;
}

.ops-table .op-name a {
  color: var(--ink);
  text-decoration: none;
}

.ops-table .op-name a:hover {
  text-decoration: underline;
}

.ops-table td.tag {
  text-transform: uppercase;
  font-size: 0.75rem;
  color: var(--gold);
}

.ops-table td.empty {
  text-align: center;
  color: var(--mauve);
  padding: 1.5rem;
  text-transform: uppercase;
}

/* ---- login screen: a single framed panel, same palette and font as the
   shell, without the full elbow grid -- there is nothing here to navigate
   yet. */
.login-body {
  margin: 0;
  height: 100%;
  background: var(--black);
  color: var(--ink);
  font-family: var(--font-display);
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-panel {
  width: min(360px, 90vw);
}

.login-bar {
  height: 18px;
  background: var(--apricot);
}

.login-bar--top {
  border-top-left-radius: 30px;
  border-top-right-radius: 30px;
}

.login-bar--bottom {
  border-bottom-left-radius: 30px;
  border-bottom-right-radius: 30px;
}

.login-content {
  background: #0a0a0a;
  border-left: 5px solid var(--apricot);
  border-right: 5px solid var(--apricot);
  padding: 1.5rem 1.75rem;
}

.login-wordmark {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--tan);
  text-transform: uppercase;
}

.login-sub {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--lilac);
  margin-bottom: 1.25rem;
}

.login-error {
  color: var(--salmon);
  text-transform: uppercase;
  font-size: 0.8rem;
  letter-spacing: 0.03em;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.login-form input {
  background: #111;
  color: var(--ink);
  border: 1px solid var(--blue);
  border-radius: 4px;
  padding: 0.5rem 0.6rem;
  font-family: inherit;
  font-size: 1rem;
}

.login-form .f-submit {
  margin-top: 0.5rem;
  align-self: flex-start;
}

/* ---- operator detail / signals / contacts: one bordered panel per
   section (identity, contacts, signals) or per operator (signals, contacts
   list screens), matching the framed-rectangle language of the rest of the
   shell rather than the plain table used for the roster. */
.panel {
  border: 2px solid var(--blue);
  border-radius: 10px;
  padding: 0.9rem 1.25rem;
  margin-bottom: 1rem;
}

.panel-title {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  font-size: 1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--gold);
  margin: 0 0 0.75rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid #222;
}

.panel-title a {
  text-decoration: none;
}

.panel-title a:hover {
  text-decoration: underline;
}

.kv-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.7rem 1.75rem;
  margin: 0;
}

.kv-item dt {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--lilac);
  margin-bottom: 0.1rem;
}

.kv-item dd {
  margin: 0;
  font-size: 0.95rem;
  color: var(--ink);
}

.stale-flag {
  display: inline-block;
  margin-left: 0.5rem;
  padding: 0.05rem 0.5rem;
  border-radius: 999px;
  background: var(--salmon);
  color: var(--black);
  text-transform: uppercase;
  font-size: 0.65rem;
  font-weight: 700;
}

.fresh-flag {
  display: inline-block;
  margin-left: 0.5rem;
  padding: 0.05rem 0.5rem;
  border-radius: 999px;
  background: var(--gold);
  color: var(--black);
  text-transform: uppercase;
  font-size: 0.65rem;
  font-weight: 700;
}

.contact-list,
.signal-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.contact-row,
.signal-row {
  padding-bottom: 0.55rem;
  border-bottom: 1px solid #1a1a1a;
}

.contact-row:last-child,
.signal-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.c-name,
.s-headline {
  font-weight: 700;
  color: var(--ink);
}

.c-meta,
.s-meta {
  font-size: 0.8rem;
  color: var(--tan);
}

.source-link {
  font-size: 0.72rem;
  color: var(--blue);
  word-break: break-all;
}

/* Signal provenance tags: [state file] tan (a state's own filing), or
   [aggregate] mauve (the consolidated third-party archive) -- same
   distinction and same two words the CLI's `signals` command prints. */
.provenance-tag {
  display: inline-block;
  padding: 0.05rem 0.5rem;
  border-radius: 999px;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--black);
}

.provenance-tag--state {
  background: var(--tan);
}

.provenance-tag--aggregate {
  background: var(--mauve);
}

.empty-note {
  color: var(--mauve);
  text-transform: uppercase;
  font-size: 0.8rem;
  padding: 0.75rem 0;
}

.site-link {
  margin-left: 0.4rem;
  text-decoration: none;
  color: var(--blue);
}
