/* ==========================================================================
   Sky Bison Cloud Engine - Flat Modern Responsive Dashboard
   Single mobile-first stylesheet with responsive breakpoints, flat surfaces
   (no blur/glassmorphism), fluid typography, a fire-toned dark theme,
   mobile drawer navigation, pipeline funnel banner, job detail drawer,
   and mobile bottom command bar.
   ========================================================================== */

:root {
  color-scheme: dark;

  /* Color Palette Tokens - flat, opaque surfaces (no glassmorphism) */
  --bg-deep: #0a0603;
  --bg-elevated: #170f09;
  --bg-card: #1c130b;
  --bg-sunken: #060302;
  --bg-input: #140d07;

  --border: rgba(255, 237, 213, 0.10);
  --border-strong: rgba(255, 237, 213, 0.20);
  --border-glow: rgba(255, 122, 41, 0.35);

  --text: #fdf5ec;
  --text-muted: #c2ab92;
  --text-faint: #8a7461;

  /* Elemental Color Accents - warm fire palette */
  --air: #ff7a29;
  --air-cyan: #ff7a29;
  --water: #ef4444;
  --water-blue: #ef4444;
  --earth: #f5a623;
  --earth-green: #f5a623;
  --fire: #ffcc33;
  --fire-orange: #f97316;
  --fire-gold: #ffcc33;
  --fire-red: #dc2626;
  --lotus: #e0834f;
  --rose: #ff5252;

  --focus: #ff7a29;

  --font-display: 'Cinzel', Georgia, serif;
  --font-sans: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Consolas, monospace;

  --radius-lg: 10px;
  --radius: 8px;
  --radius-sm: 6px;
  --shadow-lg: 0 2px 0 rgba(0, 0, 0, 0.5);
  --shadow: 0 1px 0 rgba(0, 0, 0, 0.4);
  --shadow-glow: none;

  --gutter: 1.25rem;
  --max-width: 1440px;
  --header-height: 72px;
}

@media (min-width: 640px) {
  :root { --gutter: 1.75rem; }
}
@media (min-width: 1024px) {
  :root { --gutter: 2.25rem; }
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  background-color: var(--bg-deep);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 100%;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  padding-bottom: 70px;
}
@media (min-width: 768px) {
  body { padding-bottom: 0; }
}

img { max-width: 100%; height: auto; display: block; }

/* --- Accessibility & Focus ---------------------------------------------- */

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: 0.75rem;
  top: -4rem;
  z-index: 300;
  background: var(--air);
  color: #030712;
  font-weight: 700;
  padding: 0.6rem 1.2rem;
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: top 0.2s ease;
  box-shadow: 0 4px 14px rgba(255, 122, 41, 0.4);
}
.skip-link:focus { top: 0.75rem; }

:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
  border-radius: 6px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* --- Header & Top Navigation Bar ---------------------------------------- */

.app-header {
  position: sticky;
  top: 0;
  z-index: 150;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
  padding: 0.75rem var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  box-shadow: none;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  text-decoration: none;
  color: inherit;
}

.logo-container, .brand-mark {
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  padding: 2px;
  background: var(--fire);
  box-shadow: 0 0 16px rgba(255, 122, 41, 0.3);
  transition: transform 0.3s ease;
}
.brand:hover .logo-container, .brand:hover .brand-mark {
  transform: scale(1.06) rotate(3deg);
}
.brand-logo, .brand-mark img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.brand-text { display: flex; flex-direction: column; min-width: 0; }

.brand-title {
  font-family: var(--font-display);
  font-size: clamp(1.1rem, 2.5vw, 1.45rem);
  font-weight: 900;
  letter-spacing: 0.8px;
  color: var(--fire);
}

.brand-subtitle {
  color: var(--text-muted);
  font-size: 0.72rem;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  font-weight: 500;
  white-space: nowrap;
}

/* Desktop Navigation Menu */
.desktop-nav {
  display: none;
  align-items: center;
  gap: 0.35rem;
}
@media (min-width: 1024px) {
  .desktop-nav { display: flex; }
}

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 0.95rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: none;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  transition: all 0.2s ease;
  white-space: nowrap;
}
.nav-link:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}
.nav-link.active, .nav-link.is-active {
  color: var(--air);
  background: rgba(255, 122, 41, 0.12);
  border-color: rgba(255, 122, 41, 0.3);
  box-shadow: 0 0 12px rgba(255, 122, 41, 0.15);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.sync-btn, .btn-sync {
  font-family: inherit;
  font-size: 0.84rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  padding: 0.5rem 1rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  border: 1px solid var(--border-strong);
  background: var(--bg-card);
  color: var(--text);
  transition: all 0.2s ease;
  min-height: 42px;
}
.sync-btn:hover, .btn-sync:hover {
  border-color: var(--air);
  box-shadow: 0 0 14px rgba(255, 122, 41, 0.25);
  transform: translateY(-1px);
}
.sync-btn:disabled, .btn-sync:disabled { opacity: 0.6; cursor: wait; }

/* Hamburger Button for Mobile */
.hamburger-btn {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 44px;
  height: 44px;
  padding: 0.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  color: var(--text);
  cursor: pointer;
  gap: 5px;
  transition: border-color 0.2s ease, background 0.2s ease;
}
.hamburger-btn:hover {
  border-color: var(--air);
  background: rgba(255, 122, 41, 0.1);
}
.hamburger-btn span {
  display: block;
  width: 20px;
  height: 2px;
  background-color: var(--text);
  border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.25s ease;
}
.hamburger-btn.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger-btn.is-open span:nth-child(2) { opacity: 0; }
.hamburger-btn.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (min-width: 1024px) {
  .hamburger-btn { display: none; }
}

/* Mobile Drawer Overlay & Sliding Menu */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(6, 3, 2, 0.75);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.drawer-backdrop.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.mobile-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(85vw, 320px);
  z-index: 210;
  background: var(--bg-deep);
  border-left: 1px solid var(--border-strong);
  padding: 1.5rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: -1px 0 0 var(--border-strong);
}
.mobile-drawer.is-open {
  transform: translateX(0);
}

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}
.drawer-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--air);
}
.drawer-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.25rem;
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.drawer-close:hover { color: var(--text); }

.drawer-links {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.drawer-links .nav-link {
  width: 100%;
  padding: 0.85rem 1rem;
  font-size: 0.95rem;
  border-radius: var(--radius-sm);
  min-height: 46px;
}

/* --- Interactive Pipeline Funnel Banner -------------------------------- */

.pipeline-funnel-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  margin-bottom: 1.75rem;
  box-shadow: var(--shadow);
}
.funnel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}
.funnel-main-title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--fire-gold);
}
.funnel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr));
  gap: 1rem;
}

.funnel-step {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  transition: all 0.25s ease;
}
.funnel-step:hover {
  transform: translateY(-2px);
  border-color: var(--air);
  box-shadow: 0 4px 16px rgba(255, 122, 41, 0.15);
}
.funnel-step.step-water { border-left: 4px solid var(--water); }
.funnel-step.step-earth { border-left: 4px solid var(--earth); }
.funnel-step.step-air { border-left: 4px solid var(--air); }
.funnel-step.step-fire { border-left: 4px solid var(--fire); }

.funnel-icon { font-size: 1.6rem; flex: none; }
.funnel-meta { display: flex; flex-direction: column; min-width: 0; }
.funnel-name { font-size: 0.75rem; text-transform: uppercase; font-weight: 700; letter-spacing: 0.5px; color: var(--text-muted); }
.funnel-val { font-family: var(--font-mono); font-size: 1.3rem; font-weight: 800; color: #fff; }

/* --- Job Detail Slide-Out Overlay Drawer -------------------------------- */

.job-detail-drawer {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: min(90vw, 480px);
  z-index: 220;
  background: var(--bg-deep);
  border-left: 1px solid var(--border-strong);
  padding: 1.75rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: -1px 0 0 var(--border-strong);
  overflow-y: auto;
}
.job-detail-drawer.is-open { transform: translateX(0); }

.detail-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}
.detail-drawer-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--air);
}
.detail-field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.65rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}
.detail-label { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-muted); font-weight: 600; }
.detail-value { font-family: var(--font-mono); font-size: 0.9rem; color: #fff; word-break: break-all; }

/* --- Mobile Bottom Navigation Bar (< 768px) ----------------------------- */

.mobile-bottom-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: 60px;
  z-index: 140;
  background: var(--bg-elevated);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-around;
  box-shadow: 0 -1px 0 var(--border);
}
@media (min-width: 768px) {
  .mobile-bottom-nav { display: none; }
}

.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.68rem;
  font-weight: 600;
  flex: 1;
  height: 100%;
  transition: color 0.2s ease;
}
.bottom-nav-item:hover, .bottom-nav-item.active {
  color: var(--air);
}
.bottom-nav-icon { font-size: 1.15rem; }

/* --- Layout Containers & Cards ------------------------------------------ */

.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: var(--gutter);
  flex: 1;
}

.page-intro { margin-bottom: 1.75rem; }

.page-title {
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 3.8vw, 2.1rem);
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--text);
}

.page-lede {
  color: var(--text-muted);
  font-size: 0.96rem;
  max-width: 75ch;
  margin-top: 0.4rem;
}

.section { margin-bottom: 2.25rem; }

.section-header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.6rem;
  margin-bottom: 1rem;
}

.section-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--fire);
}

.section-note {
  font-size: 0.82rem;
  color: var(--text-faint);
}

/* Flat Surface Cards */
.card, .infra-card, .table-card, .log-console {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.35rem;
  box-shadow: var(--shadow);
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}
.card:hover, .infra-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-lg);
}

.infra-card {
  margin-bottom: 1.75rem;
}
.infra-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding-bottom: 1rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}
.infra-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--air);
}

.infra-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
  gap: 1.1rem;
}
.infra-item {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.infra-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  font-weight: 600;
}
.infra-val {
  font-family: var(--font-mono);
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text);
  word-break: break-all;
}

/* --- KPI Metric Tiles --------------------------------------------------- */

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
  gap: 1.1rem;
  margin-bottom: 2rem;
}

.kpi-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 4px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s ease, border-color 0.25s ease;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  overflow: hidden;
}
.kpi-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

/* Element color theme accents */
.kpi-card.element-air, .accent-air { border-left-color: var(--air); }
.kpi-card.element-water, .accent-water { border-left-color: var(--water); }
.kpi-card.element-earth, .accent-earth { border-left-color: var(--earth); }
.kpi-card.element-fire, .accent-fire { border-left-color: var(--fire); }
.kpi-card.element-lotus, .accent-lotus { border-left-color: var(--lotus); }
.kpi-card.element-error, .accent-error { border-left-color: var(--rose); }

.kpi-title, .kpi-label {
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-muted);
}

.kpi-value {
  font-family: var(--font-mono);
  font-size: clamp(1.75rem, 4vw, 2.2rem);
  font-weight: 800;
  line-height: 1.1;
  color: #ffffff;
}
.kpi-air, .accent-air .kpi-value { color: var(--air); }
.kpi-water, .accent-water .kpi-value { color: var(--water); }
.kpi-earth, .accent-earth .kpi-value { color: var(--earth); }
.kpi-fire, .accent-fire .kpi-value { color: var(--fire); }
.kpi-lotus, .accent-lotus .kpi-value { color: var(--lotus); }
.kpi-rose, .accent-error .kpi-value { color: var(--rose); }

.kpi-subtext, .kpi-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* --- Split Layouts ------------------------------------------------------ */

.split-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  margin-bottom: 1.75rem;
}
@media (min-width: 900px) {
  .split-grid { grid-template-columns: 1fr 1fr; }
}

/* --- Controls, Form Inputs & Filters ------------------------------------ */

.controls-bar, .controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.85rem;
  margin-bottom: 1.25rem;
}

.search-input, .input, .select, .file-select {
  flex: 1 1 240px;
  min-width: 0;
  min-height: 44px;
  background: var(--bg-input);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 0.6rem 1rem;
  color: var(--text);
  font-family: inherit;
  font-size: 0.9rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.search-input::placeholder, .input::placeholder { color: var(--text-faint); }
.search-input:focus, .input:focus, .select:focus, .file-select:focus {
  border-color: var(--air);
  box-shadow: 0 0 12px rgba(255, 122, 41, 0.2);
}

.secondary-btn, .btn-secondary {
  min-height: 44px;
  padding: 0.55rem 1.1rem;
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--bg-card);
  color: var(--text);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: all 0.2s ease;
}
.secondary-btn:hover, .btn-secondary:hover {
  border-color: var(--air);
  color: var(--air);
  background: rgba(255, 122, 41, 0.1);
}

.log-filter-pills, .filter-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.pill-btn, .pill {
  min-height: 38px;
  font-family: inherit;
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  color: var(--text-muted);
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: all 0.2s ease;
}
.pill-btn:hover, .pill:hover {
  color: var(--text);
  border-color: var(--air);
  background: rgba(255, 122, 41, 0.08);
}
.pill-btn.active, .pill-btn.is-active, .pill.is-active {
  background: rgba(255, 122, 41, 0.18);
  color: var(--air);
  border-color: var(--air);
  box-shadow: 0 0 12px rgba(255, 122, 41, 0.2);
}
.pill-error.active { background: rgba(239, 68, 68, 0.2); color: #fca5a5; border-color: var(--rose); }
.pill-ai.active { background: rgba(52, 211, 153, 0.2); color: #6ee7b7; border-color: var(--earth); }
.pill-http.active { background: rgba(14, 165, 233, 0.2); color: #7dd3fc; border-color: var(--water); }
.pill-sub.active { background: rgba(251, 191, 36, 0.2); color: #fde68a; border-color: var(--fire); }

/* --- Data Tables & Mobile Scroll ---------------------------------------- */

.table-card {
  padding: 0;
  overflow: hidden;
}

.table-scroll, .data-table-wrapper {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.data-table {
  width: 100%;
  min-width: 680px;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.88rem;
}

.data-table th {
  background: var(--bg-sunken);
  color: var(--fire-gold);
  font-family: var(--font-display);
  font-size: 0.78rem;
  letter-spacing: 0.6px;
  font-weight: 700;
  border-bottom: 1px solid var(--border);
  padding: 0.85rem 1rem;
  position: sticky;
  top: 0;
  z-index: 2;
  white-space: nowrap;
}

.data-table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.data-table tbody tr { cursor: pointer; transition: background 0.15s ease; }
.data-table tbody tr:hover { background: rgba(255, 122, 41, 0.08); }
.data-table tbody tr:last-child td { border-bottom: 0; }

/* --- Badges & Status Chips ---------------------------------------------- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.65rem;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  white-space: nowrap;
  border: 1px solid transparent;
}
.badge-confirmed, .badge-ok { background: rgba(52, 211, 153, 0.16); color: #6ee7b7; border-color: rgba(52, 211, 153, 0.35); }
.badge-failed, .badge-bad { background: rgba(239, 68, 68, 0.16); color: #fca5a5; border-color: rgba(239, 68, 68, 0.38); }
.badge-warn { background: rgba(251, 191, 36, 0.16); color: #fcd34d; border-color: rgba(251, 191, 36, 0.35); }
.badge-info { background: rgba(255, 122, 41, 0.14); color: #7dd3fc; border-color: rgba(255, 122, 41, 0.32); }
.badge-greenhouse { background: rgba(52, 211, 153, 0.15); color: #6ee7b7; border-color: rgba(52, 211, 153, 0.32); }
.badge-ashby { background: rgba(255, 122, 41, 0.15); color: #7dd3fc; border-color: rgba(255, 122, 41, 0.32); }
.badge-lever { background: rgba(192, 132, 252, 0.16); color: #e9d5ff; border-color: rgba(192, 132, 252, 0.34); }

.resume-download-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--air);
  text-decoration: none;
  font-size: 0.78rem;
  font-family: var(--font-mono);
  background: rgba(255, 122, 41, 0.1);
  border: 1px solid rgba(255, 122, 41, 0.3);
  padding: 0.3rem 0.65rem;
  border-radius: 6px;
  transition: all 0.2s ease;
}
.resume-download-link:hover {
  background: rgba(255, 122, 41, 0.22);
  border-color: var(--air);
  box-shadow: 0 0 10px rgba(255, 122, 41, 0.2);
}

/* --- Terminal Log Console ------------------------------------------------ */

.log-console-container {
  background: var(--bg-sunken);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: none;
}

.log-console-header {
  background: var(--bg-sunken);
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.6px;
  color: var(--fire-gold);
  border-bottom: 1px solid var(--border);
  padding: 0.75rem 1rem;
  display: grid;
  grid-template-columns: 12rem 8rem 1fr;
  gap: 0.75rem;
}
@media (max-width: 767px) {
  .log-console-header { display: none; }
}

.log-console-body {
  max-height: min(65vh, 600px);
  overflow-y: auto;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  line-height: 1.6;
  padding: 0.5rem 0;
}

.log-entry-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.3rem;
  padding: 0.55rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  align-items: start;
}
@media (min-width: 768px) {
  .log-entry-row {
    grid-template-columns: 12rem 8rem 1fr;
    gap: 0.75rem;
  }
}
.log-entry-row:hover { background: rgba(255, 122, 41, 0.04); }

.log-time { color: var(--text-faint); font-size: 0.76rem; white-space: nowrap; }
.log-badge-wrapper { flex: none; }

.log-badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 700;
}
.log-badge-info { background: rgba(255, 122, 41, 0.15); color: #7dd3fc; }
.log-badge-error { background: rgba(239, 68, 68, 0.2); color: #fca5a5; }
.log-badge-ai { background: rgba(52, 211, 153, 0.2); color: #6ee7b7; }
.log-badge-score { background: rgba(192, 132, 252, 0.2); color: #e9d5ff; }
.log-badge-http { background: rgba(14, 165, 233, 0.2); color: #7dd3fc; }

.log-text { color: #e2e8f0; overflow-wrap: anywhere; }

/* --- File Inspector & Code Viewers -------------------------------------- */

.inspector-meta-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.6rem 1rem;
  margin-bottom: 0.85rem;
  font-family: var(--font-mono);
  font-size: 0.82rem;
}

.json-viewer, .raw-file-box {
  background: var(--bg-sunken);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem;
  font-family: var(--font-mono);
  font-size: 0.83rem;
  line-height: 1.65;
  color: #e2e8f0;
  overflow: auto;
  max-height: min(65vh, 600px);
  white-space: pre-wrap;
  word-break: break-word;
}

/* Styled Archive & Queue Cards */
.archive-card, .queue-card {
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 1rem;
  margin-bottom: 0.85rem;
  transition: border-color 0.2s ease;
}
.archive-card:hover, .queue-card:hover {
  border-color: var(--air);
}
.archive-title, .queue-title {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--fire-gold);
  margin-bottom: 0.4rem;
}

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

.app-footer {
  background: var(--bg-sunken);
  border-top: 1px solid var(--border);
  padding: 2.75rem var(--gutter) 2rem;
  margin-top: 3.5rem;
}

.footer-container {
  max-width: var(--max-width);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}
@media (min-width: 600px) {
  .footer-container { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1024px) {
  .footer-container { grid-template-columns: 1.5fr 1fr 1fr 1fr; }
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 0.75rem;
}
.footer-logo {
  width: 32px;
  height: 32px;
  border-radius: 50%;
}
.footer-brand-title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--fire-gold);
}
.footer-desc {
  font-size: 0.83rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 0.85rem;
  max-width: 42ch;
}
.footer-copy { font-size: 0.76rem; color: var(--text-faint); }

.footer-heading {
  font-family: var(--font-display);
  font-size: 0.88rem;
  color: var(--air);
  margin-bottom: 0.85rem;
  letter-spacing: 0.5px;
}

.footer-links { list-style: none; display: flex; flex-direction: column; gap: 0.55rem; }
.footer-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.85rem;
  transition: color 0.2s ease;
}
.footer-links a:hover { color: var(--air); text-decoration: underline; }

/* --- Mobile Responsiveness Adjustments ---------------------------------- */

@media (max-width: 768px) {
  .app-header { padding: 0.6rem var(--gutter); }
  .brand-subtitle { display: none; }
  .kpi-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 160px), 1fr)); }
  .kpi-card { padding: 1rem; }
  .kpi-value { font-size: 1.6rem; }
  .controls-bar { flex-direction: column; align-items: stretch; }
  .search-input { width: 100%; }
}

/* --- Print -------------------------------------------------------------- */

@media print {
  .app-header, .app-footer, .controls-bar, .log-filter-pills, .hamburger-btn, .mobile-drawer, .mobile-bottom-nav { display: none !important; }
  body { background: #fff; color: #000; }
  .card, .infra-card, .table-card { border-color: #ccc; box-shadow: none; background: #fff; }
  .data-table { min-width: 0; }
}
