/* ProTerm Route Planner — app styles
   Built from Max's personal brand style guide (Claude Guidelines/PERSONAL_BRAND_STYLE_GUIDE.md).
   Palette: Signal Yellow #FFE600 / True Black #000000 / Off-White #F9F9F9 / Charcoal #313032.
   Yellow is used sparingly per the guide: CTAs, focus rings, active-state accents,
   and small status dots — never as a large fill or as text on a light background. */

/* ============ FONTS ============ */

@font-face { font-family: 'Clash Display'; src: url('../fonts/ClashDisplay-Extralight.otf') format('opentype'); font-weight: 200; font-style: normal; }
@font-face { font-family: 'Clash Display'; src: url('../fonts/ClashDisplay-Light.otf') format('opentype'); font-weight: 300; font-style: normal; }
@font-face { font-family: 'Clash Display'; src: url('../fonts/ClashDisplay-Regular.otf') format('opentype'); font-weight: 400; font-style: normal; }
@font-face { font-family: 'Clash Display'; src: url('../fonts/ClashDisplay-Medium.otf') format('opentype'); font-weight: 500; font-style: normal; }
@font-face { font-family: 'Clash Display'; src: url('../fonts/ClashDisplay-Semibold.otf') format('opentype'); font-weight: 600; font-style: normal; }
@font-face { font-family: 'Clash Display'; src: url('../fonts/ClashDisplay-Bold.otf') format('opentype'); font-weight: 700; font-style: normal; }

@font-face { font-family: 'Satoshi'; src: url('../fonts/Satoshi-Light.otf') format('opentype'); font-weight: 300; font-style: normal; }
@font-face { font-family: 'Satoshi'; src: url('../fonts/Satoshi-LightItalic.otf') format('opentype'); font-weight: 300; font-style: italic; }
@font-face { font-family: 'Satoshi'; src: url('../fonts/Satoshi-Regular.otf') format('opentype'); font-weight: 400; font-style: normal; }
@font-face { font-family: 'Satoshi'; src: url('../fonts/Satoshi-Italic.otf') format('opentype'); font-weight: 400; font-style: italic; }
@font-face { font-family: 'Satoshi'; src: url('../fonts/Satoshi-Medium.otf') format('opentype'); font-weight: 500; font-style: normal; }
@font-face { font-family: 'Satoshi'; src: url('../fonts/Satoshi-MediumItalic.otf') format('opentype'); font-weight: 500; font-style: italic; }
@font-face { font-family: 'Satoshi'; src: url('../fonts/Satoshi-Bold.otf') format('opentype'); font-weight: 700; font-style: normal; }
@font-face { font-family: 'Satoshi'; src: url('../fonts/Satoshi-BoldItalic.otf') format('opentype'); font-weight: 700; font-style: italic; }
@font-face { font-family: 'Satoshi'; src: url('../fonts/Satoshi-Black.otf') format('opentype'); font-weight: 900; font-style: normal; }
@font-face { font-family: 'Satoshi'; src: url('../fonts/Satoshi-BlackItalic.otf') format('opentype'); font-weight: 900; font-style: italic; }

/* ============ THEME VARIABLES ============ */
/* Same token names/values as PERSONAL_BRAND_STYLE_GUIDE.html, so any future
   Max app can share this file or copy it with zero translation needed. */

:root {
  --yellow: #FFE600;
  --black: #000000;
  --offwhite: #F9F9F9;
  --charcoal: #313032;

  --bg: var(--offwhite);
  --page-bg: #F1F1F1;
  --surface: #FFFFFF;
  --text: var(--black);
  --text-secondary: var(--charcoal);
  --border: 1px solid rgba(0,0,0,0.12);
  --code-bg: rgba(0,0,0,0.06);
  --accent: var(--yellow);
  --accent-text: var(--black);

  /* Semantic warning/error color — NOT part of the brand palette.
     The guide has no red; this exists only so a low-confidence parse
     or a failed job is impossible to miss on an operational screen. */
  --warn: #B3261E;
  --warn-bg: rgba(179,38,30,0.08);

  --font-display: 'Clash Display', sans-serif;
  --font-body: 'Satoshi', sans-serif;

  --radius: 10px;
  --space: 8px;
}

:root[data-theme="dark"] {
  --bg: #000000;
  --page-bg: #000000;
  --surface: #313032;
  --text: #F9F9F9;
  --text-secondary: rgba(249,249,249,0.68);
  --border: 1px solid rgba(249,249,249,0.18);
  --code-bg: rgba(249,249,249,0.12);
  --accent: #FFE600;
  --accent-text: #000000;
  --warn: #FF6B61;
  --warn-bg: rgba(255,107,97,0.12);
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--page-bg);
  color: var(--text);
  font-family: var(--font-body);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 700;
  margin: 0 0 4px;
  color: var(--text);
}

h1 { font-size: 24px; }
h2 { font-size: 18px; }
h3 { font-size: 15px; }

p { margin: 0 0 12px; line-height: 1.5; }

a { color: var(--text); }
a:hover { color: var(--accent-text); text-decoration-color: var(--accent); }

.muted { color: var(--text-secondary); font-size: 13px; }

/* ============ APP SHELL ============ */

.app-shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 220px;
  flex-shrink: 0;
  background: var(--black);
  color: var(--offwhite);
  display: flex;
  flex-direction: column;
  padding: 20px 0;
}

.sidebar .brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 17px;
  color: var(--offwhite);
  padding: 0 20px 20px;
  border-bottom: 1px solid rgba(249,249,249,0.14);
  margin-bottom: 12px;
}

.sidebar .brand span { color: var(--yellow); }

.nav-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 11px 20px;
  color: rgba(249,249,249,0.75);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  border-left: 3px solid transparent;
}

.nav-link:hover {
  color: var(--offwhite);
  background: rgba(249,249,249,0.06);
}

.nav-link.active {
  color: var(--offwhite);
  border-left-color: var(--yellow);
  background: rgba(249,249,249,0.08);
}

.nav-badge {
  background: var(--yellow);
  color: var(--black);
  font-size: 11px;
  font-weight: 700;
  border-radius: 999px;
  min-width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
}

.main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 28px;
  background: var(--bg);
  border-bottom: var(--border);
}

.content {
  flex: 1;
  padding: 24px 28px 48px;
  max-width: 980px;
  width: 100%;
}

/* ============ THEME TOGGLE ============ */

.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--surface);
  border: var(--border);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  padding: 7px 12px;
  border-radius: 999px;
  cursor: pointer;
}

.theme-toggle:hover { border-color: var(--accent); }

/* ============ BUTTONS ============ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 14px;
  padding: 11px 18px;
  border-radius: 8px;
  border: 2px solid transparent;
  cursor: pointer;
  text-decoration: none;
  line-height: 1;
}

.btn-primary {
  background: var(--yellow);
  color: var(--black);
}
.btn-primary:hover { filter: brightness(0.95); }

.btn-secondary {
  background: transparent;
  color: var(--text);
  border-color: var(--text);
}
.btn-secondary:hover { background: var(--code-bg); }

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border-color: transparent;
  font-weight: 500;
  padding: 11px 12px;
}
.btn-ghost:hover { color: var(--warn); text-decoration: underline; }

.btn[disabled] { opacity: 0.5; cursor: not-allowed; }

/* ============ CARDS ============ */

.card {
  background: var(--surface);
  border: var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 16px;
}

/* ============ STAT GRID (dashboard) ============ */

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--surface);
  border: var(--border);
  border-radius: var(--radius);
  padding: 18px 18px 16px;
  text-decoration: none;
  color: var(--text);
  display: block;
}

.stat-card:hover { border-color: var(--accent); }

.stat-card .stat-number {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 32px;
  line-height: 1;
  margin-bottom: 6px;
}

.stat-card .stat-label {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 500;
}

.stat-card.stat-attn .stat-number { color: var(--warn); }

.stat-card .stat-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--yellow);
  margin-right: 6px;
}

/* ============ TABLES ============ */

table.list {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

table.list th {
  text-align: left;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-secondary);
  padding: 8px 10px;
  border-bottom: var(--border);
}

table.list td {
  padding: 10px 10px;
  border-bottom: var(--border);
  vertical-align: middle;
}

table.list tr:last-child td { border-bottom: none; }

/* ============ BADGES ============ */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--code-bg);
  color: var(--text-secondary);
  white-space: nowrap;
}

.badge-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

.badge-review { color: var(--text); background: rgba(255,230,0,0.22); }
.badge-review .badge-dot { background: var(--yellow); }

.badge-confirmed { color: var(--text); background: var(--code-bg); }

.badge-routed { color: var(--black); background: var(--yellow); }

.badge-failed { color: var(--warn); background: var(--warn-bg); }

/* ============ BANNERS (flash messages) ============ */

.banner {
  border-radius: var(--radius);
  padding: 13px 16px;
  margin-bottom: 20px;
  font-size: 14px;
  font-weight: 500;
  border-left: 4px solid var(--yellow);
  background: var(--surface);
  border-top: var(--border);
  border-right: var(--border);
  border-bottom: var(--border);
}

.banner-error {
  border-left-color: var(--warn);
  color: var(--warn);
}

/* ============ FORMS ============ */

label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
  margin: 12px 0 5px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

input[type="text"],
input[type="password"],
input[type="file"] {
  width: 100%;
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  border: var(--border);
  border-radius: 7px;
  padding: 10px 12px;
}

input[type="text"]:focus,
input[type="password"]:focus {
  outline: 3px solid var(--yellow);
  outline-offset: 0;
  border-color: var(--yellow);
}

.row { display: flex; gap: 12px; flex-wrap: wrap; }
.row > div { flex: 1; min-width: 110px; }

.actions { margin-top: 14px; display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

.dropzone {
  border: 2px dashed rgba(0,0,0,0.22);
  border-radius: var(--radius);
  padding: 36px 20px;
  text-align: center;
  background: var(--surface);
}

:root[data-theme="dark"] .dropzone { border-color: rgba(249,249,249,0.25); }

/* ============ JOB / STOP CARDS ============ */

.job-card, .stop-card { position: relative; }

.job-card .job-file { font-size: 13px; color: var(--text-secondary); margin-bottom: 6px; }

.stop-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--yellow);
  color: var(--black);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13px;
  margin-right: 8px;
}

.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: var(--text-secondary);
}

/* ============ RESPONSIVE ============ */

@media (max-width: 720px) {
  .app-shell { flex-direction: column; }

  .sidebar {
    width: 100%;
    flex-direction: row;
    align-items: center;
    overflow-x: auto;
    padding: 10px 0;
  }

  .sidebar .brand { display: none; }

  .nav-link {
    border-left: none;
    border-bottom: 3px solid transparent;
    white-space: nowrap;
    padding: 10px 14px;
  }

  .nav-link.active { border-left-color: transparent; border-bottom-color: var(--yellow); }

  .content, .topbar { padding-left: 16px; padding-right: 16px; }
}

/* ============ AUTH (login) ============ */
/* Standalone layout -- no sidebar, since this page renders before
   there's a logged-in user to show nav for. Loosely modeled on
   Google's sign-in screen for layout only (centered card, round logo
   mark up top, big friendly heading, pill-shaped fields) -- colors,
   card treatment (border, not a heavy drop shadow), and type all stay
   on the actual brand style guide's own terms. */

.auth-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--page-bg);
  padding: 24px;
}

.auth-card {
  width: 100%;
  max-width: 400px;
  background: var(--surface);
  border: var(--border);
  border-radius: 28px;
  padding: 44px 36px 32px;
  text-align: center;
}

.auth-logo-mark {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--black);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
}

.auth-heading {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 26px;
  margin-bottom: 6px;
}

.auth-subtitle {
  color: var(--text-secondary);
  font-size: 14px;
  margin-bottom: 28px;
}

.auth-card form { text-align: left; }

.auth-card label {
  margin-top: 16px;
  text-transform: none;
  font-weight: 500;
  font-size: 13px;
  letter-spacing: 0;
  color: var(--text-secondary);
}
.auth-card label:first-of-type { margin-top: 0; }

.auth-card input[type="text"],
.auth-card input[type="password"] {
  border-radius: 999px;
  padding: 13px 20px;
}

.auth-card .btn {
  width: 100%;
  margin-top: 24px;
  border-radius: 999px;
  padding: 13px 20px;
}

.auth-card .banner {
  text-align: left;
  border-radius: 14px;
}

.auth-foot {
  text-align: center;
  margin-top: 22px;
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* "Built by Magichouse Media" credit -- login screen only. Two raster
   logo files (not a single recolorable SVG), so theme-switching means
   showing/hiding the right one rather than recoloring one image. If
   the branding here ever migrates, this is the one place to touch. */
.auth-credit {
  margin-top: 18px;
  padding-top: 16px;
  border-top: var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 11px;
  color: var(--text-secondary);
}

.auth-credit img {
  height: 13px;
  width: auto;
  display: inline-block;
}

.auth-credit .credit-dark { display: none; }
:root[data-theme="dark"] .auth-credit .credit-light { display: none; }
:root[data-theme="dark"] .auth-credit .credit-dark { display: inline-block; }
