/* ===== DASHBOARD STYLES ===== */
/* Inherits variables from styles.css */

/* ===== LAYOUT ===== */
.dash-wrapper {
  display: flex;
  min-height: 100vh;
  background: var(--bg);
}

/* ===== SIDEBAR ===== */
.dash-sidebar {
  width: 240px;
  min-height: 100vh;
  background: var(--bg-alt);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 50;
  transition: transform 0.3s ease;
}

.sidebar-header {
  padding: 24px 20px;
  border-bottom: 1px solid var(--border);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.sidebar-logo .logo-icon {
  width: 28px;
  height: 28px;
  background: var(--gradient);
  border-radius: 6px;
  position: relative;
  flex-shrink: 0;
}

.sidebar-logo .logo-icon::after {
  content: '';
  position: absolute;
  inset: 5px;
  background: var(--bg-alt);
  border-radius: 3px;
}

.sidebar-logo .logo-text {
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--text-bright);
}

.sidebar-nav {
  flex: 1;
  padding: 16px 0;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 20px;
  color: var(--text-dim);
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.2s;
  border-left: 3px solid transparent;
  text-decoration: none;
}

.sidebar-nav a:hover {
  color: var(--text-bright);
  background: rgba(255,255,255,0.03);
}

.sidebar-nav a.active {
  color: var(--text-bright);
  background: rgba(99,102,241,0.08);
  border-left-color: var(--accent-1);
}

.sidebar-nav a svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  opacity: 0.7;
}

.sidebar-nav a.active svg,
.sidebar-nav a:hover svg {
  opacity: 1;
}

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
}

.sidebar-org {
  font-size: 0.78rem;
  color: var(--text-dim);
  margin-bottom: 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-logout {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--text-dim);
  cursor: pointer;
  background: none;
  border: none;
  font-family: inherit;
  padding: 0;
  transition: color 0.2s;
}

.sidebar-logout:hover {
  color: var(--danger);
}

/* Mobile menu toggle */
.sidebar-toggle {
  display: none;
  position: fixed;
  top: 16px;
  left: 16px;
  z-index: 60;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
}

/* ===== MAIN CONTENT ===== */
.dash-main {
  flex: 1;
  margin-left: 240px;
  padding: 32px;
  min-height: 100vh;
}

.dash-main-inner {
  max-width: 1100px;
  margin: 0 auto;
}

/* ===== PAGE HEADER ===== */
.page-header {
  margin-bottom: 32px;
}

.page-header h1 {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text-bright);
  margin-bottom: 4px;
}

.page-header p {
  color: var(--text-dim);
  font-size: 0.9rem;
}

/* ===== STAT CARDS ROW ===== */
.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 32px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  transition: all 0.3s;
}

.stat-card:hover {
  border-color: rgba(99,102,241,0.2);
}

.stat-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 8px;
}

.stat-value {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--text-bright);
  line-height: 1;
}

.stat-sub {
  font-size: 0.78rem;
  color: var(--text-dim);
  margin-top: 6px;
}

.stat-value.score-green { color: var(--success); }
.stat-value.score-yellow { color: var(--warn); }
.stat-value.score-red { color: var(--danger); }

/* ===== TREND ARROWS ===== */
.trend-up { color: var(--success); }
.trend-down { color: var(--danger); }
.trend-steady { color: var(--text-dim); }

.trend-arrow {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.78rem;
  font-weight: 600;
}

/* ===== DATA TABLE ===== */
.dash-table-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.dash-table-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.dash-table-header h3 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-bright);
}

.dash-table {
  width: 100%;
  border-collapse: collapse;
}

.dash-table th {
  text-align: left;
  padding: 12px 16px;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-bottom: 1px solid var(--border);
  background: rgba(255,255,255,0.02);
}

.dash-table td {
  padding: 12px 16px;
  font-size: 0.875rem;
  color: var(--text);
  border-bottom: 1px solid var(--border);
}

.dash-table tr:last-child td {
  border-bottom: none;
}

.dash-table tr:hover td {
  background: rgba(255,255,255,0.02);
}

.dash-table tr.clickable {
  cursor: pointer;
}

.dash-table tr.clickable:hover td {
  background: rgba(99,102,241,0.05);
}

/* ===== SCORE BADGE ===== */
.score-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  padding: 3px 10px;
  border-radius: 100px;
  font-weight: 700;
  font-size: 0.8rem;
}

.score-badge.green {
  background: rgba(16,185,129,0.15);
  color: var(--success);
}

.score-badge.yellow {
  background: rgba(245,158,11,0.15);
  color: var(--warn);
}

.score-badge.red {
  background: rgba(239,68,68,0.15);
  color: var(--danger);
}

/* ===== GAUGE (dashboard version) ===== */
.dash-gauge {
  position: relative;
  width: 180px;
  height: 180px;
  margin: 0 auto;
}

.dash-gauge svg {
  width: 100%;
  height: 100%;
}

.dash-gauge .gauge-value {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.dash-gauge .gauge-num {
  font-size: 2.6rem;
  font-weight: 800;
  color: var(--text-bright);
  line-height: 1;
}

.dash-gauge .gauge-label {
  font-size: 0.7rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-top: 4px;
}

.dash-gauge-sm {
  width: 120px;
  height: 120px;
}

.dash-gauge-sm .gauge-num {
  font-size: 1.8rem;
}

.dash-gauge-lg {
  width: 220px;
  height: 220px;
}

.dash-gauge-lg .gauge-num {
  font-size: 3.2rem;
}

/* ===== CARDS GRID ===== */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.rep-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  cursor: pointer;
  transition: all 0.3s;
}

.rep-card:hover {
  border-color: rgba(99,102,241,0.3);
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
}

.rep-card-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}

.rep-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1rem;
  color: #fff;
  flex-shrink: 0;
}

.rep-card-header h4 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-bright);
}

.rep-card-header .rep-calls {
  font-size: 0.78rem;
  color: var(--text-dim);
}

.rep-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.rep-stat-label {
  font-size: 0.7rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.rep-stat-value {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-bright);
}

/* ===== DETAIL SECTION ===== */
.detail-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 20px;
}

.detail-section h3 {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 16px;
}

/* ===== CONVERSATION FLOW TIMELINE ===== */
.flow-timeline {
  display: flex;
  gap: 0;
  margin-top: 12px;
}

.flow-phase {
  flex: 1;
  text-align: center;
  position: relative;
}

.flow-phase-name {
  font-size: 0.72rem;
  color: var(--text-dim);
  margin-bottom: 8px;
  text-transform: capitalize;
}

.flow-phase-bar {
  height: 32px;
  border-radius: 4px;
  margin: 0 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: #fff;
  transition: all 0.5s ease;
}

.flow-phase-detail {
  font-size: 0.7rem;
  color: var(--text-dim);
  margin-top: 6px;
}

/* ===== TALK RATIO BAR ===== */
.talk-ratio-bar {
  display: flex;
  height: 36px;
  border-radius: 8px;
  overflow: hidden;
  margin: 12px 0;
}

.talk-ratio-rep {
  background: var(--accent-1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  font-weight: 700;
  color: #fff;
  transition: width 1s ease;
}

.talk-ratio-prospect {
  background: var(--accent-2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  font-weight: 700;
  color: #000;
  transition: width 1s ease;
}

.talk-ratio-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--text-dim);
  margin-top: 4px;
}

/* ===== RISK BOARD (KANBAN) ===== */
.kanban-board {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  align-items: start;
}

.kanban-column {
  background: rgba(255,255,255,0.02);
  border-radius: var(--radius);
  padding: 16px;
  min-height: 200px;
}

.kanban-column-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.kanban-column-header h3 {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0;
}

.kanban-count {
  font-size: 0.72rem;
  background: rgba(255,255,255,0.08);
  padding: 2px 8px;
  border-radius: 100px;
  color: var(--text-dim);
  font-weight: 600;
}

.kanban-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: all 0.2s;
  border-left: 3px solid transparent;
}

.kanban-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
}

.kanban-card.risk-high {
  border-left-color: var(--danger);
}

.kanban-card.risk-medium {
  border-left-color: var(--warn);
}

.kanban-card.risk-low {
  border-left-color: var(--success);
}

.kanban-card-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-bright);
  margin-bottom: 6px;
}

.kanban-card-meta {
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-bottom: 4px;
}

.kanban-card-factor {
  font-size: 0.78rem;
  color: var(--text-dim);
  font-style: italic;
  margin-top: 6px;
}

/* ===== LOGIN OVERLAY ===== */
.login-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
}

.login-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 48px 40px;
  max-width: 420px;
  width: 100%;
  text-align: center;
}

.login-card .logo-icon {
  width: 48px;
  height: 48px;
  background: var(--gradient);
  border-radius: 10px;
  position: relative;
  margin: 0 auto 16px;
}

.login-card .logo-icon::after {
  content: '';
  position: absolute;
  inset: 8px;
  background: var(--surface);
  border-radius: 4px;
}

.login-card h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-bright);
  margin-bottom: 8px;
}

.login-card p {
  color: var(--text-dim);
  font-size: 0.9rem;
  margin-bottom: 28px;
}

.login-input {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 16px;
  color: var(--text);
  font-family: 'Inter', monospace;
  font-size: 0.875rem;
  margin-bottom: 16px;
  transition: border-color 0.2s;
}

.login-input:focus {
  outline: none;
  border-color: var(--accent-1);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.15);
}

.login-input::placeholder {
  color: rgba(148,163,184,0.4);
}

.login-error {
  color: var(--danger);
  font-size: 0.82rem;
  margin-bottom: 12px;
  display: none;
}

.google-login-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.65rem 1.4rem;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 10px;
  background: rgba(255,255,255,0.05);
  color: var(--text);
  font-size: 0.88rem;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.2s;
}
.google-login-btn:hover {
  background: rgba(255,255,255,0.1);
  border-color: rgba(255,255,255,0.2);
}

/* ===== UPLOAD ZONE ===== */
.upload-zone {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 0;
  margin-bottom: 24px;
  overflow: hidden;
}

.upload-zone-inner {
  padding: 28px 24px;
  text-align: center;
  cursor: pointer;
  border: 2px dashed transparent;
  border-radius: var(--radius-lg);
  transition: all 0.2s;
}
.upload-zone-inner:hover {
  background: rgba(99,102,241,0.04);
  border-color: rgba(99,102,241,0.2);
}
.upload-zone-inner.drag-over {
  background: rgba(99,102,241,0.08);
  border-color: var(--accent-1);
}

.upload-icon {
  color: var(--accent-1);
  margin-bottom: 8px;
}
.upload-title {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-bright);
  margin-bottom: 4px;
}
.upload-subtitle {
  font-size: 0.85rem;
  color: var(--text-dim);
}
.upload-formats {
  font-size: 0.72rem;
  color: rgba(148,163,184,0.5);
  margin-top: 6px;
  letter-spacing: 0.02em;
}

.upload-or {
  text-align: center;
  font-size: 0.78rem;
  color: var(--text-dim);
  padding: 0 24px;
  position: relative;
}
.upload-or::before, .upload-or::after {
  content: '';
  position: absolute;
  top: 50%;
  width: calc(50% - 60px);
  height: 1px;
  background: var(--border);
}
.upload-or::before { left: 24px; }
.upload-or::after { right: 24px; }

.upload-paste-row {
  padding: 12px 24px 0;
}
.upload-textarea {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 14px;
  color: var(--text);
  font-size: 0.88rem;
  font-family: inherit;
  resize: vertical;
  min-height: 60px;
  max-height: 200px;
  box-sizing: border-box;
  outline: none;
  transition: border 0.2s;
}
.upload-textarea:focus {
  border-color: var(--accent-1);
}
.upload-textarea::placeholder {
  color: rgba(148,163,184,0.4);
}

.upload-meta-row {
  padding: 12px 24px 16px;
  display: flex;
  gap: 10px;
  align-items: center;
}
.upload-rep-input {
  flex: 1;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 14px;
  color: var(--text);
  font-size: 0.85rem;
  outline: none;
  transition: border 0.2s;
}
.upload-rep-input:focus { border-color: var(--accent-1); }
.upload-rep-input::placeholder { color: rgba(148,163,184,0.4); }

.upload-submit-btn {
  padding: 8px 24px;
  font-size: 0.88rem;
  white-space: nowrap;
  border-radius: 10px;
}

.upload-progress {
  padding: 8px 24px 16px;
}
.upload-progress-bar {
  height: 4px;
  background: rgba(255,255,255,0.06);
  border-radius: 4px;
  overflow: hidden;
}
.upload-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-1), var(--accent-2));
  border-radius: 4px;
  width: 0%;
  transition: width 0.5s ease;
}
.upload-progress-text {
  font-size: 0.78rem;
  color: var(--text-dim);
  margin-top: 6px;
  text-align: center;
}

.upload-error {
  padding: 0 24px 16px;
  color: var(--danger);
  font-size: 0.82rem;
  text-align: center;
}

.upload-file-preview {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  color: var(--text-bright);
  font-size: 0.9rem;
}
.upload-file-preview svg { color: var(--accent-2); flex-shrink: 0; }
.upload-file-size { color: var(--text-dim); font-size: 0.78rem; }
.upload-file-remove {
  margin-left: auto;
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 1.3rem;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
}
.upload-file-remove:hover { color: var(--danger); }

/* ===== SKELETON LOADING ===== */
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.skeleton {
  background: linear-gradient(90deg, var(--surface) 25%, rgba(255,255,255,0.06) 50%, var(--surface) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s ease infinite;
  border-radius: 6px;
}

.skeleton-text {
  height: 14px;
  margin-bottom: 8px;
  width: 60%;
}

.skeleton-text-sm {
  height: 10px;
  margin-bottom: 6px;
  width: 40%;
}

.skeleton-block {
  height: 120px;
  margin-bottom: 16px;
}

.skeleton-row {
  height: 48px;
  margin-bottom: 4px;
}

.skeleton-circle {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  margin: 0 auto 16px;
}

/* ===== CANVAS CHART ===== */
.chart-container {
  position: relative;
  height: 200px;
  margin-top: 12px;
}

.chart-container canvas {
  width: 100% !important;
  height: 100% !important;
}

/* ===== BACK BUTTON ===== */
.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  color: var(--text-dim);
  cursor: pointer;
  background: none;
  border: none;
  font-family: inherit;
  padding: 0;
  margin-bottom: 20px;
  transition: color 0.2s;
}

.back-btn:hover {
  color: var(--text-bright);
}

/* ===== EVIDENCE QUOTE ===== */
.evidence-quote {
  font-size: 0.85rem;
  color: var(--text-dim);
  font-style: italic;
  border-left: 2px solid var(--accent-1);
  padding-left: 12px;
  margin: 8px 0;
}

/* ===== COACHING LIST ===== */
.coaching-list-item {
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}

.coaching-list-item:last-child {
  border-bottom: none;
}

.coaching-list-item .coaching-area {
  font-weight: 600;
  color: var(--text-bright);
  font-size: 0.95rem;
  margin-bottom: 4px;
}

.coaching-list-item .coaching-what {
  font-size: 0.85rem;
  color: var(--text-dim);
  margin-bottom: 4px;
}

.coaching-list-item .coaching-fix {
  font-size: 0.85rem;
  color: var(--accent-2);
}

/* ===== RISK METER (detail) ===== */
.risk-meter-lg {
  margin: 12px 0;
}

.risk-meter-lg .risk-bar-lg {
  height: 12px;
  background: rgba(255,255,255,0.06);
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 8px;
}

.risk-meter-lg .risk-fill-lg {
  height: 100%;
  border-radius: 6px;
  transition: width 1s ease;
}

.risk-meter-lg .risk-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
  color: var(--text-dim);
}

/* ===== INLINE TWO-COL LAYOUT ===== */
.detail-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}

/* ===== EMPTY STATE ===== */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-dim);
}

.empty-state h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
  text-transform: none;
  letter-spacing: 0;
}

.empty-state p {
  font-size: 0.9rem;
  max-width: 400px;
  margin: 0 auto;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
  .dash-sidebar {
    transform: translateX(-100%);
  }

  .dash-sidebar.open {
    transform: translateX(0);
  }

  .sidebar-toggle {
    display: flex;
  }

  .dash-main {
    margin-left: 0;
    padding: 24px 16px;
    padding-top: 64px;
  }

  .stats-row {
    grid-template-columns: repeat(2, 1fr);
  }

  .kanban-board {
    grid-template-columns: 1fr;
  }

  .detail-two-col {
    grid-template-columns: 1fr;
  }

  .cards-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .stats-row {
    grid-template-columns: 1fr;
  }

  .dash-main {
    padding: 16px 12px;
    padding-top: 64px;
  }
}

/* Overlay for mobile sidebar */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 40;
}

.sidebar-overlay.open {
  display: block;
}

/* ===== CHAT VIEW ===== */
.chat-view {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 40px);
  max-width: 640px;
  margin: 0 auto;
}

.chat-view-header {
  padding: 0 0 0.75rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0.75rem;
  text-align: center;
}

.chat-view-header h2 {
  font-size: 1.15rem;
  margin: 0 0 0.15rem;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.chat-view-header p {
  color: var(--text-dim);
  font-size: 0.8rem;
  margin: 0;
}

.chat-view-messages {
  flex: 1;
  overflow-y: auto;
  padding: 0.75rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.chat-view-msg {
  display: flex;
  gap: 0.5rem;
  align-items: flex-end;
  max-width: 80%;
}

.chat-view-msg.user {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.chat-view-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1, #22d3ee);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.7rem;
  flex-shrink: 0;
  color: #fff;
  box-shadow: 0 2px 8px rgba(99,102,241,0.3);
}

.chat-view-bubble {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px 16px 16px 4px;
  padding: 0.65rem 0.9rem;
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--text);
}

.chat-view-msg.user .chat-view-bubble {
  background: linear-gradient(135deg, rgba(99,102,241,0.2), rgba(99,102,241,0.12));
  border-color: rgba(99,102,241,0.3);
  border-radius: 16px 16px 4px 16px;
  color: #e0e7ff;
}

.chat-view-bubble.error {
  color: #fca5a5;
  background: rgba(239,68,68,0.1);
  border-color: rgba(239,68,68,0.2);
}

.chat-view-bubble.typing {
  display: flex;
  gap: 5px;
  padding: 0.8rem 1.1rem;
  align-items: center;
}

.chat-view-bubble.typing span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  animation: chat-typing 1.2s infinite;
}

.chat-view-bubble.typing span:nth-child(2) { animation-delay: 0.2s; }
.chat-view-bubble.typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes chat-typing {
  0%, 60%, 100% { opacity: 0.25; transform: scale(0.85); }
  30% { opacity: 1; transform: scale(1.1); }
}

.chat-view-input-row {
  display: flex;
  gap: 0.5rem;
  padding: 0.75rem 0 0;
  border-top: 1px solid var(--border);
  margin-top: 0.25rem;
}

.chat-view-input-row input {
  flex: 1;
  padding: 0.7rem 1rem;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 20px;
  color: #fff;
  font-size: 0.88rem;
  outline: none;
  transition: border 0.2s;
}

.chat-view-input-row input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(99,102,241,0.15);
}

.chat-view-input-row button {
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1, #22d3ee);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.15s, box-shadow 0.15s;
  box-shadow: 0 2px 8px rgba(99,102,241,0.3);
}

.chat-view-input-row button:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(99,102,241,0.4);
}
