/* Customer Interview Lab — "Bruin Classic"
   UCLA blue #2774AE · gold #FFC72C · navy ink #17334E · cool paper #F6F9FC */

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: #F6F9FC;
  color: #17334E;
  font-family: -apple-system, "Segoe UI", system-ui, Roboto, Arial, sans-serif;
  line-height: 1.55;
  display: flex;
  flex-direction: column;
}

h1, h2, .brand { font-family: Georgia, "Times New Roman", serif; }

/* ---- chrome ---- */
.topbar {
  background: #17334E;
  color: #fff;
  padding: 12px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 16px;
}
.brand { font-size: 18px; }
.brand .gold { color: #FFC72C; }
.topbar-right { display: flex; align-items: center; gap: 14px; font-size: 13px; }
.topbar-right a { color: #FFC72C; text-decoration: none; }
.topbar-right a:hover { text-decoration: underline; }
.topbar .meta { color: #C9D8E5; }
.goldline { height: 3px; background: #FFC72C; flex-shrink: 0; }

main.page {
  flex: 1;
  width: 100%;
  max-width: 860px;
  margin: 0 auto;
  padding: 36px 24px 72px;
}

.flash { margin-bottom: 20px; }
.flash p {
  background: #FFF7DF;
  border: 1px solid #E8CE7A;
  border-radius: 6px;
  padding: 10px 14px;
  font-size: 14px;
  margin: 0 0 8px;
}
.error {
  background: #FBEBEA;
  border: 1px solid #E3A9A5;
  border-radius: 6px;
  padding: 10px 12px;
  font-size: 13.5px;
  color: #7A2A25;
}

/* ---- buttons ---- */
.btn {
  display: inline-block;
  border: none;
  border-radius: 5px;
  padding: 11px 20px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
}
.btn-blue { background: #2774AE; color: #fff; }
.btn-blue:hover { background: #205F8F; }
.btn-gold { background: #FFC72C; color: #17334E; }
.btn-gold:hover { background: #F0B818; }
.btn-outline {
  background: #fff;
  color: #2774AE;
  border: 1px solid #B9CCDC;
  font-weight: 550;
}
.btn-outline:hover { border-color: #2774AE; }
.btn-full { width: 100%; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn:focus-visible, a:focus-visible, textarea:focus-visible, input:focus-visible {
  outline: 2px solid #2774AE;
  outline-offset: 2px;
}

/* ---- login card ---- */
.card {
  background: #fff;
  border: 1px solid #D9E4EE;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(23, 51, 78, 0.08);
  padding: 28px;
}
.login-card { max-width: 380px; margin: 48px auto 0; }
.login-card h1 { font-size: 24px; margin: 0 0 6px; }
.hint { font-size: 13px; color: #64798C; }
.login-card form { margin-top: 16px; display: flex; flex-direction: column; }
.login-card label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #64798C;
  margin: 12px 0 4px;
}
.login-card input {
  border: 1px solid #C3D2DF;
  border-radius: 5px;
  padding: 10px;
  font-size: 14px;
  background: #FBFDFE;
  color: #17334E;
  font-family: inherit;
}
.login-card .btn { margin-top: 20px; }

/* ---- home ---- */
.welcome h1 { font-size: 30px; margin: 0 0 10px; }
.welcome > p { max-width: 62ch; color: #46586A; margin: 0 0 22px; }
.meta-line { font-size: 12.5px; color: #64798C; margin: 10px 0 0; }
.past { margin-top: 40px; }
.past h2 {
  font-family: inherit;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #64798C;
  margin: 0 0 10px;
}
.row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  background: #fff;
  border: 1px solid #D9E4EE;
  border-radius: 6px;
  padding: 12px 14px;
  margin-bottom: 8px;
  font-size: 14px;
  color: #17334E;
  text-decoration: none;
}
.row:hover { border-color: #2774AE; }
.row-meta { color: #64798C; font-size: 12.5px; white-space: nowrap; }
.live {
  font-style: normal;
  font-size: 11px;
  font-weight: 600;
  color: #1E6B3C;
  background: #E3F2E8;
  border-radius: 10px;
  padding: 2px 8px;
  margin-left: 8px;
}

/* ---- chat ---- */
body.chat-body { height: 100vh; overflow: hidden; }
main.chat-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 860px;
  margin: 0 auto;
  padding: 0 24px 16px;
  min-height: 0;
}
.chat-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 14px 0;
  border-bottom: 1px solid #D9E4EE;
}
.chat-head b { font-family: Georgia, serif; font-size: 17px; }
.count { font-size: 12.5px; color: #64798C; margin-left: 12px; }
.chat-actions { display: flex; gap: 8px; }
.chat-actions .btn { padding: 8px 14px; font-size: 12.5px; }

.msgs {
  flex: 1;
  overflow-y: auto;
  padding: 18px 2px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
}
.msgs.static { flex: none; overflow: visible; }
.chat-hint {
  font-size: 13px;
  color: #64798C;
  background: #EEF4F9;
  border-radius: 8px;
  padding: 12px 16px;
  max-width: 56ch;
  margin: 0 auto 8px;
  text-align: center;
}
.msg {
  max-width: 76%;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 14px;
  white-space: pre-wrap;
  overflow-wrap: break-word;
}
.msg.student {
  align-self: flex-end;
  background: #2774AE;
  color: #fff;
  border-bottom-right-radius: 3px;
}
.msg.persona {
  align-self: flex-start;
  background: #fff;
  border: 1px solid #D9E4EE;
  color: #22384C;
  border-bottom-left-radius: 3px;
}
.msg.typing { color: #64798C; }
.msg.sys {
  align-self: center;
  background: #FFF7DF;
  border: 1px solid #E8CE7A;
  color: #5A4A12;
  font-size: 13px;
  max-width: 90%;
}
.stamp { display: block; font-size: 10.5px; color: #8DA2B4; margin-bottom: 2px; }

.chat-input {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  border-top: 1px solid #D9E4EE;
  padding-top: 12px;
}
.chat-input textarea {
  flex: 1;
  resize: none;
  border: 1px solid #C3D2DF;
  border-radius: 18px;
  padding: 10px 16px;
  font-size: 14px;
  font-family: inherit;
  background: #fff;
  color: #17334E;
  max-height: 120px;
}
.limit-note { font-size: 12.5px; color: #64798C; text-align: center; margin: 8px 0 0; }

/* ---- portal ---- */
.portal-block {
  background: #fff;
  border: 1px solid #D9E4EE;
  border-radius: 8px;
  padding: 18px 22px;
  margin: 0 0 14px;
  max-width: 70ch;
}
.portal-block h2 {
  font-family: inherit;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #64798C;
  margin: 0 0 8px;
}
.portal-block p { font-size: 13.5px; color: #46586A; margin: 0; }
.portal-list { margin: 0; padding-left: 18px; font-size: 13.5px; color: #46586A; }
.portal-list li { margin-bottom: 8px; }
.portal-list li:last-child { margin-bottom: 0; }
.portal-disclaimer { border-color: #E8CE7A; background: #FFFBF0; }
.portal-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px; }
.portal-cta { margin-top: 0; }

/* ---- transcript ---- */
.transcript h1 { font-size: 26px; margin: 4px 0 4px; }
.transcript a { color: #2774AE; }
.transcript .meta-line { margin-bottom: 18px; }

/* ---- admin ---- */
.admin h1 { font-size: 28px; margin: 0; }
.admin-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 8px;
}
.admin-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.admin-actions .btn { padding: 8px 14px; font-size: 12.5px; }
.admin h2 { font-size: 18px; margin: 28px 0 10px; }

/* ---- Data management / danger zone ---- */
.data-panel .panel-note { font-size: 13px; color: #46586A; margin: 0 0 12px; }
.danger-zone {
  margin-top: 18px;
  border: 1px solid #E3B4B4;
  background: #FCF4F4;
  border-radius: 8px;
  padding: 16px 18px;
}
.danger-zone h3 { margin: 0 0 6px; font-size: 15px; color: #9B2C2C; }
.danger-zone p { font-size: 13px; color: #6A4A4A; margin: 0 0 12px; }
.danger-label { display: block; font-size: 12.5px; color: #6A4A4A; margin-bottom: 6px; }
.danger-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.danger-row input {
  padding: 8px 12px;
  border: 1px solid #E3B4B4;
  border-radius: 6px;
  font-size: 13px;
  width: 160px;
}
.btn-danger { background: #C0392B; color: #fff; }
.btn-danger:hover:enabled { background: #A2321F; }
.btn-danger:disabled { background: #E0A8A0; cursor: not-allowed; }

/* ---- KPI tiles ---- */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
  margin: 20px 0 8px;
}
.kpi {
  background: #fff;
  border: 1px solid #D9E4EE;
  border-radius: 8px;
  padding: 16px 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.kpi-accent { border-color: #F0CE6A; background: #FFFBF0; }
.kpi-label {
  font-size: 11px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #64798C;
  font-weight: 600;
}
.kpi-value {
  font-family: -apple-system, "Segoe UI", system-ui, sans-serif;
  font-size: 30px;
  font-weight: 650;
  line-height: 1.1;
  color: #17334E;
}
.kpi-of { font-size: 16px; font-weight: 500; color: #8DA2B4; margin-left: 2px; }
.kpi-sub { font-size: 12px; color: #64798C; display: flex; align-items: center; gap: 5px; }
.dot-live {
  width: 7px; height: 7px; border-radius: 50%;
  background: #1E8E4E; display: inline-block; flex-shrink: 0;
}

/* ---- panel + bar chart ---- */
.panel {
  background: #fff;
  border: 1px solid #D9E4EE;
  border-radius: 8px;
  padding: 18px 20px 12px;
  margin: 16px 0 4px;
}
.panel-head h2 { font-family: Georgia, serif; font-size: 16px; margin: 0 0 4px; }
.barchart {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  align-items: end;
  gap: 10px;
  height: 180px;
  padding-top: 8px;
}
.bar-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  gap: 4px;
}
.bar-val {
  font-size: 12px;
  font-weight: 600;
  color: #46586A;
  font-variant-numeric: tabular-nums;
}
.bar-track {
  flex: 1;
  width: 100%;
  max-width: 40px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.bar-fill {
  width: 100%;
  max-width: 24px;
  min-height: 3px;
  background: #2774AE;
  border-radius: 4px 4px 0 0;
  transition: height 0.3s ease;
}
.bar-day { font-size: 11px; font-weight: 600; color: #46586A; }
.bar-date { font-size: 10px; color: #8DA2B4; }

.footnote {
  font-size: 12px;
  color: #64798C;
  line-height: 1.5;
  margin: 12px 0 4px;
  max-width: 78ch;
}
.num { text-align: right; font-variant-numeric: tabular-nums; }
.pill {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 9px;
  border-radius: 10px;
  background: #EEF2F6;
  color: #5A6B7B;
}
.pill-live { background: #E3F2E8; color: #1E6B3C; }
.table-wrap { overflow-x: auto; background: #fff; border: 1px solid #D9E4EE; border-radius: 8px; }
table { border-collapse: collapse; width: 100%; font-size: 13.5px; }
th, td { text-align: left; padding: 9px 12px; border-bottom: 1px solid #EAF1F7; }
th {
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #64798C;
  background: #F6F9FC;
  white-space: nowrap;
}
tr:last-child td { border-bottom: none; }
td a { color: #2774AE; }
.mono { font-family: Consolas, Menlo, monospace; font-size: 12px; }

@media (max-width: 640px) {
  .msg { max-width: 90%; }
  .chat-head { padding: 10px 0; }
}
