/* ==========================================================================
   BADGE — hand-written stylesheet. © 2026 8823 Technologies LLC.
   Design language: "inspection binder" — paper background, navy ink,
   badge-gold accents, signal red reserved for overdue items.
   No frameworks, no copied component libraries.
   ========================================================================== */

:root {
  --navy: #12233c;
  --navy-deep: #0b1626;
  --ink: #1d2a3a;
  --paper: #f6f4ee;
  --card: #fffdf8;
  --line: #d8d2c4;
  --gold: #c9a227;
  --gold-dark: #a48317;
  --red: #b3372f;
  --red-soft: #f7e5e3;
  --green: #2e7d4f;
  --green-soft: #e3efe8;
  --amber-soft: #f8efd4;
  --muted: #6b7686;
  --radius: 8px;
  --shadow: 0 1px 3px rgba(18, 35, 60, 0.12);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  font-size: 15.5px;
  line-height: 1.5;
}

a { color: var(--navy); }
a:hover { color: var(--gold-dark); }

h1 { font-size: 1.6rem; margin: 0 0 .35rem; letter-spacing: -0.01em; }
h2 { font-size: 1.12rem; margin: 1.6rem 0 .6rem; text-transform: uppercase;
     letter-spacing: 0.06em; color: var(--navy); }
h3 { font-size: 1rem; margin: 0 0 .4rem; }

.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.small { font-size: .78rem; }
.nowrap { white-space: nowrap; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.center { text-align: center; }
.prewrap { white-space: pre-wrap; }
.hint { color: var(--muted); font-size: .82rem; font-weight: 400; }
.sub { color: var(--muted); margin: 0 0 .6rem; }
.text-red { color: var(--red); font-weight: 600; }

/* --- Top bar -------------------------------------------------------------- */

.topbar {
  background: var(--navy);
  color: #fff;
  border-bottom: 3px solid var(--gold);
}
.topbar-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: .55rem 1.2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: .55rem; text-decoration: none; color: #fff; }
.brand-star { width: 30px; height: 30px; flex: none; }
.star-ring { fill: none; stroke: var(--gold); stroke-width: 1.1; }
.star-shape { fill: var(--gold); }
.brand-name { font-weight: 800; letter-spacing: .18em; font-size: 1.05rem; }
.brand-tag { color: #b9c4d4; font-size: .68rem; letter-spacing: .04em; }
.topnav { display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; }
.topnav a { color: #dfe6ef; text-decoration: none; font-size: .9rem; }
.topnav a:hover { color: var(--gold); }
.nav-org {
  color: var(--gold);
  font-size: .82rem;
  font-weight: 700;
  letter-spacing: .03em;
  border-left: 1px solid #33465f;
  padding-left: .8rem;
}
.nav-user { color: #b9c4d4; font-size: .85rem; border-left: 1px solid #33465f; padding-left: .8rem; }

/* --- Layout --------------------------------------------------------------- */

.page { max-width: 1180px; margin: 1.4rem auto 3rem; padding: 0 1.2rem; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between;
             gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.page-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.two-col { display: grid; grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr);
           gap: 1.6rem; align-items: start; }
@media (max-width: 900px) { .two-col { grid-template-columns: 1fr; } }
.section-head { display: flex; align-items: center; justify-content: space-between;
                gap: .6rem; flex-wrap: wrap; }

/* --- Cards ---------------------------------------------------------------- */

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1rem 1.2rem;
  margin: .6rem 0 1rem;
}
.card.narrow { max-width: 560px; margin: 2rem auto; }
.card-accent { border-left: 4px solid var(--gold); }
.card-danger { border-left: 4px solid var(--red); }

/* --- Buttons & chips ------------------------------------------------------ */

.btn {
  display: inline-block;
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: .5rem 1rem;
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  background: var(--navy);
  color: #fff;
}
.btn:hover { background: var(--navy-deep); color: #fff; }
.btn-gold { background: var(--gold); color: var(--navy-deep); }
.btn-gold:hover { background: var(--gold-dark); color: #fff; }
.btn-ghost { background: transparent; color: var(--navy); border-color: var(--line); }
.btn-ghost:hover { background: #eee9dd; color: var(--navy); }
.btn-danger { background: transparent; color: var(--red); border-color: var(--red); }
.btn-danger:hover { background: var(--red); color: #fff; }
.btn-sm { padding: .28rem .65rem; font-size: .8rem; }

.chip, .role-chip, .status-chip {
  display: inline-block;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: .1rem .6rem;
  font-size: .74rem;
  font-weight: 600;
  letter-spacing: .02em;
  background: #fff;
  color: var(--ink);
  text-decoration: none;
}
.chip-on { background: var(--navy); color: #fff; border-color: var(--navy); }
.role-chip { text-transform: uppercase; font-size: .66rem; color: var(--muted); }

.status-planned, .status-preparing { background: #eef1f5; }
.status-submitted { background: var(--amber-soft); border-color: var(--gold); }
.status-awarded, .status-active { background: var(--green-soft); border-color: var(--green); color: var(--green); }
.status-closeout { background: var(--amber-soft); border-color: var(--gold-dark); color: var(--gold-dark); }
.status-closed { background: #e8e8e8; color: var(--muted); }
.status-declined, .status-withdrawn { background: #f1f1f1; color: var(--muted); text-decoration: line-through; }
.req-done { background: var(--green-soft); border-color: var(--green); color: var(--green); }
.req-open { background: var(--amber-soft); border-color: var(--gold-dark); color: var(--gold-dark); }
.req-waived { background: #eee; color: var(--muted); }

/* --- Stat strip ------------------------------------------------------------ */

.stat-strip { display: flex; gap: .8rem; flex-wrap: wrap; margin: .8rem 0 1.2rem; }
.stat {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: .55rem .9rem;
  font-size: .85rem;
  color: var(--muted);
  display: flex; align-items: center; gap: .45rem;
}
.stat-num { font-size: 1.05rem; font-weight: 800; color: var(--ink); }
.stat-red { border-color: var(--red); background: var(--red-soft); }
.stat-red .stat-num { color: var(--red); }
.stat-gold { border-color: var(--gold); background: var(--amber-soft); }

/* --- Tables ----------------------------------------------------------------- */

.table {
  width: 100%;
  border-collapse: collapse;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  margin: .6rem 0 1.4rem;
  font-size: .9rem;
}
.table th, .table td { padding: .55rem .75rem; text-align: left; vertical-align: top;
                       border-bottom: 1px solid var(--line); }
.table thead th {
  background: var(--navy);
  color: #fff;
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .07em;
  border-bottom: 2px solid var(--gold);
}
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: #f4f0e6; }
.table-kv th { width: 220px; color: var(--muted); font-weight: 600; background: none; }
.total-row td { font-weight: 800; border-top: 2px solid var(--navy); }

.row-overdue td { background: var(--red-soft); }
.row-soon td { background: var(--amber-soft); }
.due-dot { display: inline-block; width: .6rem; height: .6rem; border-radius: 50%;
           margin-right: .45rem; background: var(--line); }
.dot-overdue { background: var(--red); }
.dot-soon { background: var(--gold); }
.dot-upcoming { background: var(--navy); }
.dot-later, .dot-done { background: #c6cdd8; }

/* --- Forms ------------------------------------------------------------------- */

form label { display: block; margin: .7rem 0; font-weight: 600; font-size: .88rem; }
input[type="text"], input[type="email"], input[type="password"],
input[type="date"], input[type="file"], select, textarea {
  display: block;
  width: 100%;
  margin-top: .25rem;
  padding: .5rem .65rem;
  font-size: .95rem;
  font-family: inherit;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--gold);
  outline-offset: 0;
  border-color: var(--gold);
}
fieldset { border: 1px solid var(--line); border-radius: var(--radius);
           margin: 1rem 0; padding: .4rem 1rem .9rem; }
legend { font-size: .8rem; font-weight: 700; color: var(--muted);
         text-transform: uppercase; letter-spacing: .05em; padding: 0 .4rem; }
.field-row { display: flex; gap: .9rem; flex-wrap: wrap; }
.field-row > label { flex: 1 1 160px; }
.form-error {
  background: var(--red-soft);
  border: 1px solid var(--red);
  border-radius: var(--radius);
  color: var(--red);
  padding: .5rem .8rem;
  font-size: .88rem;
}
.inline-form { display: inline-flex; align-items: center; gap: .4rem; margin: 0; }
.inline-form label { margin: 0; }
.inline-label { font-weight: 500; font-size: .8rem; }
.check-label { display: inline-flex; align-items: center; gap: .3rem; }
.check-label input { width: auto; display: inline; margin: 0; }
.select-sm, .input-sm {
  width: auto; display: inline-block; padding: .25rem .45rem; font-size: .8rem; margin: 0;
}
.input-sm { max-width: 160px; }
.form-detached { margin-top: 1rem; }
.actions-cell form { margin-bottom: .25rem; }
.muted-links { color: var(--muted); font-size: .85rem; margin-top: 1rem; }

/* --- Flash ------------------------------------------------------------------- */

.flash {
  max-width: 1180px;
  margin: .9rem auto 0;
  padding: .6rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  background: var(--navy);
  color: #fff;
  border-left: 4px solid var(--gold);
  border-radius: var(--radius);
  font-size: .9rem;
}
.flash-close { background: none; border: none; color: #fff; font-size: 1.1rem;
               cursor: pointer; line-height: 1; }

/* --- Landing ------------------------------------------------------------------ */

.hero { text-align: center; padding: 3.2rem 1rem 2rem; }
.hero-star { width: 84px; height: 84px; }
.hero h1 { font-size: 2.3rem; margin: .8rem 0 .6rem; }
.hero-sub { max-width: 620px; margin: 0 auto 1.6rem; color: var(--muted); font-size: 1.05rem; }
.hero-actions { display: flex; gap: .8rem; justify-content: center; flex-wrap: wrap; }
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
  margin: 2.4rem 0;
}
.feature {
  background: var(--card);
  border: 1px solid var(--line);
  border-top: 3px solid var(--gold);
  border-radius: var(--radius);
  padding: 1rem 1.2rem;
  box-shadow: var(--shadow);
}
.feature p { color: var(--muted); font-size: .9rem; margin: 0; }

/* --- Org cards ------------------------------------------------------------------ */

.org-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
            gap: 1rem; margin: 1rem 0 1.6rem; }
.org-card {
  display: block;
  background: var(--card);
  border: 1px solid var(--line);
  border-left: 4px solid var(--navy);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: .9rem 1.1rem;
  text-decoration: none;
  color: var(--ink);
}
.org-card:hover { border-left-color: var(--gold); color: var(--ink); }
.org-card-head { display: flex; justify-content: space-between; align-items: center; gap: .5rem; }
.org-card-stats { display: flex; gap: .8rem; flex-wrap: wrap; color: var(--muted);
                  font-size: .8rem; margin: .45rem 0; }
.org-card-amount { font-weight: 700; font-variant-numeric: tabular-nums; }

/* --- Lists ---------------------------------------------------------------------- */

.activity { list-style: none; margin: 0; padding: 0; font-size: .82rem; }
.activity li { padding: .45rem 0; border-bottom: 1px dashed var(--line); }
.activity-when { color: var(--muted); display: block; font-size: .72rem; }
.activity-who { font-weight: 700; margin-right: .35rem; }
.doc-list { list-style: none; margin: .4rem 0 1.2rem; padding: 0; }
.doc-list li { padding: .5rem 0; border-bottom: 1px dashed var(--line); }
.doc-list .hint { display: block; }
.plain-list { margin: .2rem 0; padding-left: 1.1rem; font-size: .85rem; }
.filter-row { display: flex; gap: .4rem; flex-wrap: wrap; margin: .6rem 0 1rem; }
.error-code { font-size: 3rem; color: var(--gold-dark); }

/* --- Footer ----------------------------------------------------------------------- */

.footer { background: var(--navy); color: #b9c4d4; margin-top: 3rem;
          border-top: 3px solid var(--gold); }
.footer-inner {
  max-width: 1180px; margin: 0 auto; padding: 1rem 1.2rem;
  display: flex; flex-direction: column; gap: .25rem; font-size: .78rem;
}
.footer-honor { color: var(--gold); font-weight: 700; letter-spacing: .05em; }
.footer-note { color: #8fa0b5; }

/* --- Inspection packet & print --------------------------------------------------- */

.packet { background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
          padding: 1.6rem 2rem; box-shadow: var(--shadow); }
.packet-head { display: flex; justify-content: space-between; align-items: flex-start;
               border-bottom: 3px double var(--navy); padding-bottom: .8rem; }
.packet-head .brand-star { width: 46px; height: 46px; }
.packet-sub { color: var(--muted); }
.packet-section { margin-top: 1.6rem; }
.packet-controls { display: flex; justify-content: space-between; margin-bottom: 1rem; }
.packet-foot { margin-top: 2rem; padding-top: .8rem; border-top: 1px solid var(--line);
               color: var(--muted); font-size: .75rem; }

/* --- Polish pass: refined interactions & landing seal ------------------- */

.hero-seal { width: 168px; height: 168px; }
.seal-text-main {
  font-family: inherit; font-weight: 800; font-size: 22px;
  letter-spacing: 5px; fill: #f6f4ee;
}
.seal-text-sub {
  font-family: inherit; font-weight: 700; font-size: 10px;
  letter-spacing: 1.8px; fill: var(--gold);
}
.btn, .chip, input, select, textarea, .org-card {
  transition: background-color 120ms ease, border-color 120ms ease,
              color 120ms ease, box-shadow 120ms ease;
}
.btn:active { transform: translateY(1px); }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 1px; }
.table tbody tr:nth-child(even) td { background-color: rgba(18, 35, 60, 0.025); }
.table .row-overdue:nth-child(even) td { background-color: var(--red-soft); }
.table .row-soon:nth-child(even) td { background-color: var(--amber-soft); }
.hero h1 { letter-spacing: -0.02em; }
.brand-name { text-shadow: 0 1px 0 rgba(0, 0, 0, 0.35); }
@media (max-width: 640px) {
  .brand-tag { display: none; }
  .page-head h1 { font-size: 1.3rem; }
  .stat { flex: 1 1 40%; }
}

@media print {
  .topbar, .footer, .no-print, .flash { display: none !important; }
  .page { margin: 0; max-width: none; padding: 0; }
  .packet { border: none; box-shadow: none; padding: 0; }
  body { background: #fff; font-size: 12px; }
  .table { box-shadow: none; }
  .table thead th { background: #fff; color: var(--navy); border-bottom: 2px solid var(--navy); }
  .table tbody tr:hover { background: none; }
}
