/* ═══════════════════════════════════════════════════════════════════════
   NPU Intranet — Design System & Shell
   ═══════════════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700;800&display=swap');

/* ── VARIABLES ─────────────────────────────────────────────────────────── */
:root {
  --gold:      #C09F63;
  --gold-dim:  rgba(192,159,99,.15);
  --blue:      #0099CC;
  --blue-dim:  rgba(0,153,204,.12);
  --twilight:  #515B69;
  --nebula:    #006699;
  --ash:       #F3F3F3;
  --black:     #000000;
  --surface:   #0d0d0d;
  --card:      #111111;
  --card2:     #161616;
  --border:    #222222;
  --border2:   #2a2a2a;
  --muted:     #555555;
  --text:      #cccccc;
  --text-dim:  #888888;

  --sidebar-w: 240px;
  --header-h:  56px;

  /* section colors */
  --col-find:    #C09F63;
  --col-frame:   #0099CC;
  --col-build:   #515B69;
  --col-close:   #006699;
  --col-talent:  #CC6600;
  --col-finance: #50b464;
}

/* ── RESET ─────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; scroll-behavior: smooth; }

body {
  font-family: 'Poppins', sans-serif;
  background: var(--black);
  color: var(--text);
  line-height: 1.5;
  display: flex;
  min-height: 100vh;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

/* ── SIDEBAR ───────────────────────────────────────────────────────────── */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 100;
  overflow-y: auto;
  overflow-x: hidden;
}

/* Logo */
.sidebar-logo {
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.sidebar-logo img {
  height: 28px;
  width: auto;
  opacity: 0.9;
}
.sidebar-logo-label {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 8px;
}

/* Nav scroll area */
.sidebar-nav {
  flex: 1;
  padding: 12px 0;
  overflow-y: auto;
}

/* Section label */
.nav-section {
  padding: 16px 20px 6px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: #333;
}

/* Nav item */
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 20px;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  transition: color .15s, background .15s;
  border-left: 2px solid transparent;
  line-height: 1.3;
}
.nav-item:hover {
  color: var(--ash);
  background: rgba(255,255,255,.03);
}
.nav-item.active {
  color: var(--gold);
  border-left-color: var(--gold);
  background: var(--gold-dim);
}
.nav-item .nav-icon {
  font-size: 14px;
  flex-shrink: 0;
  width: 18px;
  text-align: center;
}
.nav-item .nav-badge {
  margin-left: auto;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: .5px;
  padding: 2px 6px;
  background: var(--border2);
  color: #444;
  border-radius: 2px;
}
.nav-item.soon { opacity: .4; cursor: default; pointer-events: none; }
.nav-item.soon:hover { color: var(--muted); background: none; }

/* Sub-items (processes) */
.nav-sub-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 6px 20px 6px 28px;
  font-size: 11px;
  color: var(--muted);
  cursor: pointer;
  transition: color .15s;
  border-left: 2px solid transparent;
}
.nav-sub-item:hover { color: var(--ash); }
.nav-sub-item.active { color: var(--gold); border-left-color: var(--gold); }
.nav-sub-item .sub-num {
  font-size: 9px;
  font-weight: 700;
  color: #333;
  flex-shrink: 0;
  margin-top: 2px;
}

.nav-divider {
  height: 1px;
  background: var(--border);
  margin: 8px 20px;
}

/* Chat button */
.sidebar-chat {
  flex-shrink: 0;
  padding: 12px;
  border-top: 1px solid var(--border);
}
.chat-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  background: var(--gold-dim);
  border: 1px solid rgba(192,159,99,.2);
  color: var(--gold);
  font-family: 'Poppins', sans-serif;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s;
  border-radius: 3px;
}
.chat-btn:hover { background: rgba(192,159,99,.25); }
.chat-btn .chat-icon { font-size: 16px; }

/* ── MAIN CONTENT ──────────────────────────────────────────────────────── */
.main {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Page header */
.page-header {
  position: sticky;
  top: 0;
  background: rgba(0,0,0,.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  padding: 0 48px;
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 50;
  flex-shrink: 0;
}
.breadcrumb {
  font-size: 11px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 6px;
}
.breadcrumb a { color: var(--muted); transition: color .15s; }
.breadcrumb a:hover { color: var(--ash); }
.breadcrumb .sep { color: #333; }
.breadcrumb .current { color: var(--text-dim); }
.header-meta {
  font-size: 11px;
  color: #333;
}

/* Page body */
.page-body {
  flex: 1;
  padding: 0;
}

/* ── CHAT WIDGET ───────────────────────────────────────────────────────── */
.chat-panel {
  position: fixed;
  bottom: 0;
  right: 0;
  width: 400px;
  height: 560px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-bottom: none;
  border-right: none;
  display: flex;
  flex-direction: column;
  z-index: 200;
  transform: translateY(100%);
  transition: transform .25s ease;
}
.chat-panel.open { transform: translateY(0); }

.chat-panel-header {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.chat-panel-header h3 {
  font-size: 13px;
  font-weight: 600;
  color: var(--gold);
  display: flex;
  align-items: center;
  gap: 8px;
}
.chat-close {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 18px;
  cursor: pointer;
  padding: 2px 6px;
  line-height: 1;
}
.chat-close:hover { color: var(--ash); }

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.chat-bubble {
  max-width: 88%;
  padding: 10px 13px;
  font-size: 12px;
  line-height: 1.5;
  border-radius: 3px;
}
.chat-bubble.assistant {
  background: var(--card);
  color: var(--text);
  align-self: flex-start;
  border-left: 2px solid var(--gold);
}
.chat-bubble.user {
  background: var(--blue-dim);
  color: var(--ash);
  align-self: flex-end;
  border-right: 2px solid var(--blue);
}
.chat-bubble.system {
  background: rgba(192,159,99,.06);
  color: var(--text-dim);
  font-style: italic;
  font-size: 11px;
  align-self: center;
  text-align: center;
  border: 1px dashed rgba(192,159,99,.2);
}

.chat-input-row {
  padding: 12px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}
.chat-input {
  flex: 1;
  background: var(--card);
  border: 1px solid var(--border2);
  color: var(--ash);
  font-family: 'Poppins', sans-serif;
  font-size: 12px;
  padding: 9px 12px;
  outline: none;
  resize: none;
  height: 40px;
  line-height: 1.4;
}
.chat-input:focus { border-color: rgba(192,159,99,.3); }
.chat-send {
  background: var(--gold);
  border: none;
  color: #000;
  font-family: 'Poppins', sans-serif;
  font-size: 13px;
  font-weight: 700;
  padding: 0 14px;
  cursor: pointer;
  transition: opacity .15s;
}
.chat-send:hover { opacity: .85; }
.chat-send:disabled { opacity: .3; cursor: default; }

/* Setup notice */
.chat-setup-notice {
  margin: 12px;
  padding: 14px;
  background: rgba(192,159,99,.06);
  border: 1px dashed rgba(192,159,99,.2);
  font-size: 11px;
  color: var(--text-dim);
  line-height: 1.6;
  text-align: center;
}
.chat-setup-notice strong { color: var(--gold); display: block; margin-bottom: 4px; }

/* ── COMMON PAGE COMPONENTS ────────────────────────────────────────────── */

/* Hero sections */
.page-hero {
  padding: 56px 48px 48px;
  border-bottom: 1px solid var(--border);
}
.page-eyebrow {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 14px;
}
.page-title {
  font-size: 40px;
  font-weight: 800;
  text-transform: uppercase;
  line-height: 1.05;
  color: #fff;
  letter-spacing: -.5px;
}
.page-title span { color: var(--gold); }
.page-subtitle {
  margin-top: 16px;
  font-size: 13px;
  color: var(--text-dim);
  max-width: 600px;
  line-height: 1.6;
}
.page-subtitle strong { color: var(--gold); font-weight: 600; }
.page-hero-meta {
  margin-top: 24px;
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
}
.meta-item {
  font-size: 11px;
}
.meta-item .meta-label {
  color: #333;
  letter-spacing: 1px;
  text-transform: uppercase;
  font-size: 9px;
  font-weight: 700;
  margin-bottom: 2px;
}
.meta-item .meta-value { color: var(--text-dim); }

/* Section wrappers */
.content-section {
  padding: 48px 48px 0;
}
.content-section:last-child { padding-bottom: 64px; }
.section-h {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: #444;
  margin-bottom: 24px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

/* Cards grid */
.cards-grid {
  display: grid;
  gap: 2px;
}
.cards-grid-2 { grid-template-columns: 1fr 1fr; }
.cards-grid-3 { grid-template-columns: repeat(3, 1fr); }
.cards-grid-4 { grid-template-columns: repeat(4, 1fr); }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  padding: 24px;
}
.card-label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #444;
  margin-bottom: 6px;
}
.card-title {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 8px;
}
.card-body {
  font-size: 12px;
  color: var(--text-dim);
  line-height: 1.6;
}

/* Tables */
.data-table {
  width: 100%;
  border-collapse: collapse;
}
.data-table th {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #444;
  text-align: left;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
}
.data-table td {
  font-size: 12px;
  color: var(--text-dim);
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255,255,255,.025);
  vertical-align: top;
}
.data-table td:first-child { color: var(--text); }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr.highlight td:first-child { color: var(--gold); font-weight: 600; }

/* Badges */
.badge {
  display: inline-block;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: .8px;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 2px;
  vertical-align: middle;
  margin-left: 6px;
}
.badge-auto   { background: rgba(0,153,204,.15);    color: var(--blue); }
.badge-ai     { background: rgba(192,159,99,.15);   color: var(--gold); }
.badge-semi   { background: rgba(255,255,255,.06);  color: #666; }
.badge-build  { background: rgba(192,159,99,.08);   color: #a07840; border: 1px dashed rgba(192,159,99,.2); }
.badge-soon   { background: rgba(255,255,255,.04);  color: #444; }
.badge-done   { background: rgba(80,180,100,.12);   color: #50b464; }
.badge-todo   { background: rgba(255,255,255,.04);  color: #555; }

/* Gate chips */
.gate-list { display: flex; flex-direction: column; gap: 5px; }
.gate-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 12px;
  font-size: 11px;
  line-height: 1.4;
  border-radius: 2px;
}
.gate-go   { background: #1D4A2E; color: #5dba7e; }
.gate-mid  { background: #4A3800; color: #c8a040; }
.gate-stop { background: #4A1010; color: #c05050; }
.gate-icon { flex-shrink: 0; font-size: 11px; margin-top: 1px; }

/* Output chips */
.output-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border); }
.output-chip {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .3px;
  padding: 5px 12px;
  border: 1px solid var(--border);
  color: #555;
  text-transform: uppercase;
}

/* Callout boxes */
.callout {
  padding: 20px 24px;
  border: 1px solid var(--border2);
  background: var(--card);
  display: flex;
  gap: 20px;
  align-items: flex-start;
  margin: 24px 0;
}
.callout-gold  { border-color: rgba(192,159,99,.3); background: rgba(192,159,99,.04); }
.callout-blue  { border-color: rgba(0,153,204,.2);  background: rgba(0,153,204,.03); }
.callout-dashed { border-style: dashed; }
.callout-icon { font-size: 22px; flex-shrink: 0; margin-top: 2px; }
.callout h4 { font-size: 11px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; margin-bottom: 6px; }
.callout-gold h4 { color: var(--gold); }
.callout-blue h4 { color: var(--blue); }
.callout p { font-size: 12px; color: var(--text-dim); line-height: 1.6; }
.callout strong { color: var(--text); }

/* Action list */
.action-list { list-style: none; }
.action-list li {
  font-size: 12px;
  color: var(--text-dim);
  padding: 5px 0 5px 18px;
  position: relative;
  line-height: 1.45;
}
.action-list li::before {
  content: '→';
  position: absolute;
  left: 0;
  color: #3a3a3a;
  font-size: 11px;
}

/* Dividers */
.divider { height: 1px; background: var(--border); margin: 32px 0; }

/* Phase / stage header */
.phase-header {
  padding: 20px 24px 18px;
  border-left: 3px solid;
}
.phase-header .phase-num {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  opacity: .5;
  margin-bottom: 3px;
}
.phase-header .phase-name {
  font-size: 16px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .3px;
}
.phase-header .phase-feeling {
  font-size: 11px;
  color: var(--muted);
  font-style: italic;
  margin-top: 4px;
}

/* Scrollbar */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #2a2a2a; border-radius: 2px; }
::-webkit-scrollbar-thumb:hover { background: #3a3a3a; }

/* ── UTILITY ───────────────────────────────────────────────────────────── */
.text-gold   { color: var(--gold); }
.text-blue   { color: var(--blue); }
.text-muted  { color: var(--muted); }
.text-dim    { color: var(--text-dim); }
.text-white  { color: #fff; }
.text-sm     { font-size: 11px; }
.text-xs     { font-size: 10px; }
.text-upper  { text-transform: uppercase; letter-spacing: 1.5px; }
.font-bold   { font-weight: 700; }
.mt-8  { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mt-32 { margin-top: 32px; }
.mb-8  { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.flex  { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.gap-8  { gap: 8px; }
.gap-16 { gap: 16px; }
.gap-24 { gap: 24px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
