/* ====================================================================
   HCMC PORTAL — SHARED STYLES
   File: portal-app/public/styles.css
   Created: 2026-06-23
   Brand: navy #0c2340, gold #d4af37, red #b22234, paper #f7f8fa,
          Outfit font, square corners (per HCMC design canon).
==================================================================== */

:root {
  --navy: #0c2340;
  --navy-deep: #07182b;
  --red: #b22234;
  --gold: #d4af37;
  --paper: #f7f8fa;
  --green: #16a34a;
  --amber: #a47e1c;
  --crimson: #7c1414;
  --text: #1a2333;
  --muted: #64748b;
  --border: rgba(12, 35, 64, 0.10);
}

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

html, body {
  font-family: 'Outfit', system-ui, -apple-system, sans-serif;
  background: var(--paper);
  color: var(--text);
  line-height: 1.55;
  min-height: 100vh;
}

a { color: var(--red); text-decoration: none; font-weight: 500; }
a:hover { text-decoration: underline; }

.muted { color: var(--muted); }

/* ── Top bar ── */
.topbar {
  background: linear-gradient(180deg, var(--navy) 0%, var(--navy-deep) 100%);
  color: #fff;
  border-bottom: 4px solid var(--red);
  padding: 16px 28px;
}
.topbar-inner {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
}
.brand-mark {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 1.05rem;
  font-weight: 700;
}
.brand-line {
  display: inline-block;
  width: 4px;
  height: 24px;
  background: var(--gold);
  border-radius: 2px;
}
.brand-name { letter-spacing: 0.02em; }
.brand-back {
  color: var(--gold);
  font-weight: 700;
  font-size: 1.3rem;
  text-decoration: none;
  padding: 2px 6px;
  border-radius: 4px;
}
.brand-back:hover { background: rgba(212, 175, 55, 0.18); text-decoration: none; }

.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}
.who-pill {
  background: rgba(212, 175, 55, 0.18);
  color: var(--gold);
  padding: 5px 12px;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  border: 1px solid rgba(212, 175, 55, 0.3);
  font-family: Consolas, Monaco, monospace;
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: 4px;
  font-size: 0.86rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-decoration: none;
  transition: all 0.15s ease;
  border: 1px solid transparent;
  cursor: pointer;
  font-family: inherit;
}
.btn-primary {
  background: #fff;
  color: var(--navy);
  border: 2px solid var(--navy);
  padding: 12px 22px;
  font-size: 0.92rem;
}
.btn-primary:hover {
  background: var(--navy);
  color: #fff;
  text-decoration: none;
}
.btn-ghost {
  background: transparent;
  color: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.3);
}
.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.10);
  border-color: var(--gold);
  color: var(--gold);
  text-decoration: none;
}

/* ── Page layout ── */
.page-wrap {
  max-width: 1180px;
  margin: 0 auto;
  padding: 36px 26px 60px;
}
.page-h1 {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--navy);
  margin-bottom: 6px;
}
.page-sub {
  color: var(--muted);
  font-size: 1rem;
  margin-bottom: 28px;
}
.page-center {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 30px 20px;
}
.page-footnote {
  margin-top: 28px;
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
}
.page-footer {
  max-width: 1180px;
  margin: 40px auto 0;
  padding: 18px 26px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 0.82rem;
}

/* ── Loader (cookie-gate landing) ── */
.loader {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--paper);
  padding: 20px;
}
.loader-card {
  background: #fff;
  border: 1px solid var(--border);
  border-top: 4px solid var(--gold);
  border-radius: 8px;
  padding: 32px 36px;
  max-width: 440px;
  text-align: center;
  box-shadow: 0 4px 18px rgba(12, 35, 64, 0.08);
}
.loader-card .brand {
  color: var(--gold);
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-weight: 700;
  margin-bottom: 12px;
}
.loader-card h1 {
  color: var(--navy);
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 10px;
}

/* ── Login card ── */
.login-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 36px 40px 32px;
  max-width: 460px;
  width: 100%;
  text-align: center;
  box-shadow: 0 6px 24px rgba(12, 35, 64, 0.10);
  position: relative;
  overflow: hidden;
}
.brand-stripe {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--gold) 0%, var(--red) 100%);
}
.login-brand {
  color: var(--gold);
  font-size: 0.74rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-weight: 700;
  margin-bottom: 18px;
}
.login-card h1 {
  color: var(--navy);
  font-size: 1.6rem;
  font-weight: 800;
  margin-bottom: 12px;
}
.login-card p { color: var(--muted); margin-bottom: 24px; }
.login-card .btn { width: 100%; justify-content: center; }
.fine-print {
  margin-top: 22px;
  color: var(--muted);
  font-size: 0.78rem !important;
  letter-spacing: 0.02em;
}

/* ── Tile grid (dashboard) ── */
.tile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
  margin-top: 18px;
}
.tile {
  background: #fff;
  border: 1px solid var(--border);
  border-top: 4px solid var(--gold);
  border-radius: 6px;
  padding: 24px 22px 22px;
  color: var(--text);
  text-decoration: none;
  display: block;
  transition: all 0.18s ease;
  position: relative;
}
.tile:hover {
  border-top-color: var(--red);
  transform: translateY(-3px);
  box-shadow: 0 8px 22px rgba(12, 35, 64, 0.10);
  text-decoration: none;
}
.tile-icon {
  display: inline-flex;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  background: var(--navy);
  color: var(--gold);
  font-weight: 800;
  font-size: 1.3rem;
  border-radius: 4px;
  margin-bottom: 14px;
  font-family: Consolas, Monaco, monospace;
}
.tile h2 {
  color: var(--navy);
  font-size: 1.18rem;
  font-weight: 700;
  margin-bottom: 6px;
}
.tile p { color: var(--muted); font-size: 0.9rem; }
.tile-future { opacity: 0.7; }
.tag-soon {
  display: inline-block;
  margin-left: 6px;
  background: rgba(164, 126, 28, 0.14);
  color: var(--amber);
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.6rem;
  letter-spacing: 0.14em;
  font-weight: 800;
  vertical-align: middle;
}

/* ── Panels (inventory, status) ── */
.panel {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 22px 26px;
  margin-bottom: 20px;
  box-shadow: 0 1px 3px rgba(12, 35, 64, 0.04);
}
.panel h2 {
  color: var(--navy);
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 12px;
  border-bottom: 2px solid var(--gold);
  padding-bottom: 6px;
}
.panel.panel-info { border-left: 4px solid var(--gold); }
.list-2col {
  list-style: none;
  margin: 4px 0 0;
  padding: 0;
  column-count: 2;
  column-gap: 32px;
}
@media (max-width: 640px) { .list-2col { column-count: 1; } }
.list-2col li {
  padding: 6px 0;
  font-size: 0.92rem;
  border-bottom: 1px dashed rgba(12, 35, 64, 0.08);
  break-inside: avoid;
}
.tag-warn {
  display: inline-block;
  background: rgba(178, 34, 52, 0.10);
  color: var(--red);
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  font-weight: 700;
  margin-left: 6px;
}

/* ── Status grid ── */
.status-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin: 18px 0 24px;
}
.status-card {
  background: #fff;
  border: 1px solid var(--border);
  border-left: 4px solid var(--gold);
  border-radius: 6px;
  padding: 18px 20px;
}
.svc-name {
  color: var(--navy);
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 6px;
}
.svc-status {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--muted);
  margin-bottom: 6px;
}
.svc-status.ok { color: var(--green); }
.svc-status.bad { color: var(--red); }
.svc-meta {
  font-family: Consolas, Monaco, monospace;
  font-size: 0.74rem;
  color: var(--muted);
  word-break: break-all;
}

/* ── Timeline ── */
.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
}
.timeline li {
  padding: 10px 0;
  border-bottom: 1px solid rgba(12, 35, 64, 0.08);
  font-size: 0.92rem;
}
.timeline li:last-child { border-bottom: none; }
.timeline .date {
  display: inline-block;
  font-family: Consolas, Monaco, monospace;
  font-size: 0.8rem;
  color: var(--red);
  font-weight: 700;
  margin-right: 10px;
  min-width: 90px;
}
