/* ========================
   UMBREXA — Global Styles
   ======================== */

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

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

:root {
  --bg: #f0f0f0;
  --bg-wave: #e8e8e8;
  --black: #111111;
  --white: #ffffff;
  --gold: #c8a96e;
  --grey-text: #555555;
  --light-grey: #aaaaaa;
  --card-bg: rgba(255,255,255,0.55);
  --border: rgba(0,0,0,0.1);
  --radius: 12px;
  --shadow: 0 4px 32px rgba(0,0,0,0.07);
  --transition: 0.25s cubic-bezier(.4,0,.2,1);

  /* Wave SVG color tokens (light) */
  --wave-shadow-color: #000000;
  --wave-shadow-opacity: 0.04;
  --wave-stop-0: #ffffff;
  --wave-stop-1: #f2f2f2;
  --wave-fill-plain: #ffffff;
}

/* =====================
   DARK MODE VARIABLES
   ===================== */

body.dark-mode {
  --black: #f0f0f0;
  --white: #1a1a1a;
  --bg: #0f0f0f;
  --grey-text: #aaaaaa;
  --light-grey: #666666;
  --border: rgba(255,255,255,0.1);
  --card-bg: rgba(30,30,30,0.75);
  --shadow: 0 4px 32px rgba(0,0,0,0.5);

  /* Wave SVG color tokens (dark) */
  --wave-shadow-color: #000000;
  --wave-shadow-opacity: 0.25;
  --wave-stop-0: #1e1e1e;
  --wave-stop-1: #141414;
  --wave-fill-plain: #1a1a1a;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', sans-serif;
  background: radial-gradient(circle at center, #ffffff 35%, #f7f7f7 100%);
  color: var(--black);
  min-height: 100vh;
  overflow-x: hidden;
  transition: background 0.35s ease, color 0.35s ease;
}

body.dark-mode {
  background: radial-gradient(circle at center, #1a1a1a 35%, #111111 100%);
}

/* =====================
   WAVY SVG BACKGROUND
   ===================== */

.bg-waves {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.bg-waves svg {
  width: 100%;
  height: 100%;
  position: absolute;
  inset: 0;
}

/* =====================
   LAYOUT
   ===================== */

.page-wrapper {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* =====================
   NAVBAR
   ===================== */

.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 48px;
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(240,240,240,0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  transition: background var(--transition), border-color var(--transition);
}

body.dark-mode .navbar {
  background: rgba(18,18,18,0.85);
}

.navbar-logo img {
  height: 32px;
  width: auto;
}

.navbar-links {
  display: flex;
  align-items: center;
  gap: 36px;
  list-style: none;
}

.navbar-links a {
  text-decoration: none;
  color: var(--black);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.01em;
  transition: color var(--transition);
  position: relative;
}

.navbar-links a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 1.5px;
  background: var(--gold);
  transition: width var(--transition);
}

.navbar-links a:hover::after { width: 100%; }
.navbar-links a:hover { color: var(--black); }

.navbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

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

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 8px;
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  border: none;
  text-decoration: none;
  letter-spacing: -0.01em;
}

.btn-arrow::after {
  content: '↗';
  font-size: 14px;
  transition: transform var(--transition);
}

.btn:hover .btn-arrow::after,
.btn-arrow:hover::after {
  transform: translate(2px, -2px);
}

/* Primary black button */
.btn-primary {
  background: var(--black);
  color: var(--white);
}

.btn-primary:hover {
  background: #222;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.18);
}

/* Outlined button */
.btn-outline {
  background: transparent;
  color: var(--black);
  border: 1.5px solid var(--black);
}

.btn-outline:hover {
  background: var(--black);
  color: var(--white);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.12);
}

/* Ghost / link */
.btn-ghost {
  background: transparent;
  color: var(--black);
  padding: 12px 16px;
}
.btn-ghost:hover {
  background: rgba(0,0,0,0.06);
}

/* Full width */
.btn-full { width: 100%; justify-content: center; }

/* =====================
   HERO SECTION
   ===================== */

.hero {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 80px 24px 60px;
}

.hero-eyebrow {
  font-family: 'DM Mono', monospace, Courier, sans-serif;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--grey-text);
  margin-bottom: 24px;
  animation: fadeUp 0.7s ease both;
}

.hero-title {
  font-size: clamp(80px, 12vw, 160px);
  font-weight: 900;
  letter-spacing: -0.04em;
  line-height: 1;
  color: var(--black);
  margin-bottom: 12px;
  animation: fadeUp 0.7s 0.05s ease both;
}

.hero-divider {
  width: 60px;
  height: 3px;
  background: var(--gold);
  margin: 0 auto 28px;
  border-radius: 99px;
  animation: fadeUp 0.7s 0.1s ease both;
}

.hero-tagline {
  font-size: clamp(22px, 3vw, 32px);
  font-weight: 700;
  color: var(--black);
  line-height: 1.3;
  margin-bottom: 16px;
  animation: fadeUp 0.7s 0.15s ease both;
}

.hero-tagline em {
  font-style: italic;
  font-weight: 600;
}

.hero-subtitle {
  font-size: clamp(14px, 1.5vw, 16px);
  color: var(--grey-text);
  max-width: 760px;
  line-height: 1.6;
  margin-bottom: 40px;
  animation: fadeUp 0.7s 0.2s ease both;
}

.hero-cta {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
  animation: fadeUp 0.7s 0.25s ease both;
}

.hero-cta .btn {
  padding: 14px 28px;
  font-size: 16px;
}

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

.features {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid rgba(0,0,0,0.08);
  animation: fadeUp 0.8s 0.3s ease both;
  background: transparent;
}

.feature-card {
  background: transparent;
  padding: 48px 32px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  border-right: 1px solid rgba(0,0,0,0.08);
  transition: background var(--transition);
  cursor: default;
}

.feature-card:last-child {
  border-right: none;
}

.feature-card:hover {
  background: rgba(255, 255, 255, 0.35);
}

.feature-icon {
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 4px;
}

.feature-icon svg {
  width: 44px;
  height: 44px;
  stroke: var(--black);
  fill: none;
  stroke-width: 1.5;
}

.feature-icon svg circle[fill="currentColor"],
.feature-icon svg rect[fill="currentColor"],
.feature-icon svg path[fill="currentColor"],
.feature-icon svg line[fill="currentColor"] {
  fill: var(--black) !important;
}

.feature-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--black);
  letter-spacing: -0.01em;
}

.feature-desc {
  font-size: 13px;
  color: var(--grey-text);
  line-height: 1.55;
  max-width: 200px;
}

/* =====================
   AUTH PAGES
   ===================== */

.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  position: relative;
  z-index: 1;
}

.auth-card {
  background: rgba(255,255,255,0.72);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.6);
  border-radius: 20px;
  box-shadow: var(--shadow), 0 0 0 1px rgba(0,0,0,0.04);
  padding: 48px 44px;
  width: 100%;
  max-width: 440px;
  animation: scaleIn 0.4s ease both;
}

.auth-logo {
  display: flex;
  justify-content: center;
  margin-bottom: 32px;
}

.auth-logo img {
  height: 36px;
  width: auto;
}

.auth-title {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.03em;
  text-align: center;
  margin-bottom: 6px;
}

.auth-subtitle {
  font-size: 14px;
  color: var(--grey-text);
  text-align: center;
  margin-bottom: 32px;
}

/* Form styles */
.form-group {
  margin-bottom: 18px;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--black);
  margin-bottom: 8px;
  letter-spacing: -0.01em;
}

.form-input {
  width: 100%;
  padding: 12px 16px;
  border: 1.5px solid rgba(0,0,0,0.12);
  border-radius: 9px;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  color: var(--black);
  background: rgba(255,255,255,0.8);
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}

.form-input:focus {
  border-color: var(--black);
  box-shadow: 0 0 0 3px rgba(0,0,0,0.07);
}

.form-input::placeholder { color: #aaa; }

.form-input.error { border-color: #e53e3e; }
.input-error-msg {
  font-size: 12px;
  color: #e53e3e;
  margin-top: 5px;
  display: none;
}

.form-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 24px 0;
}
.form-divider::before, .form-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}
.form-divider span {
  font-size: 12px;
  color: var(--light-grey);
  font-weight: 500;
}

.auth-footer {
  text-align: center;
  margin-top: 24px;
  font-size: 13px;
  color: var(--grey-text);
}

.auth-footer a {
  color: var(--black);
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px solid var(--black);
}

.auth-footer a:hover { opacity: 0.7; }

/* Alert messages */
.alert {
  padding: 12px 16px;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 20px;
  display: none;
}

.alert-error {
  background: #fff5f5;
  border: 1px solid #fed7d7;
  color: #c53030;
}

.alert-success {
  background: #f0fff4;
  border: 1px solid #c6f6d5;
  color: #276749;
}

/* =====================
   DASHBOARD
   ===================== */

.dashboard {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.dashboard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 48px;
  background: rgba(240,240,240,0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.dashboard-body {
  flex: 1;
  padding: 60px 48px;
  position: relative;
  z-index: 1;
}

.welcome-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(0,0,0,0.06);
  border-radius: 99px;
  padding: 6px 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--grey-text);
  margin-bottom: 24px;
}

.welcome-badge::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #48bb78;
}

.dashboard-title {
  font-size: clamp(32px, 4vw, 52px);
  font-weight: 900;
  letter-spacing: -0.04em;
  line-height: 1.1;
  margin-bottom: 16px;
}

.dashboard-subtitle {
  font-size: 16px;
  color: var(--grey-text);
  max-width: 500px;
  line-height: 1.6;
  margin-bottom: 48px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
  max-width: 1000px;
}

.dash-card {
  background: rgba(255,255,255,0.65);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.7);
  border-radius: 16px;
  padding: 28px;
  box-shadow: var(--shadow);
  transition: transform var(--transition), box-shadow var(--transition);
}

.dash-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.1);
}

.dash-card-icon {
  width: 48px;
  height: 48px;
  background: var(--black);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}

.dash-card-icon svg {
  width: 24px;
  height: 24px;
  stroke: white;
  fill: none;
  stroke-width: 1.8;
}

.dash-card-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--light-grey);
  margin-bottom: 6px;
}

.dash-card-value {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--black);
  margin-bottom: 4px;
}

.dash-card-change {
  font-size: 12px;
  color: #48bb78;
  font-weight: 600;
}

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

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  background: transparent;
  cursor: pointer;
  color: var(--black);
  transition: all var(--transition);
  padding: 0;
  flex-shrink: 0;
}

.theme-toggle:hover {
  background: rgba(0,0,0,0.06);
  transform: rotate(15deg);
}

body.dark-mode .theme-toggle:hover {
  background: rgba(255,255,255,0.08);
}

.theme-toggle svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: opacity var(--transition), transform var(--transition);
  pointer-events: none; /* always fire click on the <button> */
}

/* Moon is a filled shape, not a stroked shape */
.icon-moon path {
  fill: currentColor;
  stroke: none;
}

/* Show moon in light mode, sun in dark mode */
.icon-moon { display: block; }
.icon-sun  { display: none; }

body.dark-mode .icon-moon { display: none; }
body.dark-mode .icon-sun  { display: block; }

/* =====================
   HAMBURGER (MOBILE)
   ===================== */

.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 4px;
}

.hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--black);
  border-radius: 2px;
  transition: all var(--transition);
}

/* =====================
   DARK MODE — AUTH CARD
   ===================== */

body.dark-mode .auth-card {
  background: rgba(28,28,28,0.88);
  border-color: rgba(255,255,255,0.08);
}

body.dark-mode .form-input {
  background: rgba(255,255,255,0.07);
  border-color: rgba(255,255,255,0.14);
  color: var(--black);
}

body.dark-mode .form-input:focus {
  border-color: rgba(255,255,255,0.4);
  box-shadow: 0 0 0 3px rgba(255,255,255,0.06);
}

body.dark-mode .form-input::placeholder { color: #555; }

body.dark-mode .alert-error {
  background: rgba(197,48,48,0.15);
  border-color: rgba(197,48,48,0.3);
  color: #fc8181;
}

body.dark-mode .alert-success {
  background: rgba(39,103,73,0.15);
  border-color: rgba(39,103,73,0.3);
  color: #68d391;
}

/* =====================
   DARK MODE — FEATURE CARDS
   ===================== */

body.dark-mode .features {
  border-top-color: rgba(255,255,255,0.08);
}

body.dark-mode .feature-card {
  border-right-color: rgba(255,255,255,0.08);
}

body.dark-mode .feature-card:hover {
  background: rgba(255,255,255,0.04);
}

/* =====================
   DARK MODE — DASHBOARD
   ===================== */

body.dark-mode .dashboard-header {
  background: rgba(18,18,18,0.9);
}

body.dark-mode .dash-card {
  background: rgba(30,30,30,0.8);
  border-color: rgba(255,255,255,0.08);
}

body.dark-mode .welcome-badge {
  background: rgba(255,255,255,0.07);
}

/* =====================
   DARK MODE — BUTTONS
   ===================== */

body.dark-mode .btn-primary {
  background: #f0f0f0;
  color: #111;
}

body.dark-mode .btn-primary:hover {
  background: #ffffff;
  box-shadow: 0 6px 20px rgba(255,255,255,0.18);
}

body.dark-mode .btn-outline {
  color: var(--black);
  border-color: rgba(240,240,240,0.6);
}

body.dark-mode .btn-outline:hover {
  background: rgba(240,240,240,0.1);
  color: var(--black);
}

body.dark-mode .btn-ghost {
  color: var(--black);
}

body.dark-mode .btn-ghost:hover {
  background: rgba(255,255,255,0.07);
}

/* =====================
   DARK MODE — NAVBAR MOBILE
   ===================== */

@media (max-width: 900px) {
  body.dark-mode .navbar-links {
    background: rgba(18,18,18,0.97);
  }
}

/* =====================
   TOAST NOTIFICATION
   ===================== */

.toast {
  position: fixed;
  bottom: 32px;
  right: 32px;
  background: var(--black);
  color: var(--white);
  padding: 14px 20px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  z-index: 9999;
  opacity: 0;
  transform: translateY(12px);
  transition: all var(--transition);
  pointer-events: none;
  max-width: 320px;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

/* =====================
   ANIMATIONS
   ===================== */

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.95); }
  to   { opacity: 1; transform: scale(1); }
}

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

@media (max-width: 900px) {
  .features {
    grid-template-columns: repeat(2, 1fr);
  }

  .navbar-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(240,240,240,0.97);
    flex-direction: column;
    padding: 20px 48px;
    gap: 20px;
    border-bottom: 1px solid var(--border);
  }

  .navbar-links.open { display: flex; }

  .hamburger { display: flex; }

  .dashboard-body { padding: 40px 24px; }
  .dashboard-header { padding: 16px 24px; }
}

@media (max-width: 600px) {
  .navbar { padding: 18px 20px; }
  .hero { padding: 60px 16px 40px; }
  .hero-cta .btn { width: 100%; max-width: 280px; justify-content: center; }
  .features { grid-template-columns: 1fr 1fr; }
  .auth-card { padding: 36px 24px; }
}

@media (max-width: 400px) {
  .features { grid-template-columns: 1fr; }
}

/* =============================================
   AGENT CHAT HUB — STYLING
   ============================================= */

/* Tab Navigation for Dashboard Views */
.dashboard-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 32px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 12px;
}

.tab-btn {
  background: none;
  border: none;
  outline: none;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  color: var(--grey-text);
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  gap: 8px;
}

.tab-btn:hover {
  color: var(--black);
  background: rgba(0,0,0,0.04);
}

.tab-btn.active {
  color: var(--white);
  background: var(--black);
}

body.dark-mode .tab-btn:hover {
  background: rgba(255,255,255,0.06);
}

body.dark-mode .tab-btn.active {
  background: #f0f0f0;
  color: #111;
}

/* Dashboard Views Control */
.db-view {
  display: none;
}

.db-view.active {
  display: block;
  animation: fadeIn 0.35s ease-in-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Chat Container */
.chat-hub-container {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 24px;
  height: 800px;
  max-width: 100%;
  background: rgba(255, 255, 255, 0.65);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 20px;
  box-shadow: var(--shadow);
  overflow: hidden;
  margin-top: 10px;
}

body.dark-mode .chat-hub-container {
  background: rgba(30,30,30,0.8);
  border-color: rgba(255,255,255,0.08);
}

/* Sidebar styling */
.chat-sidebar {
  border-right: 1px solid var(--border);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  background: rgba(0, 0, 0, 0.015);
}

body.dark-mode .chat-sidebar {
  background: rgba(255, 255, 255, 0.01);
}

.sidebar-title {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--grey-text);
  margin-bottom: -4px;
}

/* Dropdown styling */
.agent-select-wrapper {
  position: relative;
}

.agent-select {
  width: 100%;
  padding: 14px 16px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 500;
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  color: var(--black);
  cursor: pointer;
  outline: none;
  appearance: none;
  transition: border-color var(--transition);
  box-shadow: 0 2px 8px rgba(0,0,0,0.02);
}

.agent-select:focus {
  border-color: var(--black);
}

body.dark-mode .agent-select:focus {
  border-color: #f0f0f0;
}

.agent-select-wrapper::after {
  content: '▼';
  font-size: 10px;
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  color: var(--grey-text);
}

/* Agent Info Card */
.agent-info-card {
  flex: 1;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.01);
}

body.dark-mode .agent-info-card {
  background: rgba(40,40,40,0.5);
}

.agent-badge-header {
  display: flex;
  align-items: center;
  gap: 10px;
}

.agent-avatar {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: var(--black);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 16px;
}

body.dark-mode .agent-avatar {
  background: #f0f0f0;
  color: #111;
}

.agent-meta-text {
  display: flex;
  flex-direction: column;
}

.agent-meta-name {
  font-size: 15px;
  font-weight: 700;
}

.agent-meta-role {
  font-size: 11px;
  color: var(--grey-text);
  text-transform: uppercase;
  font-weight: 600;
}

.agent-desc {
  font-size: 13.5px;
  color: var(--grey-text);
  line-height: 1.5;
}

.agent-files-list {
  margin-top: 8px;
}

.agent-files-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--grey-text);
  text-transform: uppercase;
  margin-bottom: 6px;
}

.agent-file-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(0,0,0,0.04);
  color: var(--grey-text);
  font-size: 11.5px;
  padding: 4px 10px;
  border-radius: 6px;
  margin-right: 6px;
  margin-bottom: 6px;
  font-family: monospace;
}

body.dark-mode .agent-file-tag {
  background: rgba(255,255,255,0.05);
}

/* Chat Main window styling */
.chat-main {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.chat-header {
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(0, 0, 0, 0.005);
}

.chat-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.chat-status-dot {
  width: 8px;
  height: 8px;
  background: #48bb78;
  border-radius: 50%;
  animation: pulseGreen 2s infinite;
}

@keyframes pulseGreen {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(72, 187, 120, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 5px rgba(72, 187, 120, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(72, 187, 120, 0); }
}

.chat-header-title {
  font-size: 16px;
  font-weight: 700;
}

.chat-header-subtitle {
  font-size: 12px;
  color: var(--grey-text);
}

/* Messages area */
.chat-messages-container {
  flex: 1;
  padding: 24px;
  overflow-y: auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: rgba(0, 0, 0, 0.005);
}

.chat-message-row {
  display: flex;
  width: 100%;
}

.chat-message-row.user {
  justify-content: flex-end;
}

.chat-message-row.agent {
  justify-content: flex-start;
}

.chat-bubble {
  max-width: 75%;
  padding: 14px 18px;
  border-radius: 16px;
  font-size: 14.5px;
  line-height: 1.6;
  position: relative;
  word-wrap: break-word;
  white-space: pre-wrap;
  box-shadow: 0 2px 10px rgba(0,0,0,0.015);
}

.chat-bubble.user {
  background: var(--black);
  color: var(--white);
  border-bottom-right-radius: 4px;
}

body.dark-mode .chat-bubble.user {
  background: #f0f0f0;
  color: #111;
}

.chat-bubble.agent {
  background: var(--white);
  border: 1px solid var(--border);
  color: var(--black);
  border-bottom-left-radius: 4px;
}

body.dark-mode .chat-bubble.agent {
  background: rgba(50,50,50,0.3);
}

.chat-bubble code {
  font-family: monospace;
  background: rgba(0,0,0,0.06);
  padding: 2px 6px;
  border-radius: 4px;
}

body.dark-mode .chat-bubble code {
  background: rgba(255,255,255,0.08);
}

.chat-bubble pre {
  margin-top: 8px;
  margin-bottom: 8px;
  background: rgba(0,0,0,0.04);
  padding: 12px;
  border-radius: 8px;
  overflow-x: auto;
}

body.dark-mode .chat-bubble pre {
  background: rgba(0,0,0,0.3);
}

.chat-bubble pre code {
  background: none;
  padding: 0;
}

/* Typing indicator */
.typing-indicator-row {
  display: none;
  justify-content: flex-start;
  width: 100%;
}

.typing-indicator {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 12px 18px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 16px;
  border-bottom-left-radius: 4px;
}

body.dark-mode .typing-indicator {
  background: rgba(50,50,50,0.3);
}

.typing-dot {
  width: 6px;
  height: 6px;
  background: var(--grey-text);
  border-radius: 50%;
  animation: bounceDot 1.4s infinite ease-in-out both;
}

.typing-dot:nth-child(1) { animation-delay: -0.32s; }
.typing-dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes bounceDot {
  0%, 80%, 100% { transform: scale(0); }
  40% { transform: scale(1); }
}

/* Chat Input Bar */
.chat-input-bar {
  padding: 20px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 12px;
  align-items: center;
  background: rgba(0, 0, 0, 0.005);
}

.chat-input-wrapper {
  flex: 1;
  position: relative;
}

.chat-textarea {
  width: 100%;
  height: 48px;
  padding: 13px 20px;
  padding-right: 48px;
  font-family: inherit;
  font-size: 14.5px;
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: 24px;
  color: var(--black);
  outline: none;
  resize: none;
  box-shadow: inset 0 1px 4px rgba(0,0,0,0.01);
  transition: border-color var(--transition);
  line-height: 20px;
  overflow-y: auto;
}

.chat-textarea:focus {
  border-color: var(--black);
}

body.dark-mode .chat-textarea {
  background: rgba(20,20,20,0.4);
}

body.dark-mode .chat-textarea:focus {
  border-color: #f0f0f0;
}

.chat-send-btn {
  background: var(--black);
  border: none;
  outline: none;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition);
}

.chat-send-btn:hover {
  transform: scale(1.05);
}

.chat-send-btn svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: var(--white);
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  margin-left: 2px;
}

body.dark-mode .chat-send-btn {
  background: #f0f0f0;
}

body.dark-mode .chat-send-btn svg {
  stroke: #111;
}

.chat-send-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none !important;
}

/* Responsive styles for chat hub */
@media (max-width: 850px) {
  .chat-hub-container {
    grid-template-columns: 1fr;
    height: 750px;
  }
  .chat-sidebar {
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: 16px;
    height: auto;
  }
  .agent-info-card {
    display: none; /* Hide description card on small screens to save space */
  }
  .chat-messages-container {
    height: 380px;
  }
}

/* ===========================
   SESSION HISTORY SIDEBAR
   =========================== */

/* Override sidebar layout to accommodate session list */
.chat-sidebar {
  overflow: hidden;
  padding: 0 !important;
}

.sidebar-inner {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

/* Top controls: agent/model selectors + agent info */
.sidebar-controls {
  padding: 20px 20px 0 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  flex-shrink: 0;
}

/* New Chat button */
.new-chat-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 11px 16px;
  background: var(--black);
  color: var(--white);
  border: none;
  border-radius: 10px;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  margin-top: 4px;
  flex-shrink: 0;
}

.new-chat-btn:hover {
  opacity: 0.82;
  transform: translateY(-1px);
}

body.dark-mode .new-chat-btn {
  background: #f0f0f0;
  color: #111;
}

/* Session history section */
.session-history-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  border-top: 1px solid var(--border);
  margin-top: 4px;
}

.session-history-header {
  padding: 12px 20px 8px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--grey-text);
  flex-shrink: 0;
}

.session-list {
  flex: 1;
  overflow-y: auto;
  padding: 0 8px 12px 8px;
  min-height: 0;
}

.session-list::-webkit-scrollbar {
  width: 4px;
}
.session-list::-webkit-scrollbar-track {
  background: transparent;
}
.session-list::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

/* Agent group header in session list */
.session-agent-group {
  margin-bottom: 6px;
}

.session-agent-label {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--light-grey);
  user-select: none;
}

.session-agent-label .agent-num-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 5px;
  background: var(--black);
  color: var(--white);
  font-size: 10px;
  font-weight: 800;
  flex-shrink: 0;
}

body.dark-mode .session-agent-label .agent-num-badge {
  background: #f0f0f0;
  color: #111;
}

/* Individual session item */
.session-item {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 9px 12px;
  border-radius: 10px;
  cursor: pointer;
  position: relative;
  transition: background var(--transition);
  margin-bottom: 2px;
  group: true;
}

.session-item:hover {
  background: rgba(0,0,0,0.05);
}

body.dark-mode .session-item:hover {
  background: rgba(255,255,255,0.06);
}

.session-item.active {
  background: rgba(0,0,0,0.08);
}

body.dark-mode .session-item.active {
  background: rgba(255,255,255,0.1);
}

.session-item-title {
  flex: 1;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--black);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.4;
}

.session-item-time {
  font-size: 11px;
  color: var(--light-grey);
  white-space: nowrap;
  margin-left: 6px;
  flex-shrink: 0;
}

/* Action buttons (rename/delete) shown on hover */
.session-item-actions {
  display: none;
  align-items: center;
  gap: 2px;
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: inherit;
}

.session-item:hover .session-item-actions {
  display: flex;
}

.session-item:hover .session-item-time {
  display: none;
}

.session-action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border: none;
  background: transparent;
  border-radius: 6px;
  cursor: pointer;
  color: var(--grey-text);
  transition: all 0.15s;
  padding: 0;
}

.session-action-btn:hover {
  background: rgba(0,0,0,0.08);
  color: var(--black);
}

body.dark-mode .session-action-btn:hover {
  background: rgba(255,255,255,0.1);
  color: #f0f0f0;
}

.session-action-btn.delete-btn:hover {
  color: #e53e3e;
  background: rgba(229,62,62,0.08);
}

.session-action-btn svg {
  width: 13px;
  height: 13px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Empty session state */
.session-empty-state {
  text-align: center;
  padding: 24px 16px;
  color: var(--light-grey);
  font-size: 13px;
  line-height: 1.6;
}

.session-empty-state svg {
  width: 32px;
  height: 32px;
  stroke: var(--light-grey);
  fill: none;
  stroke-width: 1.5;
  margin-bottom: 10px;
  display: block;
  margin-left: auto;
  margin-right: auto;
}

/* Inline rename input */
.session-rename-input {
  flex: 1;
  background: transparent;
  border: none;
  border-bottom: 1.5px solid var(--gold);
  outline: none;
  font-family: 'Inter', sans-serif;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--black);
  padding: 2px 0;
  width: 100%;
}

body.dark-mode .session-rename-input {
  color: #f0f0f0;
}

/* Loading spinner for session list */
.session-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  color: var(--grey-text);
  font-size: 13px;
  gap: 8px;
}

.spinner-sm {
  width: 14px;
  height: 14px;
  border: 2px solid var(--border);
  border-top-color: var(--black);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
}

body.dark-mode .spinner-sm {
  border-top-color: #f0f0f0;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ── Download MD Button ───────────────────────────────────────────────────── */
.download-md-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  color: var(--grey-text);
  background: transparent;
  border: 1.5px solid var(--border);
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  flex-shrink: 0;
}

.download-md-btn:hover {
  color: var(--black);
  border-color: var(--gold);
  background: rgba(200, 169, 110, 0.08);
  box-shadow: 0 0 0 3px rgba(200, 169, 110, 0.12);
}

.download-md-btn svg {
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.download-md-btn:hover svg {
  transform: translateY(2px);
}

body.dark-mode .download-md-btn {
  color: var(--grey-text);
  border-color: var(--border);
}

body.dark-mode .download-md-btn:hover {
  color: var(--black);
  border-color: var(--gold);
  background: rgba(200, 169, 110, 0.1);
}

/* ── Plus Button & Attachment Styles ────────────────────────────────────────── */
.chat-attach-btn {
  background: transparent;
  border: 1.5px solid var(--border);
  outline: none;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition);
  color: var(--grey-text);
  flex-shrink: 0;
}
.chat-attach-btn:hover {
  border-color: var(--black);
  color: var(--black);
  background: rgba(0, 0, 0, 0.02);
}
body.dark-mode .chat-attach-btn:hover {
  border-color: #f0f0f0;
  color: #f0f0f0;
  background: rgba(255, 255, 255, 0.05);
}
.chat-attach-btn svg {
  width: 18px;
  height: 18px;
}
.chat-attach-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none !important;
}

.chat-input-wrapper {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.attachment-preview-container {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 4px 8px;
}
.attachment-preview-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(0, 0, 0, 0.05);
  border: 1px solid var(--border);
  padding: 6px 12px;
  border-radius: 16px;
  font-size: 13px;
  color: var(--black);
  max-width: 250px;
}
body.dark-mode .attachment-preview-badge {
  background: rgba(255, 255, 255, 0.08);
  color: #f0f0f0;
  border-color: rgba(255, 255, 255, 0.1);
}
.attachment-preview-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 500;
}
.attachment-preview-remove {
  background: none;
  border: none;
  color: var(--grey-text);
  cursor: pointer;
  font-size: 16px;
  font-weight: bold;
  padding: 0 4px;
  line-height: 1;
  display: flex;
  align-items: center;
}
.attachment-preview-remove:hover {
  color: #e53e3e;
}

.chat-attachment-file {
  margin: 4px 0;
}
.attachment-file-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 10px;
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  max-width: 100%;
  transition: all var(--transition);
}
.chat-bubble.user .attachment-file-link {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--white);
}
.chat-bubble.user .attachment-file-link:hover {
  background: rgba(255, 255, 255, 0.2);
}
body.dark-mode .chat-bubble.user .attachment-file-link {
  background: rgba(0, 0, 0, 0.06);
  border: 1px solid rgba(0, 0, 0, 0.05);
  color: #111;
}
body.dark-mode .chat-bubble.user .attachment-file-link:hover {
  background: rgba(0, 0, 0, 0.1);
}
.chat-bubble.agent .attachment-file-link {
  background: rgba(0, 0, 0, 0.05);
  border: 1px solid rgba(0, 0, 0, 0.05);
  color: var(--black);
}
.chat-bubble.agent .attachment-file-link:hover {
  background: rgba(0, 0, 0, 0.08);
}
body.dark-mode .chat-bubble.agent .attachment-file-link {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.05);
  color: #f0f0f0;
}
body.dark-mode .chat-bubble.agent .attachment-file-link:hover {
  background: rgba(255, 255, 255, 0.1);
}
.attachment-file-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
}
.attachment-file-download {
  font-weight: bold;
  opacity: 0.8;
}

.chat-bubble-text-gap {
  height: 10px;
}

.chat-attachment-media {
  max-width: 240px;
  margin: 4px 0;
}
.chat-attachment-img {
  max-width: 100%;
  max-height: 160px;
  border-radius: 8px;
  display: block;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  border: 1px solid rgba(0,0,0,0.08);
}
.chat-bubble.user .chat-attachment-img {
  border: 1px solid rgba(255,255,255,0.15);
}
.attachment-media-name {
  font-size: 11px;
  opacity: 0.7;
  margin-top: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: left;
}
