/*
 * static/css/app.css
 * nle-portal — Northern Lights Epoxy customer portal
 * (C) 2026 Chena Innovations LLC
 * Intellectual Property of Chena Innovations LLC & Northern Lights Epoxy
 * Created by Billy Jack Wiglesworth on April 20, 2026.
 */

/* ---- reset & base -------------------------------------------------------- */

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

:root {
  --bg:          #0e1117;
  --bg-surface:  #161b22;
  --bg-raised:   #1c2129;
  --border:      #30363d;
  --text:        #e6edf3;
  --text-muted:  #8b949e;
  --accent:      #3fb950;
  --accent-dim:  #238636;
  --danger:      #f85149;
  --warn:        #d29922;
  --info:        #58a6ff;
  --radius:      6px;
  --sidebar-w:   240px;
  --font:        -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --mono:        ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
}

html { font-size: 15px; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  min-height: 100vh;
  display: flex;
}

a      { color: var(--info); text-decoration: none; }
a:hover { text-decoration: underline; }

h1 { font-size: 1.5rem; font-weight: 600; margin-bottom: .5rem; }
h2 { font-size: 1.15rem; font-weight: 600; margin-bottom: .75rem; color: var(--text); }
h3 { font-size: 1rem; font-weight: 600; margin-bottom: .4rem; }

code, pre { font-family: var(--mono); font-size: .85rem; }
em       { font-style: italic; }
.muted   { color: var(--text-muted); }

/* ---- sidebar ------------------------------------------------------------- */

.sidebar {
  position: fixed;
  top: 0; left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  background: var(--bg-surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 1.25rem 0;
  z-index: 100;
}

.brand         { padding: 0 1.25rem 1.25rem; border-bottom: 1px solid var(--border); }
.brand-mark    { font-size: 1.5rem; font-weight: 700; letter-spacing: .12em; color: var(--accent); }
.brand-mark-lg { font-size: 2.2rem; }
.brand-sub     { font-size: .75rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .08em; margin-top: 2px; }

.nav        { flex: 1; padding: 1rem 0; display: flex; flex-direction: column; gap: 2px; }
.nav a,
.nav-disabled {
  display: flex; align-items: center; gap: .6rem;
  padding: .55rem 1.25rem;
  color: var(--text-muted);
  font-size: .9rem;
  transition: background .15s, color .15s;
}
.nav a:hover        { background: var(--bg-raised); color: var(--text); text-decoration: none; }
.nav a.is-active    { background: var(--bg-raised); color: var(--accent); border-left: 3px solid var(--accent); }
.nav-disabled       { opacity: .4; cursor: default; }
.nav-icon           { font-size: 1rem; width: 1.2rem; text-align: center; }

.who         { padding: 1rem 1.25rem 0; border-top: 1px solid var(--border); }
.who-name    { font-weight: 600; font-size: .9rem; }
.who-meta    { font-size: .75rem; color: var(--text-muted); margin-top: 2px; }
.who-email   { word-break: break-all; }

/* ---- main ---------------------------------------------------------------- */

.main {
  margin-left: var(--sidebar-w);
  padding: 2rem 2.5rem;
  flex: 1;
  max-width: 960px;
}

/* ---- blank page (login/register) ----------------------------------------- */

body.page-blank {
  display: flex;
  align-items: center;
  justify-content: center;
}
body.page-blank .sidebar { display: none; }

.login-shell {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  width: 100%;
}

.login-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2.5rem;
  width: 100%;
  max-width: 400px;
}
.login-card header { text-align: center; margin-bottom: 1.5rem; }
.login-card h1     { font-size: 1.1rem; font-weight: 400; color: var(--text-muted); margin-top: .5rem; }

.login-links {
  display: flex;
  justify-content: space-between;
  margin-top: 1rem;
  font-size: .85rem;
}

.login-foot { text-align: center; margin-top: 1.5rem; }
.login-foot code { font-size: .7rem; color: var(--text-muted); }

/* ---- forms --------------------------------------------------------------- */

label {
  display: block;
  margin-bottom: 1rem;
}
label > span {
  display: block;
  font-size: .85rem;
  font-weight: 500;
  margin-bottom: .3rem;
  color: var(--text-muted);
}
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="password"],
textarea,
select {
  display: block;
  width: 100%;
  padding: .55rem .75rem;
  font-size: .9rem;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color .15s;
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(63,185,80,.15);
}

/* ---- buttons ------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: .55rem 1.2rem;
  font-size: .875rem;
  font-weight: 500;
  font-family: var(--font);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-raised);
  color: var(--text);
  cursor: pointer;
  transition: background .15s, border-color .15s;
}
.btn:hover          { background: var(--bg-surface); border-color: var(--text-muted); text-decoration: none; }
.btn-primary        { background: var(--accent-dim); border-color: var(--accent); color: #fff; }
.btn-primary:hover  { background: var(--accent); }
.btn-ghost          { background: transparent; border-color: var(--border); }
.btn-ghost:hover    { background: var(--bg-raised); }
.btn-sm             { padding: .3rem .7rem; font-size: .8rem; }
.btn-block          { display: flex; width: 100%; }

/* ---- flash --------------------------------------------------------------- */

.flash {
  padding: .75rem 1rem;
  border-radius: var(--radius);
  margin-bottom: 1.25rem;
  font-size: .9rem;
  border: 1px solid;
}
.flash-ok  { background: rgba(63,185,80,.1); border-color: var(--accent-dim); color: var(--accent); }
.flash-err { background: rgba(248,81,73,.1); border-color: #da3633; color: var(--danger); }

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

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
}
.card-value { font-size: 2rem; font-weight: 700; color: var(--accent); }
.card-label { font-size: .85rem; color: var(--text-muted); margin-top: .25rem; }
.card-link  { display: inline-block; font-size: .85rem; margin-top: .5rem; }

/* ---- tables -------------------------------------------------------------- */

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: .9rem;
}
.table th {
  text-align: left;
  font-weight: 600;
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--text-muted);
  padding: .6rem .75rem;
  border-bottom: 2px solid var(--border);
}
.table td {
  padding: .6rem .75rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.table tbody tr:hover { background: var(--bg-raised); }

/* ---- status badges ------------------------------------------------------- */

.status {
  display: inline-block;
  padding: .15rem .5rem;
  border-radius: 999px;
  font-size: .75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.status-new      { background: rgba(88,166,255,.15); color: var(--info); }
.status-progress { background: rgba(210,153,34,.15); color: var(--warn); }
.status-sent     { background: rgba(63,185,80,.15); color: var(--accent); }
.status-good     { background: rgba(63,185,80,.2); color: var(--accent); }
.status-bad      { background: rgba(248,81,73,.15); color: var(--danger); }
.status-muted    { background: rgba(139,148,158,.15); color: var(--text-muted); }

/* ---- detail pages -------------------------------------------------------- */

.page-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.page-header h1 { margin-bottom: 0; }

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.detail-section {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
}

.dl      { display: grid; grid-template-columns: auto 1fr; gap: .35rem 1rem; font-size: .9rem; }
.dl dt   { color: var(--text-muted); font-weight: 500; }
.dl dd   { color: var(--text); }

.value-lg { font-size: 1.3rem; font-weight: 700; color: var(--accent); }

.section     { margin-bottom: 2rem; }

.scope-block {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin-bottom: .75rem;
}
.scope-text { font-size: .9rem; line-height: 1.6; white-space: pre-wrap; }

.detail-actions { margin: 2rem 0; display: flex; gap: 1rem; flex-wrap: wrap; align-items: flex-start; }
.detail-meta    { margin-top: 2rem; }

/* ---- sign block ---------------------------------------------------------- */

.sign-block {
  background: var(--bg-surface);
  border: 2px solid var(--accent-dim);
  border-radius: var(--radius);
  padding: 1.5rem;
  max-width: 480px;
  width: 100%;
}
.sign-block h2 { color: var(--accent); }

.signed-notice {
  background: rgba(63,185,80,.08);
  border: 1px solid var(--accent-dim);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
}
.signed-notice p:first-child { font-weight: 600; color: var(--accent); }

/* ---- empty state --------------------------------------------------------- */

.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-muted);
}

/* ---- timeline ------------------------------------------------------------ */

.timeline {
  display: flex;
  gap: 0;
  position: relative;
  padding: 1rem 0;
}
.timeline-step {
  flex: 1;
  text-align: center;
  position: relative;
}
.timeline-step::before {
  content: '';
  position: absolute;
  top: 8px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--border);
  z-index: 0;
}
.timeline-step:first-child::before { left: 50%; }
.timeline-step:last-child::before  { right: 50%; }
.timeline-done::before { background: var(--accent); }

.timeline-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--border);
  border: 3px solid var(--bg);
  margin: 0 auto .5rem;
  position: relative;
  z-index: 1;
}
.timeline-done .timeline-dot { background: var(--accent); }

.timeline-label { font-size: .85rem; font-weight: 600; }
.timeline-date  { font-size: .75rem; color: var(--text-muted); margin-top: .15rem; }

/* ---- error page ---------------------------------------------------------- */

.error-page {
  text-align: center;
  padding: 4rem 1rem;
}
.error-page h1 { font-size: 4rem; color: var(--text-muted); }
.error-page p  { margin: 1rem 0 2rem; color: var(--text-muted); }

/* ---- responsive ---------------------------------------------------------- */

@media (max-width: 768px) {
  .sidebar        { position: relative; width: 100%; height: auto; border-right: none; border-bottom: 1px solid var(--border); }
  body            { flex-direction: column; }
  .main           { margin-left: 0; padding: 1.25rem; }
  .detail-grid    { grid-template-columns: 1fr; }
  .nav            { flex-direction: row; flex-wrap: wrap; padding: .5rem 1rem; gap: 0; }
  .nav a          { padding: .4rem .8rem; font-size: .8rem; }
  .who            { display: none; }
  .brand          { padding: .75rem 1.25rem; border-bottom: none; }
}
