/* ============================================================
   EPIC PROJECT INTELLIGENCE
   PROFESSIONAL UI — 2026
   ============================================================ */

:root {
  --bg: #f4f6f8;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --surface-dark: #0f172a;

  --text: #111827;
  --text-soft: #64748b;
  --text-light: #94a3b8;

  --border: #e2e8f0;
  --border-strong: #cbd5e1;

  --primary: #111827;
  --primary-hover: #1f2937;

  --accent: #2563eb;
  --accent-soft: #eff6ff;

  --success: #15803d;
  --success-soft: #f0fdf4;

  --warning: #b45309;
  --danger: #b91c1c;

  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 20px;

  --shadow-sm:
    0 1px 2px rgba(15, 23, 42, 0.04),
    0 1px 3px rgba(15, 23, 42, 0.06);

  --shadow:
    0 10px 30px rgba(15, 23, 42, 0.07);

  --shadow-lg:
    0 24px 60px rgba(15, 23, 42, 0.10);

  --sidebar-width: 250px;
}


/* ============================================================
   RESET
   ============================================================ */

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;

  font-family:
    Inter,
    -apple-system,
    BlinkMacSystemFont,
    "SF Pro Display",
    "Segoe UI",
    Arial,
    sans-serif;

  color: var(--text);
  background:
    radial-gradient(
      circle at top right,
      rgba(37, 99, 235, 0.05),
      transparent 32%
    ),
    var(--bg);

  -webkit-font-smoothing: antialiased;
}

button,
input,
select,
textarea {
  font: inherit;
}


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

.shell {
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
  min-height: 100vh;
}


/* ============================================================
   SIDEBAR
   ============================================================ */

aside {
  position: sticky;
  top: 0;

  height: 100vh;
  padding: 28px 18px;

  background:
    linear-gradient(
      180deg,
      #0b1120 0%,
      #111827 100%
    );

  color: white;

  border-right: 1px solid rgba(255,255,255,0.06);
}

.brand {
  margin: 4px 10px 2px;

  font-size: 25px;
  font-weight: 800;
  letter-spacing: 0.22em;

  color: white;
}

.sub {
  margin: 0 10px 30px;

  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;

  color: #94a3b8;
}

nav {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

nav button {
  position: relative;

  width: 100%;
  padding: 12px 14px;

  border: 0;
  border-radius: 10px;

  background: transparent;
  color: #cbd5e1;

  text-align: left;

  font-size: 14px;
  font-weight: 600;

  cursor: pointer;

  transition:
    background 160ms ease,
    color 160ms ease,
    transform 160ms ease;
}

nav button:hover {
  color: white;
  background: rgba(255,255,255,0.07);
  transform: translateX(2px);
}

nav button.active {
  color: white;
  background:
    linear-gradient(
      90deg,
      rgba(37, 99, 235, 0.95),
      rgba(59, 130, 246, 0.82)
    );

  box-shadow:
    0 8px 24px rgba(37, 99, 235, 0.22);
}


/* ============================================================
   MAIN CONTENT
   ============================================================ */

main {
  width: 100%;
  max-width: 1480px;

  padding: 34px 42px 80px;
}

header {
  display: flex;
  align-items: center;
  justify-content: space-between;

  gap: 20px;

  margin-bottom: 32px;
}

header h1,
#title {
  margin: 0;

  font-size: clamp(28px, 3vw, 42px);
  line-height: 1.05;

  font-weight: 800;
  letter-spacing: -0.035em;

  color: #0f172a;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  min-height: 32px;
  padding: 7px 12px;

  border: 1px solid var(--border);
  border-radius: 999px;

  background: rgba(255,255,255,0.75);

  color: var(--text-soft);

  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.03em;

  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(10px);
}


/* ============================================================
   PANELS
   ============================================================ */

.panel {
  animation: panelEnter 180ms ease;
}

.panel.hidden {
  display: none;
}

@keyframes panelEnter {
  from {
    opacity: 0;
    transform: translateY(5px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}


/* ============================================================
   TYPOGRAPHY
   ============================================================ */

h2 {
  margin: 0 0 8px;

  font-size: 26px;
  font-weight: 760;
  letter-spacing: -0.025em;
}

h3 {
  margin: 0 0 16px;

  font-size: 18px;
  font-weight: 720;
  letter-spacing: -0.015em;
}

h4 {
  margin: 0 0 12px;

  font-size: 15px;
  font-weight: 700;
}

p {
  line-height: 1.6;
}

.muted {
  color: var(--text-soft);
  font-size: 14px;
  line-height: 1.55;
}


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

.card {
  margin-bottom: 22px;
  padding: 24px;

  border: 1px solid var(--border);
  border-radius: var(--radius-lg);

  background:
    linear-gradient(
      180deg,
      rgba(255,255,255,1),
      rgba(248,250,252,0.86)
    );

  box-shadow: var(--shadow-sm);

  transition:
    box-shadow 160ms ease,
    border-color 160ms ease,
    transform 160ms ease;
}

.card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow);
}


/* ============================================================
   HERO / INTRO
   ============================================================ */

.hero {
  margin-bottom: 26px;
}

.hero h2 {
  font-size: 30px;
}

.hero p {
  max-width: 760px;
  margin-top: 8px;
}


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

.grid,
.uploadgrid {
  display: grid;
  grid-template-columns:
    repeat(2, minmax(0, 1fr));

  gap: 16px;
}

label {
  display: flex;
  flex-direction: column;
  gap: 7px;

  color: #475569;

  font-size: 12px;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;

  border: 1px solid var(--border-strong);
  border-radius: 10px;

  background: white;
  color: var(--text);

  padding: 11px 12px;

  outline: none;

  transition:
    border-color 150ms ease,
    box-shadow 150ms ease;
}

input:focus,
select:focus,
textarea:focus {
  border-color: #3b82f6;

  box-shadow:
    0 0 0 3px rgba(59, 130, 246, 0.12);
}

textarea {
  min-height: 140px;
  resize: vertical;
}


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

button.primary,
.primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  min-height: 40px;

  padding: 10px 18px;

  border: 0;
  border-radius: 9px;

  background: var(--primary);
  color: white;

  font-size: 13px;
  font-weight: 700;

  cursor: pointer;

  transition:
    background 150ms ease,
    transform 150ms ease,
    box-shadow 150ms ease;
}

button.primary:hover,
.primary:hover {
  background: var(--primary-hover);

  transform: translateY(-1px);

  box-shadow:
    0 8px 20px rgba(15, 23, 42, 0.16);
}

button.primary:active,
.primary:active {
  transform: translateY(0);
}


/* ============================================================
   PROJECT LIST
   ============================================================ */

#projectList {
  display: grid;
  grid-template-columns:
    repeat(auto-fit, minmax(270px, 1fr));

  gap: 12px;
  margin-top: 16px;
}

.project-row {
  width: 100%;
  padding: 16px 17px;

  border: 1px solid var(--border);
  border-radius: 13px;

  background: white;
  color: var(--text);

  text-align: left;

  cursor: pointer;

  box-shadow: var(--shadow-sm);

  transition:
    transform 150ms ease,
    border-color 150ms ease,
    box-shadow 150ms ease,
    background 150ms ease;
}

.project-row:hover {
  transform: translateY(-2px);

  border-color: #93c5fd;

  box-shadow:
    0 12px 26px rgba(15, 23, 42, 0.08);
}

.project-row.active {
  border-color: #2563eb;

  background:
    linear-gradient(
      135deg,
      #eff6ff,
      #ffffff
    );

  box-shadow:
    0 0 0 2px rgba(37, 99, 235, 0.10),
    var(--shadow);
}

.project-row b {
  font-size: 14px;
  font-weight: 760;
}

.project-row small {
  display: inline-block;
  margin-top: 5px;

  color: var(--text-soft);
  font-size: 11px;
  font-weight: 600;
}


/* ============================================================
   SOURCE LIST
   ============================================================ */

.source-list {
  margin-top: 20px;

  border-top: 1px solid var(--border);
}

.source-row {
  display: grid;
  grid-template-columns:
    minmax(200px, 2fr)
    minmax(80px, 0.65fr)
    minmax(80px, 0.65fr)
    minmax(100px, 0.75fr);

  gap: 14px;

  align-items: center;

  padding: 13px 12px;

  border-bottom: 1px solid var(--border);

  font-size: 13px;
}

.source-row:hover {
  background: var(--surface-2);
}

.source-row b {
  overflow: hidden;

  text-overflow: ellipsis;
  white-space: nowrap;

  font-weight: 680;
}


/* ============================================================
   METRICS
   ============================================================ */

.cards {
  display: grid;
  grid-template-columns:
    repeat(auto-fit, minmax(180px, 1fr));

  gap: 14px;
}

.metric {
  padding: 18px;

  border: 1px solid var(--border);
  border-radius: var(--radius);

  background: white;

  box-shadow: var(--shadow-sm);
}

.metric b {
  display: block;

  margin-bottom: 7px;

  color: var(--text);

  font-size: 13px;
}

.metric span {
  color: var(--text-soft);

  font-size: 13px;
  font-weight: 600;
}


/* ============================================================
   BIM VIEWER
   ============================================================ */

.viewer-layout {
  display: grid;
  grid-template-columns:
    minmax(0, 1fr) 320px;

  gap: 18px;
}

.viewer-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;

  margin-bottom: 14px;
}

#epicCanvas {
  width: 100%;

  min-height: 440px;

  border: 1px solid var(--border);
  border-radius: 14px;

  background:
    linear-gradient(
      145deg,
      #020617,
      #111827
    );

  box-shadow:
    inset 0 0 40px rgba(0,0,0,0.24);
}

.truth-panel {
  min-height: 440px;

  padding: 18px;

  border: 1px solid var(--border);
  border-radius: 14px;

  background: white;

  box-shadow: var(--shadow-sm);
}


/* ============================================================
   RESULTS
   ============================================================ */

.answer,
pre {
  padding: 18px;

  border: 1px solid var(--border);
  border-radius: 12px;

  background: #0f172a;
  color: #e2e8f0;

  font-family:
    "SFMono-Regular",
    Consolas,
    monospace;

  font-size: 13px;
  line-height: 1.6;

  overflow: auto;
  white-space: pre-wrap;
}


/* ============================================================
   FILE INPUT
   ============================================================ */

input[type="file"] {
  padding: 8px;
}

input[type="file"]::file-selector-button {
  margin-right: 12px;
  padding: 8px 12px;

  border: 0;
  border-radius: 7px;

  background: #e2e8f0;
  color: #334155;

  font-weight: 650;

  cursor: pointer;
}


/* ============================================================
   SCROLLBAR
   ============================================================ */

::-webkit-scrollbar {
  width: 9px;
  height: 9px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  border: 2px solid transparent;
  border-radius: 20px;

  background-clip: padding-box;
  background-color: #cbd5e1;
}


/* ============================================================
   TABLET / IPAD
   ============================================================ */

@media (max-width: 1100px) {
  :root {
    --sidebar-width: 210px;
  }

  main {
    padding:
      28px 28px 60px;
  }

  .viewer-layout {
    grid-template-columns: 1fr;
  }

  .truth-panel {
    min-height: auto;
  }
}


/* ============================================================
   MOBILE
   ============================================================ */

@media (max-width: 760px) {
  .shell {
    display: block;
  }

  aside {
    position: relative;

    width: 100%;
    height: auto;

    padding: 18px;
  }

  .brand {
    font-size: 20px;
  }

  .sub {
    margin-bottom: 14px;
  }

  nav {
    display: grid;
    grid-template-columns:
      repeat(2, minmax(0, 1fr));

    gap: 7px;
  }

  nav button {
    text-align: center;
  }

  main {
    padding:
      22px 16px 60px;
  }

  header {
    align-items: flex-start;
  }

  .grid,
  .uploadgrid {
    grid-template-columns: 1fr;
  }

  #projectList {
    grid-template-columns: 1fr;
  }

  .source-row {
    grid-template-columns: 1fr;
    gap: 4px;

    padding:
      14px 8px;
  }

  #epicCanvas {
    min-height: 320px;
  }
}
/* EPIC LOGO */
.epic-logo-wrap {
  margin: 0 0 18px;
  padding: 0;
}

.epic-logo {
  display: block;
  width: 210px;
  max-width: 100%;
  height: auto;
  object-fit: contain;
}
@media (max-width: 1100px) {
  .epic-logo {
    width: 180px;
  }
}
/* ATLAS LOGO - SIDEBAR BOTTOM */

.sidebar-footer {
  margin-top: auto;
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.atlas-logo {
  max-width: 160px;
  width: 100%;
  height: auto;
  object-fit: contain;
}

@media (max-width: 1100px) {
  .atlas-logo {
    max-width: 120px;
  }
}
