/* ============================================================
   ATENDIMENTO ENTROPIA — iOS 26 LIQUID GLASS DESIGN SYSTEM
   Apple-inspired frosted glass panels, rich gradient backdrop,
   layered depth, glowing borders, and premium typography.
   ============================================================ */

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

/* ── Design Tokens ── */
:root {
  /* ── Rich dark backdrop (the "world" behind the glass) ── */
  --bg-base:        #080b14;
  --bg-deep:        #0a0e1a;
  --bg-surface:     #0d1220;
  --bg-elevated:    #111827;

  /* ── Glass layers — truly translucent ── */
  --glass-01:       rgba(255, 255, 255, 0.04);
  --glass-02:       rgba(255, 255, 255, 0.07);
  --glass-03:       rgba(255, 255, 255, 0.10);
  --glass-04:       rgba(255, 255, 255, 0.14);
  --glass-05:       rgba(255, 255, 255, 0.20);

  /* ── Borders — light catches on glass edges ── */
  --border-glass:   rgba(255, 255, 255, 0.12);
  --border-glow:    rgba(0, 210, 160, 0.30);
  --border-subtle:  rgba(255, 255, 255, 0.06);
  --border-bright:  rgba(255, 255, 255, 0.20);

  /* ── Accent — teal/cyan, Apple-precise ── */
  --accent:         #00d2a0;
  --accent-dim:     #00a884;
  --accent-bright:  #34ead4;
  --accent-glow:    rgba(0, 210, 160, 0.28);
  --accent-glow-sm: rgba(0, 210, 160, 0.14);
  --accent-glow-xs: rgba(0, 210, 160, 0.07);

  /* ── Gradients ── */
  --gradient-accent:    linear-gradient(135deg, #00d2a0 0%, #00b4d8 100%);
  --gradient-accent-v:  linear-gradient(180deg, #00d2a0 0%, #0096c7 100%);
  --gradient-msg-out:   linear-gradient(145deg, rgba(0, 120, 100, 0.55) 0%, rgba(0, 85, 110, 0.55) 100%);

  /* ── Orb colors that show through glass ── */
  --orb-purple:  rgba(120, 60, 220, 0.18);
  --orb-teal:    rgba(0, 210, 160, 0.14);
  --orb-blue:    rgba(30, 100, 255, 0.15);
  --orb-indigo:  rgba(80, 60, 200, 0.12);

  /* ── Typography ── */
  --text-primary:   #f0f2f5;
  --text-secondary: rgba(255, 255, 255, 0.55);
  --text-muted:     rgba(255, 255, 255, 0.30);
  --text-accent:    #00d2a0;

  /* ── Semantic ── */
  --color-danger:   #ff453a;
  --color-warning:  #ffd60a;
  --color-info:     #0a84ff;
  --color-success:  #30d158;

  /* ── Shadows — colored, soft, layered ── */
  --shadow-sm:  0 2px 8px rgba(0, 0, 0, 0.35), 0 1px 3px rgba(0, 0, 0, 0.20);
  --shadow-md:  0 8px 32px rgba(0, 0, 0, 0.45), 0 2px 8px rgba(0, 0, 0, 0.25);
  --shadow-lg:  0 20px 60px rgba(0, 0, 0, 0.55), 0 8px 20px rgba(0, 0, 0, 0.30);
  --shadow-glow:    0 0 24px var(--accent-glow), 0 0 48px rgba(0, 210, 160, 0.10);
  --shadow-purple:  0 8px 32px rgba(120, 60, 220, 0.25);
  --shadow-glass:   0 8px 32px rgba(0, 0, 0, 0.40), inset 0 1px 0 rgba(255, 255, 255, 0.10);

  /* ── Backdrop blur levels ── */
  --blur-sm:  blur(12px);
  --blur-md:  blur(24px);
  --blur-lg:  blur(36px);
  --blur-xl:  blur(56px);

  /* ── Radius — Apple's rounded language ── */
  --radius-xs: 5px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-pill: 999px;

  /* ── Motion — Apple's fluid timing ── */
  --ease-out:     cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring:  cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-in:      cubic-bezier(0.7, 0, 0.84, 0);
  --duration-fast:   150ms;
  --duration-base:   220ms;
  --duration-slow:   380ms;

  /* ── Legacy aliases — keep JS working ── */
  --bg-primary:  var(--bg-surface);
  --bg-sidebar:  var(--bg-surface);
  --bg-chat:     var(--bg-deep);
  --bg-msg-in:   rgba(255, 255, 255, 0.07);
  --bg-msg-out:  rgba(0, 80, 70, 0.45);
  --bg-input:    rgba(255, 255, 255, 0.07);
  --bg-header:   var(--bg-surface);
  --border-color: var(--border-glass);
  --hover:       var(--glass-03);
}

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

body {
  font-family: -apple-system, 'SF Pro Display', 'Inter', BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg-base);
  color: var(--text-primary);
  height: 100vh;
  overflow: hidden;
  font-feature-settings: 'cv02', 'cv03', 'cv04', 'cv11';
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── Rich ambient background — colored orbs that bleed through glass ── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 55% 70% at 8% 20%,  var(--orb-purple) 0%, transparent 65%),
    radial-gradient(ellipse 45% 55% at 92% 15%,  var(--orb-blue) 0%, transparent 60%),
    radial-gradient(ellipse 60% 45% at 50% 95%,  var(--orb-teal) 0%, transparent 65%),
    radial-gradient(ellipse 40% 60% at 75% 55%,  var(--orb-indigo) 0%, transparent 55%),
    radial-gradient(ellipse 35% 40% at 20% 75%,  rgba(0, 200, 180, 0.10) 0%, transparent 55%);
  pointer-events: none;
  z-index: 0;
}

/* Noise texture overlay for that premium Apple feel */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.025'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 0;
  opacity: 0.4;
}

#app {
  display: flex;
  height: 100vh;
  max-width: 100%;
  position: relative;
  z-index: 1;
}

/* ============================================================
   ACCESSIBILITY
   ============================================================ */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.hidden {
  display: none !important;
}

/* Focus rings — Apple blue glow */
.chat-item:focus-visible,
#send-btn:focus-visible,
#message-input:focus-visible,
#search-input:focus-visible,
.chat-header-left:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px var(--accent-glow-sm);
}

/* ============================================================
   SCROLLBARS — Barely visible, Apple-thin
   ============================================================ */
::-webkit-scrollbar {
  width: 3px;
  height: 3px;
}

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

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-pill);
  transition: background var(--duration-base);
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.18);
}

/* ============================================================
   SIDEBAR — Left glass panel
   ============================================================ */
#sidebar {
  width: 380px;
  min-width: 380px;
  background: rgba(255, 255, 255, 0.055);
  backdrop-filter: var(--blur-lg);
  -webkit-backdrop-filter: var(--blur-lg);
  border-right: 1px solid var(--border-glass);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

/* Glowing edge — light on glass right border */
#sidebar::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 1px;
  height: 100%;
  background: linear-gradient(
    180deg,
    transparent 0%,
    rgba(255, 255, 255, 0.18) 20%,
    rgba(0, 210, 160, 0.25) 50%,
    rgba(255, 255, 255, 0.18) 80%,
    transparent 100%
  );
  opacity: 0.6;
  pointer-events: none;
}

/* ── Sidebar Header ── */
.sidebar-header {
  padding: 22px 16px 14px;
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: var(--blur-sm);
  -webkit-backdrop-filter: var(--blur-sm);
  border-bottom: 1px solid var(--border-glass);
  position: relative;
}

/* Top highlight line — glass top edge catches light */
.sidebar-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.20), transparent);
}

.sidebar-header h2 {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  margin-bottom: 12px;
  background: linear-gradient(135deg, #ffffff 0%, var(--accent-bright) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

#instance-select {
  width: 100%;
  padding: 9px 14px;
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: var(--blur-sm);
  -webkit-backdrop-filter: var(--blur-sm);
  color: var(--text-primary);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  font-size: 13px;
  font-family: inherit;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--duration-base) var(--ease-out);
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='rgba(255,255,255,0.4)' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}

#instance-select:focus {
  outline: none;
  border-color: rgba(0, 210, 160, 0.45);
  box-shadow: 0 0 0 3px var(--accent-glow-sm), var(--shadow-glass);
  background-color: rgba(255, 255, 255, 0.12);
}

#instance-select option {
  background: #1a1f35;
  color: var(--text-primary);
}

/* ── Filter Tabs ── */
.chat-filter-toggle {
  display: flex;
  padding: 10px 12px 6px;
  gap: 4px;
  background: rgba(255, 255, 255, 0.02);
}

.filter-btn {
  flex: 1;
  padding: 7px 0;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: all var(--duration-base) var(--ease-out);
  letter-spacing: 0.01em;
}

.filter-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  border-color: var(--border-glass);
}

.filter-btn.active {
  background: rgba(0, 210, 160, 0.12);
  color: var(--accent-bright);
  border-color: rgba(0, 210, 160, 0.30);
  box-shadow: 0 0 14px var(--accent-glow-xs), inset 0 1px 0 rgba(255, 255, 255, 0.10);
  text-shadow: 0 0 12px var(--accent-glow);
}

/* ── Sort Toggle ── */
.chat-sort-toggle {
  display: flex;
  padding: 4px 12px 6px;
  gap: 4px;
}

.sort-btn {
  flex: 1;
  padding: 5px 0;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 11px;
  font-family: inherit;
  font-weight: 500;
  cursor: pointer;
  border-radius: var(--radius-xs);
  transition: all var(--duration-fast) var(--ease-out);
}

.sort-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-secondary);
}

.sort-btn.active {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
}

/* ── Search Box ── */
.search-box {
  padding: 6px 12px 8px;
}

#search-input {
  width: 100%;
  padding: 9px 14px;
  background: rgba(255, 255, 255, 0.07);
  backdrop-filter: var(--blur-sm);
  -webkit-backdrop-filter: var(--blur-sm);
  color: var(--text-primary);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-family: inherit;
  transition: all var(--duration-base) var(--ease-out);
}

#search-input::placeholder {
  color: var(--text-muted);
}

#search-input:focus {
  outline: none;
  border-color: rgba(0, 210, 160, 0.40);
  background: rgba(255, 255, 255, 0.11);
  box-shadow: 0 0 0 3px var(--accent-glow-sm);
}

/* ── Concierge Status ── */
.concierge-status {
  padding: 7px 14px;
  font-size: 11px;
  color: var(--text-secondary);
  background: rgba(0, 210, 160, 0.07);
  border-bottom: 1px solid rgba(0, 210, 160, 0.18);
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: 0.01em;
}

.concierge-status .concierge-spinner {
  width: 11px;
  height: 11px;
  border: 1.5px solid rgba(255, 255, 255, 0.15);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
}

.concierge-status.done {
  color: var(--accent);
  background: rgba(0, 210, 160, 0.05);
  border-color: rgba(0, 210, 160, 0.12);
}

.concierge-analyzing {
  color: var(--accent);
  font-style: italic;
  animation: pulse 1.5s ease infinite;
}

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

/* ── Chat List ── */
#chat-list {
  flex: 1;
  overflow-y: auto;
}

/* ── Chat Item ── */
.chat-item {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  cursor: pointer;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  transition:
    background var(--duration-fast) var(--ease-out),
    box-shadow var(--duration-fast) var(--ease-out);
  position: relative;
}

/* Active left accent bar */
.chat-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 3px;
  background: var(--gradient-accent);
  opacity: 0;
  transition: opacity var(--duration-base) var(--ease-out);
  border-radius: 0 var(--radius-xs) var(--radius-xs) 0;
  box-shadow: 0 0 8px var(--accent-glow);
}

.chat-item:hover {
  background: rgba(255, 255, 255, 0.05);
}

.chat-item:hover::before {
  opacity: 0.45;
}

.chat-item.active {
  background: rgba(0, 210, 160, 0.07);
  border-bottom-color: transparent;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), inset 0 -1px 0 rgba(0, 210, 160, 0.08);
}

.chat-item.active::before {
  opacity: 1;
}

/* ── Chat Avatar ── */
.chat-avatar {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--gradient-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  font-weight: 700;
  color: #fff;
  margin-right: 13px;
  flex-shrink: 0;
  letter-spacing: -0.02em;
  box-shadow: 0 3px 12px rgba(0, 210, 160, 0.35), 0 1px 3px rgba(0, 0, 0, 0.30);
  position: relative;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}

/* Subtle light ring on avatar */
.chat-avatar::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.25);
}

/* ── Chat Info ── */
.chat-info {
  flex: 1;
  min-width: 0;
}

.chat-info-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 3px;
}

.chat-info-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -0.015em;
}

.chat-info-time {
  font-size: 11px;
  color: var(--text-muted);
  flex-shrink: 0;
  margin-left: 8px;
  font-variant-numeric: tabular-nums;
}

.time-unread {
  color: var(--accent) !important;
  font-weight: 600;
}

.chat-info-bottom {
  display: flex;
  align-items: center;
  gap: 5px;
}

.chat-info-last {
  flex: 1;
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 400;
}

.chat-unread-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
  box-shadow: 0 0 8px var(--accent-glow), 0 0 3px var(--accent);
}

/* ── Chat Tags (pill style) ── */
.chat-tag {
  font-size: 9px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--radius-pill);
  margin-left: 4px;
  vertical-align: middle;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  backdrop-filter: var(--blur-sm);
  -webkit-backdrop-filter: var(--blur-sm);
}

.tag-aluno {
  background: rgba(0, 210, 160, 0.12);
  color: var(--accent);
  border: 1px solid rgba(0, 210, 160, 0.22);
}

.tag-resp {
  background: rgba(10, 132, 255, 0.12);
  color: #5eb2ff;
  border: 1px solid rgba(10, 132, 255, 0.22);
}

/* ── Concierge Tags ── */
.chat-concierge-tags {
  display: flex;
  gap: 3px;
  margin-top: 2px;
  flex-wrap: wrap;
}

.concierge-tag {
  font-size: 9px;
  padding: 1px 6px;
  border-radius: var(--radius-pill);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  font-weight: 700;
  backdrop-filter: var(--blur-sm);
  -webkit-backdrop-filter: var(--blur-sm);
}

.tag-humor-satisfeito {
  background: rgba(48, 209, 88, 0.12);
  color: #30d158;
  border: 1px solid rgba(48, 209, 88, 0.20);
}

.tag-humor-neutro {
  background: rgba(255, 255, 255, 0.07);
  color: var(--text-secondary);
  border: 1px solid var(--border-glass);
}

.tag-humor-impaciente {
  background: rgba(255, 214, 10, 0.12);
  color: #ffd60a;
  border: 1px solid rgba(255, 214, 10, 0.20);
}

.tag-humor-frustrado {
  background: rgba(255, 100, 60, 0.12);
  color: #ff6b3d;
  border: 1px solid rgba(255, 100, 60, 0.20);
}

.tag-humor-irritado {
  background: rgba(255, 69, 58, 0.14);
  color: #ff453a;
  border: 1px solid rgba(255, 69, 58, 0.24);
}

.tag-assunto {
  background: rgba(10, 132, 255, 0.10);
  color: #5eb2ff;
  border: 1px solid rgba(10, 132, 255, 0.20);
}

.concierge-score {
  font-size: 9px;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: var(--radius-pill);
}

.score-high {
  background: rgba(255, 69, 58, 0.14);
  color: #ff453a;
  border: 1px solid rgba(255, 69, 58, 0.22);
}

.score-mid {
  background: rgba(255, 214, 10, 0.14);
  color: #ffd60a;
  border: 1px solid rgba(255, 214, 10, 0.22);
}

.score-low {
  background: rgba(255, 255, 255, 0.07);
  color: var(--text-muted);
  border: 1px solid var(--border-subtle);
}

/* ============================================================
   CHAT AREA — Main glass panel
   ============================================================ */
#chat-area {
  flex: 1 1 0;
  min-width: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: transparent;
  position: relative;
}

/* Subtle gradient layer behind messages */
#chat-area::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(8, 11, 20, 0.30) 0%, transparent 20%),
    radial-gradient(ellipse 70% 40% at 50% 50%, rgba(0, 210, 160, 0.03) 0%, transparent 65%);
  z-index: 0;
  pointer-events: none;
}

/* ── Empty State ── */
#empty-state {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  position: relative;
  z-index: 1;
  gap: 0;
}

.empty-icon {
  width: 80px;
  height: 80px;
  margin-bottom: 20px;
  opacity: 0.20;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.empty-icon::before {
  content: '';
  display: block;
  width: 72px;
  height: 72px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2300d2a0' stroke-width='1.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z'/%3E%3Ccircle cx='9' cy='10' r='0.8' fill='%2300d2a0'/%3E%3Ccircle cx='12' cy='10' r='0.8' fill='%2300d2a0'/%3E%3Ccircle cx='15' cy='10' r='0.8' fill='%2300d2a0'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}

#empty-state p {
  font-size: 15px;
  font-weight: 400;
  color: var(--text-muted);
  letter-spacing: -0.01em;
}

/* ── Chat View ── */
#chat-view {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  position: relative;
  z-index: 1;
}

/* ── Chat Header (glass bar) ── */
.chat-header {
  padding: 12px 20px;
  background: rgba(255, 255, 255, 0.07);
  backdrop-filter: var(--blur-md);
  -webkit-backdrop-filter: var(--blur-md);
  border-bottom: 1px solid var(--border-glass);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  position: relative;
  z-index: 10;
}

/* Top highlight — glass top surface */
.chat-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent);
}

/* Bottom glow line */
.chat-header::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(0, 210, 160, 0.25) 30%,
    rgba(0, 210, 160, 0.25) 70%,
    transparent
  );
  opacity: 0.5;
}

.chat-header-left {
  display: flex;
  align-items: center;
  cursor: pointer;
  gap: 0;
  border-radius: var(--radius-md);
  padding: 4px 8px 4px 4px;
  margin-left: -4px;
  transition: background var(--duration-fast) var(--ease-out);
}

.chat-header-left:hover {
  background: rgba(255, 255, 255, 0.07);
}

.chat-header-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--gradient-accent);
  margin-right: 12px;
  flex-shrink: 0;
  box-shadow: 0 2px 10px rgba(0, 210, 160, 0.35), 0 0 0 1px rgba(255, 255, 255, 0.18);
}

.chat-header-info {
  display: flex;
  align-items: center;
}

.chat-header-info h3,
#chat-name {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--text-primary);
  line-height: 1.3;
}

.chat-header-info span,
#chat-number {
  font-size: 12px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  display: block;
}

/* ── Chat Cadastro (header badge) ── */
.chat-cadastro {
  font-size: 11px;
  color: var(--text-secondary);
  text-align: right;
  max-width: 50%;
  line-height: 1.5;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 6px 10px;
  backdrop-filter: var(--blur-sm);
  -webkit-backdrop-filter: var(--blur-sm);
  box-shadow: var(--shadow-glass);
}

.chat-cadastro .cadastro-nome {
  color: var(--text-accent);
  font-weight: 700;
  font-size: 12px;
  display: block;
  letter-spacing: -0.01em;
}

.chat-cadastro .cadastro-tipo {
  font-size: 10px;
  background: rgba(0, 210, 160, 0.12);
  padding: 1px 7px;
  border-radius: var(--radius-pill);
  color: var(--accent);
  display: inline-block;
  margin-left: 2px;
  border: 1px solid rgba(0, 210, 160, 0.22);
  font-weight: 600;
}

.chat-cadastro .cadastro-detalhe {
  opacity: 0.60;
  display: block;
}

/* ── Resolve Button ── */
.resolve-btn {
  padding: 7px 16px;
  background: rgba(0, 210, 160, 0.10);
  border: 1px solid rgba(0, 210, 160, 0.32);
  color: var(--accent-bright);
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all var(--duration-base) var(--ease-out);
  flex-shrink: 0;
  letter-spacing: 0.01em;
  backdrop-filter: var(--blur-sm);
  -webkit-backdrop-filter: var(--blur-sm);
  box-shadow: 0 0 12px var(--accent-glow-xs);
}

.resolve-btn:hover {
  background: rgba(0, 210, 160, 0.20);
  border-color: rgba(0, 210, 160, 0.55);
  box-shadow: 0 0 20px var(--accent-glow), 0 4px 16px rgba(0, 210, 160, 0.20);
  transform: translateY(-1px);
}

.resolve-btn.resolved {
  background: var(--gradient-accent);
  color: rgba(0, 0, 0, 0.85);
  border-color: transparent;
  box-shadow: 0 4px 20px var(--accent-glow), 0 0 0 1px rgba(255, 255, 255, 0.15) inset;
}

/* ── Ficha Button (icon-only) ── */
.ficha-btn {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--border-glass);
  color: var(--text-secondary);
  font-size: 0;
  cursor: pointer;
  padding: 0;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  transition: all var(--duration-base) var(--ease-out);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: var(--blur-sm);
  -webkit-backdrop-filter: var(--blur-sm);
}

.ficha-btn::before {
  content: '';
  display: block;
  width: 18px;
  height: 18px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='rgba(255,255,255,0.45)' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2'/%3E%3Crect x='8' y='2' width='8' height='4' rx='1' ry='1'/%3E%3Cline x1='9' y1='12' x2='15' y2='12'/%3E%3Cline x1='9' y1='16' x2='13' y2='16'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  transition: filter var(--duration-base);
}

.ficha-btn:hover {
  background: rgba(0, 210, 160, 0.10);
  border-color: rgba(0, 210, 160, 0.35);
  color: var(--text-primary);
  box-shadow: 0 0 14px var(--accent-glow-sm);
}

.ficha-btn:hover::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2300d2a0' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2'/%3E%3Crect x='8' y='2' width='8' height='4' rx='1' ry='1'/%3E%3Cline x1='9' y1='12' x2='15' y2='12'/%3E%3Cline x1='9' y1='16' x2='13' y2='16'/%3E%3C/svg%3E");
}

/* ============================================================
   CHAT BODY
   ============================================================ */
.chat-body {
  flex: 1;
  display: flex;
  min-height: 0;
}

.chat-messages-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}

/* ── Messages Container ── */
#messages-container {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  min-width: 0;
  min-height: 0;
  padding: 24px 60px;
  /* Very subtle pattern that shows through glass */
  background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='30' cy='30' r='0.8' fill='%23ffffff' fill-opacity='0.015'/%3E%3C/svg%3E");
}

#messages-list {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

/* ── Individual Message (glass bubble) ── */
.message {
  max-width: 65%;
  padding: 9px 13px;
  border-radius: var(--radius-lg);
  font-size: 14px;
  line-height: 1.5;
  position: relative;
  word-wrap: break-word;
  backdrop-filter: var(--blur-sm);
  -webkit-backdrop-filter: var(--blur-sm);
  transition: transform var(--duration-fast) var(--ease-out);
}

/* Incoming — translucent white glass */
.message.incoming {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.13);
  align-self: flex-start;
  border-top-left-radius: var(--radius-xs);
  box-shadow:
    0 4px 16px rgba(0, 0, 0, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.10);
}

/* Outgoing — translucent teal glass */
.message.outgoing {
  background: rgba(0, 210, 160, 0.13);
  border: 1px solid rgba(0, 210, 160, 0.22);
  align-self: flex-end;
  border-top-right-radius: var(--radius-xs);
  box-shadow:
    0 4px 16px rgba(0, 100, 80, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.message-text {
  margin-bottom: 5px;
  overflow-wrap: break-word;
  word-break: break-word;
  white-space: pre-wrap;
  color: var(--text-primary);
}

.message-text strong {
  font-weight: 700;
}

.message-text em {
  font-style: italic;
}

.message-text del {
  text-decoration: line-through;
  opacity: 0.6;
}

.message-text .wa-mono {
  font-family: 'SFMono-Regular', 'SF Mono', 'Consolas', 'Liberation Mono', monospace;
  font-size: 12.5px;
  background: rgba(0, 0, 0, 0.20);
  padding: 2px 6px;
  border-radius: var(--radius-xs);
  border: 1px solid rgba(255, 255, 255, 0.10);
}

.message-text .wa-quote {
  display: block;
  border-left: 2px solid var(--accent);
  padding-left: 10px;
  margin: 4px 0;
  color: rgba(255, 255, 255, 0.55);
  font-style: italic;
}

.message-time {
  font-size: 10.5px;
  color: rgba(255, 255, 255, 0.35);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* ── Date Separator ── */
.date-separator {
  text-align: center;
  margin: 18px 0;
  display: flex;
  align-items: center;
  gap: 12px;
}

.date-separator::before,
.date-separator::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(255, 255, 255, 0.07);
}

.date-separator span {
  background: rgba(255, 255, 255, 0.07);
  backdrop-filter: var(--blur-sm);
  -webkit-backdrop-filter: var(--blur-sm);
  border: 1px solid rgba(255, 255, 255, 0.11);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 500;
  padding: 4px 14px;
  border-radius: var(--radius-pill);
  white-space: nowrap;
  letter-spacing: 0.03em;
}

/* ── Message States ── */
.message.failed {
  opacity: 0.55;
}

.message.failed .message-time {
  color: var(--color-danger);
}

/* ── Loading ── */
.loading {
  text-align: center;
  padding: 40px;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 400;
}

/* ============================================================
   INPUT AREA — Glass dock
   ============================================================ */
.message-input-area {
  display: flex;
  padding: 10px 16px 12px;
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: var(--blur-md);
  -webkit-backdrop-filter: var(--blur-md);
  border-top: 1px solid var(--border-glass);
  gap: 8px;
  align-items: center;
  position: relative;
}

/* Top highlight on input dock */
.message-input-area::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.14) 30%,
    rgba(0, 210, 160, 0.20) 50%,
    rgba(255, 255, 255, 0.14) 70%,
    transparent
  );
}

/* ── Icon Buttons (respostas, attach, mic) ── */
#respostas-btn,
#attach-btn,
#mic-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--border-glass);
  background: rgba(255, 255, 255, 0.06);
  font-size: 0;
  cursor: pointer;
  flex-shrink: 0;
  transition: all var(--duration-base) var(--ease-out);
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: var(--blur-sm);
  -webkit-backdrop-filter: var(--blur-sm);
}

#respostas-btn:hover,
#attach-btn:hover,
#mic-btn:hover {
  background: rgba(0, 210, 160, 0.10);
  border-color: rgba(0, 210, 160, 0.35);
  box-shadow: 0 0 12px var(--accent-glow-sm);
  transform: scale(1.05);
}

/* Lightning bolt — respostas rápidas */
#respostas-btn::before {
  content: '';
  display: block;
  width: 18px;
  height: 18px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='rgba(255,255,255,0.45)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolygon points='13 2 3 14 12 14 11 22 21 10 12 10 13 2'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}

#respostas-btn:hover::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2300d2a0' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolygon points='13 2 3 14 12 14 11 22 21 10 12 10 13 2'/%3E%3C/svg%3E");
}

/* Paperclip — attach */
#attach-btn::before {
  content: '';
  display: block;
  width: 18px;
  height: 18px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='rgba(255,255,255,0.45)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21.44 11.05l-9.19 9.19a6 6 0 0 1-8.49-8.49l9.19-9.19a4 4 0 0 1 5.66 5.66l-9.2 9.19a2 2 0 0 1-2.83-2.83l8.49-8.48'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}

#attach-btn:hover::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2300d2a0' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21.44 11.05l-9.19 9.19a6 6 0 0 1-8.49-8.49l9.19-9.19a4 4 0 0 1 5.66 5.66l-9.2 9.19a2 2 0 0 1-2.83-2.83l8.49-8.48'/%3E%3C/svg%3E");
}

/* Microphone — mic */
#mic-btn::before {
  content: '';
  display: block;
  width: 18px;
  height: 18px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='rgba(255,255,255,0.45)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='9' y='2' width='6' height='12' rx='3'/%3E%3Cpath d='M19 10v2a7 7 0 0 1-14 0v-2'/%3E%3Cline x1='12' y1='19' x2='12' y2='22'/%3E%3Cline x1='8' y1='22' x2='16' y2='22'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}

#mic-btn:hover::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2300d2a0' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='9' y='2' width='6' height='12' rx='3'/%3E%3Cpath d='M19 10v2a7 7 0 0 1-14 0v-2'/%3E%3Cline x1='12' y1='19' x2='12' y2='22'/%3E%3Cline x1='8' y1='22' x2='16' y2='22'/%3E%3C/svg%3E");
}

/* ── Message Input ── */
#message-input {
  flex: 1;
  padding: 10px 16px;
  background: rgba(255, 255, 255, 0.07);
  backdrop-filter: var(--blur-sm);
  -webkit-backdrop-filter: var(--blur-sm);
  color: var(--text-primary);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-pill);
  font-size: 14px;
  font-family: inherit;
  transition: all var(--duration-base) var(--ease-out);
}

#message-input::placeholder {
  color: var(--text-muted);
}

#message-input:focus {
  outline: none;
  border-color: rgba(0, 210, 160, 0.40);
  background: rgba(255, 255, 255, 0.10);
  box-shadow: 0 0 0 3px var(--accent-glow-sm);
}

/* ── Send Button ── */
#send-btn {
  padding: 10px 22px;
  background: var(--gradient-accent);
  color: rgba(0, 0, 0, 0.85);
  border: none;
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: all var(--duration-base) var(--ease-out);
  letter-spacing: 0.01em;
  box-shadow: 0 3px 16px var(--accent-glow), 0 1px 3px rgba(0, 0, 0, 0.25);
  position: relative;
  overflow: hidden;
}

/* Inner shine on send button */
#send-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 50%;
  background: rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-pill) var(--radius-pill) 0 0;
}

#send-btn:hover {
  box-shadow: 0 6px 28px rgba(0, 210, 160, 0.50), 0 2px 8px rgba(0, 0, 0, 0.25);
  transform: translateY(-1px);
  filter: brightness(1.08);
}

#send-btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px var(--accent-glow);
}

#send-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

#send-btn.recording,
#mic-btn.recording {
  background: var(--color-danger) !important;
  color: #fff;
  border-color: var(--color-danger);
  animation: pulse 0.9s ease infinite;
  box-shadow: 0 0 20px rgba(255, 69, 58, 0.45);
}

#mic-btn.recording::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='9' y='2' width='6' height='12' rx='3'/%3E%3Cpath d='M19 10v2a7 7 0 0 1-14 0v-2'/%3E%3Cline x1='12' y1='19' x2='12' y2='22'/%3E%3Cline x1='8' y1='22' x2='16' y2='22'/%3E%3C/svg%3E") !important;
}

/* ── Send Status ── */
.send-status {
  padding: 6px 20px;
  font-size: 12px;
  color: var(--accent);
  background: rgba(0, 210, 160, 0.06);
  border-top: 1px solid rgba(0, 210, 160, 0.12);
  text-align: center;
  font-weight: 500;
  animation: pulse 1s ease infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.50; }
}

/* ============================================================
   RESPOSTAS RAPIDAS — Glass drawer
   ============================================================ */
.respostas-panel {
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: var(--blur-md);
  -webkit-backdrop-filter: var(--blur-md);
  border-top: 1px solid var(--border-glass);
  max-height: 300px;
  display: flex;
  flex-direction: column;
}

.respostas-header {
  display: flex;
  gap: 6px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border-glass);
  align-items: center;
}

.respostas-header input {
  flex: 1;
  padding: 7px 12px;
  background: rgba(255, 255, 255, 0.07);
  color: var(--text-primary);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-family: inherit;
  transition: all var(--duration-base) var(--ease-out);
}

.respostas-header input:focus {
  outline: none;
  border-color: rgba(0, 210, 160, 0.40);
  box-shadow: 0 0 0 2px var(--accent-glow-sm);
}

.respostas-header button {
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-glass);
  background: rgba(255, 255, 255, 0.07);
  color: var(--text-secondary);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--duration-base) var(--ease-out);
  font-family: inherit;
}

.respostas-header button:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: var(--border-bright);
  color: var(--text-primary);
}

/* Close button in respostas header */
#respostas-close-btn {
  font-size: 0 !important;
  position: relative;
}

#respostas-close-btn::before {
  content: '';
  display: block;
  width: 14px;
  height: 14px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='rgba(255,255,255,0.45)' stroke-width='2.5' stroke-linecap='round'%3E%3Cline x1='18' y1='6' x2='6' y2='18'/%3E%3Cline x1='6' y1='6' x2='18' y2='18'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
}

.respostas-list {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
}

.resposta-item {
  display: flex;
  align-items: center;
  padding: 9px 14px;
  cursor: pointer;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  transition: background var(--duration-fast) var(--ease-out);
  gap: 10px;
}

.resposta-item:hover {
  background: rgba(255, 255, 255, 0.06);
}

.resposta-info {
  flex: 1;
  min-width: 0;
}

.resposta-titulo {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.resposta-preview {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 1px;
}

.resposta-cat {
  font-size: 9px;
  padding: 2px 7px;
  border-radius: var(--radius-pill);
  background: rgba(10, 132, 255, 0.10);
  color: #5eb2ff;
  border: 1px solid rgba(10, 132, 255, 0.20);
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.4px;
  flex-shrink: 0;
}

.resposta-edit,
.resposta-delete {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 13px;
  cursor: pointer;
  padding: 5px;
  opacity: 0;
  transition: opacity var(--duration-fast), color var(--duration-fast);
  border-radius: var(--radius-xs);
}

.resposta-item:hover .resposta-edit,
.resposta-item:hover .resposta-delete {
  opacity: 1;
}

.resposta-edit:hover {
  color: var(--text-primary);
}

.resposta-delete:hover {
  color: var(--color-danger);
}

@media (pointer: coarse) {
  .resposta-edit,
  .resposta-delete {
    opacity: 0.7;
  }
}

/* ============================================================
   FICHA PANEL — Right glass sidebar
   ============================================================ */
.ficha-panel {
  width: 340px;
  min-width: 340px;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: var(--blur-lg);
  -webkit-backdrop-filter: var(--blur-lg);
  border-left: 1px solid var(--border-glass);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  position: relative;
}

/* Left edge glow on ficha panel */
.ficha-panel::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 1px;
  height: 100%;
  background: linear-gradient(
    180deg,
    transparent 0%,
    rgba(255, 255, 255, 0.16) 20%,
    rgba(0, 210, 160, 0.22) 50%,
    rgba(255, 255, 255, 0.16) 80%,
    transparent 100%
  );
  opacity: 0.55;
  pointer-events: none;
}

/* ── Ficha Header ── */
.ficha-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-glass);
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: var(--blur-sm);
  -webkit-backdrop-filter: var(--blur-sm);
  position: sticky;
  top: 0;
  z-index: 5;
}

/* Top edge highlight */
.ficha-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.18), transparent);
}

.ficha-header h4 {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-accent);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* Ficha close button */
.ficha-header button,
#ficha-close {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--border-glass);
  color: var(--text-secondary);
  font-size: 0;
  cursor: pointer;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  transition: all var(--duration-base) var(--ease-out);
}

#ficha-close::before {
  content: '';
  display: block;
  width: 14px;
  height: 14px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='rgba(255,255,255,0.45)' stroke-width='2.5' stroke-linecap='round'%3E%3Cline x1='18' y1='6' x2='6' y2='18'/%3E%3Cline x1='6' y1='6' x2='18' y2='18'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
}

.ficha-header button:hover,
#ficha-close:hover {
  background: rgba(255, 69, 58, 0.12);
  border-color: rgba(255, 69, 58, 0.30);
}

#ficha-close:hover::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ff453a' stroke-width='2.5' stroke-linecap='round'%3E%3Cline x1='18' y1='6' x2='6' y2='18'/%3E%3Cline x1='6' y1='6' x2='18' y2='18'/%3E%3C/svg%3E");
}

/* ── Ficha Content ── */
.ficha-content {
  padding: 14px;
  font-size: 13px;
  color: var(--text-primary);
  line-height: 1.55;
}

.ficha-section {
  margin-bottom: 14px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  overflow: hidden;
  backdrop-filter: var(--blur-sm);
  -webkit-backdrop-filter: var(--blur-sm);
  box-shadow: var(--shadow-glass);
}

.ficha-section-title {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-accent);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 10px 12px 8px;
  border-bottom: 1px solid var(--border-glass);
  background: rgba(0, 210, 160, 0.05);
}

.ficha-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 6px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  transition: background var(--duration-fast);
}

.ficha-row:last-child {
  border-bottom: none;
}

.ficha-row:hover {
  background: rgba(255, 255, 255, 0.04);
}

.ficha-label {
  color: var(--text-muted);
  font-size: 11.5px;
  font-weight: 400;
}

.ficha-value {
  font-weight: 600;
  text-align: right;
  max-width: 60%;
  word-break: break-word;
  font-size: 12px;
  color: var(--text-primary);
}

/* ── Status Badges ── */
.ficha-status {
  display: inline-flex;
  align-items: center;
  font-size: 9.5px;
  font-weight: 700;
  padding: 2px 9px;
  border-radius: var(--radius-pill);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.ficha-status.ativo        { background: rgba(48, 209, 88, 0.12);  color: #30d158;  border: 1px solid rgba(48, 209, 88, 0.22);  }
.ficha-status.inativo      { background: rgba(255, 69, 58, 0.12);  color: #ff453a;  border: 1px solid rgba(255, 69, 58, 0.22);  }
.ficha-status.em-dia       { background: rgba(0, 210, 160, 0.12);  color: var(--accent); border: 1px solid rgba(0, 210, 160, 0.22); }
.ficha-status.inadimplente { background: rgba(255, 69, 58, 0.12);  color: #ff453a;  border: 1px solid rgba(255, 69, 58, 0.22);  }
.ficha-status.pago         { background: rgba(0, 210, 160, 0.10);  color: var(--accent); border: 1px solid rgba(0, 210, 160, 0.18); }
.ficha-status.pendente     { background: rgba(255, 214, 10, 0.12); color: #ffd60a;  border: 1px solid rgba(255, 214, 10, 0.22); }
.ficha-status.vencido      { background: rgba(255, 69, 58, 0.12);  color: #ff453a;  border: 1px solid rgba(255, 69, 58, 0.22);  }

/* ── Ficha Debits Table ── */
.ficha-debitos-table {
  width: 100%;
  font-size: 11px;
  border-collapse: collapse;
}

.ficha-debitos-table th {
  text-align: left;
  color: var(--text-muted);
  font-weight: 600;
  padding: 6px 12px 8px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  border-bottom: 1px solid var(--border-glass);
}

.ficha-debitos-table td {
  padding: 7px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

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

.ficha-debitos-table tr:hover td {
  background: rgba(255, 255, 255, 0.04);
}

/* ── Ficha Download Button ── */
.ficha-download-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 12px;
  padding: 10px 16px;
  background: var(--gradient-accent);
  color: rgba(0, 0, 0, 0.85);
  text-align: center;
  text-decoration: none;
  border-radius: var(--radius-md);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.01em;
  transition: all var(--duration-base) var(--ease-out);
  box-shadow: 0 3px 16px var(--accent-glow), inset 0 1px 0 rgba(255, 255, 255, 0.20);
}

.ficha-download-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 28px rgba(0, 210, 160, 0.45);
  filter: brightness(1.07);
}

/* ── Ficha Accordion ── */
.ficha-accordion {
  border-bottom: 1px solid var(--border-glass);
}

.ficha-acc-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  cursor: pointer;
  transition: background var(--duration-fast) var(--ease-out);
}

.ficha-acc-header:hover {
  background: rgba(255, 255, 255, 0.05);
}

.ficha-acc-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.dot-ativo   { background: var(--accent);       box-shadow: 0 0 8px var(--accent-glow); }
.dot-inativo { background: var(--color-danger);  box-shadow: 0 0 8px rgba(255, 69, 58, 0.35); }

.ficha-acc-title {
  flex: 1;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -0.01em;
}

.ficha-acc-arrow {
  font-size: 10px;
  color: var(--text-muted);
  flex-shrink: 0;
  transition: transform var(--duration-fast) var(--ease-out);
}

.ficha-acc-body {
  padding: 4px 16px 14px;
}

/* ============================================================
   AUDIO MESSAGES — Waveform player
   ============================================================ */
.message-audio {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: min(220px, 100%);
  padding: 3px 0;
}

.audio-play-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.10);
  color: #fff;
  font-size: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all var(--duration-base) var(--ease-out);
  backdrop-filter: var(--blur-sm);
  -webkit-backdrop-filter: var(--blur-sm);
}

.audio-play-btn::before {
  content: '';
  display: block;
  width: 14px;
  height: 14px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23ffffff'%3E%3Cpolygon points='5 3 19 12 5 21 5 3'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  margin-left: 2px;
}

.audio-play-btn.playing::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23ffffff'%3E%3Crect x='6' y='4' width='4' height='16'/%3E%3Crect x='14' y='4' width='4' height='16'/%3E%3C/svg%3E");
  margin-left: 0;
}

.audio-play-btn:hover {
  background: rgba(0, 210, 160, 0.18);
  border-color: rgba(0, 210, 160, 0.40);
  box-shadow: 0 0 12px var(--accent-glow-sm);
}

.audio-icon {
  line-height: 1;
}

/* Waveform visualization */
.audio-wave {
  flex: 1;
  height: 22px;
  position: relative;
  min-width: 80px;
  background: repeating-linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.18) 0px,
    rgba(255, 255, 255, 0.18) 2px,
    transparent 2px,
    transparent 6px
  );
  border-radius: var(--radius-xs);
  overflow: hidden;
}

.audio-wave::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    transparent 30%,
    rgba(0, 210, 160, 0.45)
  );
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.1s linear;
}

.audio-duration {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.45);
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
  font-weight: 500;
}

.audio-transcribe-btn {
  width: 24px;
  height: 24px;
  border-radius: var(--radius-xs);
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.45);
  font-size: 10px;
  font-weight: 800;
  cursor: pointer;
  flex-shrink: 0;
  transition: all var(--duration-base) var(--ease-out);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
}

.audio-transcribe-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.25);
}

.audio-transcription {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.60);
  font-style: italic;
  padding: 6px 0 2px;
  line-height: 1.5;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  margin-top: 5px;
}

/* ============================================================
   MEDIA MESSAGES
   ============================================================ */
.message-media {
  max-width: 100%;
}

.media-placeholder {
  padding: 28px 20px;
  background: rgba(255, 255, 255, 0.07);
  backdrop-filter: var(--blur-sm);
  -webkit-backdrop-filter: var(--blur-sm);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  text-align: center;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 12px;
  transition: all var(--duration-base) var(--ease-out);
}

.media-placeholder:hover {
  background: rgba(255, 255, 255, 0.10);
  border-color: rgba(0, 210, 160, 0.30);
  color: var(--text-secondary);
}

.media-img {
  max-width: 100%;
  max-height: 300px;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: block;
  border: 1px solid rgba(255, 255, 255, 0.12);
  transition: transform var(--duration-base) var(--ease-out);
}

.media-img:hover {
  transform: scale(1.01);
}

.media-video {
  max-width: 100%;
  max-height: 300px;
  border-radius: var(--radius-md);
  display: block;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

/* ── Document Message ── */
.message-document {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.07);
  backdrop-filter: var(--blur-sm);
  -webkit-backdrop-filter: var(--blur-sm);
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: var(--radius-md);
  min-width: 190px;
  transition: background var(--duration-fast) var(--ease-out);
}

.message-document:hover {
  background: rgba(255, 255, 255, 0.10);
}

.doc-icon {
  font-size: 26px;
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.09);
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.doc-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.doc-name {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-primary);
}

.doc-type {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.4px;
  margin-top: 1px;
}

.doc-download-btn {
  background: rgba(255, 255, 255, 0.09);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-secondary);
  font-size: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--duration-base) var(--ease-out);
}

.doc-download-btn::before {
  content: '';
  display: block;
  width: 14px;
  height: 14px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='rgba(255,255,255,0.45)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4'/%3E%3Cpolyline points='7 10 12 15 17 10'/%3E%3Cline x1='12' y1='15' x2='12' y2='3'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
}

.doc-download-btn:hover {
  background: rgba(0, 210, 160, 0.12);
  border-color: rgba(0, 210, 160, 0.35);
  box-shadow: 0 0 10px var(--accent-glow-sm);
}

.doc-download-btn:hover::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2300d2a0' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4'/%3E%3Cpolyline points='7 10 12 15 17 10'/%3E%3Cline x1='12' y1='15' x2='12' y2='3'/%3E%3C/svg%3E");
}

/* ── Media Fullscreen ── */
.media-fullscreen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.88);
  backdrop-filter: var(--blur-xl);
  -webkit-backdrop-filter: var(--blur-xl);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  cursor: zoom-out;
}

.media-fullscreen img {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg), 0 0 0 1px rgba(255, 255, 255, 0.10);
}

/* ============================================================
   MODAL — Floating glass dialog
   ============================================================ */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: var(--blur-md);
  -webkit-backdrop-filter: var(--blur-md);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
}

.modal-box {
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: var(--blur-xl);
  -webkit-backdrop-filter: var(--blur-xl);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius-xl);
  width: 500px;
  max-width: 90vw;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow:
    0 32px 80px rgba(0, 0, 0, 0.60),
    0 8px 24px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    inset 0 -1px 0 rgba(255, 255, 255, 0.05);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 22px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.10);
  background: rgba(255, 255, 255, 0.05);
}

/* Top edge highlight on modal */
.modal-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.20), transparent);
}

.modal-header h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.modal-header button {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-secondary);
  font-size: 0;
  cursor: pointer;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  transition: all var(--duration-base) var(--ease-out);
}

#resp-modal-close::before {
  content: '';
  display: block;
  width: 14px;
  height: 14px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='rgba(255,255,255,0.45)' stroke-width='2.5' stroke-linecap='round'%3E%3Cline x1='18' y1='6' x2='6' y2='18'/%3E%3Cline x1='6' y1='6' x2='18' y2='18'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
}

.modal-header button:hover {
  background: rgba(255, 69, 58, 0.14);
  border-color: rgba(255, 69, 58, 0.30);
}

#resp-modal-close:hover::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ff453a' stroke-width='2.5' stroke-linecap='round'%3E%3Cline x1='18' y1='6' x2='6' y2='18'/%3E%3Cline x1='6' y1='6' x2='18' y2='18'/%3E%3C/svg%3E");
}

.modal-body {
  padding: 20px 22px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.modal-body label {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  display: block;
  margin-bottom: -6px;
}

.modal-body input,
.modal-body textarea,
.modal-body select {
  padding: 9px 13px;
  background: rgba(255, 255, 255, 0.07);
  backdrop-filter: var(--blur-sm);
  -webkit-backdrop-filter: var(--blur-sm);
  color: var(--text-primary);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-md);
  font-size: 13.5px;
  font-family: inherit;
  transition: all var(--duration-base) var(--ease-out);
}

.modal-body input:focus,
.modal-body textarea:focus,
.modal-body select:focus {
  outline: none;
  border-color: rgba(0, 210, 160, 0.45);
  background: rgba(255, 255, 255, 0.10);
  box-shadow: 0 0 0 3px var(--accent-glow-sm);
}

.modal-body textarea {
  resize: vertical;
  min-height: 80px;
  line-height: 1.5;
}

.modal-body select option {
  background: #1a1f35;
  color: var(--text-primary);
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 22px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
}

.modal-footer button {
  padding: 9px 22px;
  border: none;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all var(--duration-base) var(--ease-out);
  letter-spacing: 0.01em;
}

#resp-modal-cancel {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-secondary);
}

#resp-modal-cancel:hover {
  background: rgba(255, 255, 255, 0.11);
  color: var(--text-primary);
}

#resp-modal-save {
  background: var(--gradient-accent);
  color: rgba(0, 0, 0, 0.85);
  box-shadow: 0 3px 14px var(--accent-glow), inset 0 1px 0 rgba(255, 255, 255, 0.20);
}

#resp-modal-save:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(0, 210, 160, 0.45);
  filter: brightness(1.07);
}

/* ── Resp Steps ── */
.resp-steps {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.resp-step {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: var(--radius-md);
  padding: 12px;
  position: relative;
  transition: border-color var(--duration-fast);
}

.resp-step:focus-within {
  border-color: rgba(0, 210, 160, 0.35);
}

.resp-step-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.resp-step-num {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--accent);
  background: rgba(0, 210, 160, 0.12);
  border: 1px solid rgba(0, 210, 160, 0.22);
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.resp-step-tipo {
  font-size: 10.5px;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.4px;
}

.resp-step-actions {
  margin-left: auto;
  display: flex;
  gap: 4px;
}

.resp-step-actions button {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 13px;
  cursor: pointer;
  padding: 3px 5px;
  border-radius: var(--radius-xs);
  transition: all var(--duration-fast);
}

.resp-step-actions button:hover {
  background: rgba(255, 255, 255, 0.07);
  color: var(--text-primary);
}

.resp-step-delete:hover {
  color: var(--color-danger) !important;
}

.resp-step textarea {
  width: 100%;
  padding: 7px 10px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-family: inherit;
  resize: vertical;
  min-height: 50px;
  transition: all var(--duration-base) var(--ease-out);
  line-height: 1.5;
}

.resp-step textarea:focus {
  outline: none;
  border-color: rgba(0, 210, 160, 0.40);
  box-shadow: 0 0 0 2px var(--accent-glow-sm);
}

.resp-step-file {
  border: 1px dashed rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-sm);
  padding: 14px;
  text-align: center;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
  transition: all var(--duration-base) var(--ease-out);
}

.resp-step-file:hover {
  border-color: rgba(0, 210, 160, 0.40);
  background: rgba(0, 210, 160, 0.06);
  color: var(--accent);
}

.resp-step-file.has-file {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(0, 210, 160, 0.07);
}

/* ── Add Step Buttons ── */
.resp-add-step-btns {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.resp-add-btn {
  padding: 6px 14px;
  border: 1px dashed rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-muted);
  border-radius: var(--radius-md);
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all var(--duration-base) var(--ease-out);
}

.resp-add-btn:hover {
  border-color: rgba(0, 210, 160, 0.40);
  background: rgba(0, 210, 160, 0.07);
  color: var(--accent);
}

/* ── Tipo Buttons ── */
.resp-tipo-btns {
  display: flex;
  gap: 6px;
}

.resp-tipo-btn {
  flex: 1;
  padding: 7px 0;
  border: 1px solid rgba(255, 255, 255, 0.10);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all var(--duration-base) var(--ease-out);
}

.resp-tipo-btn:hover {
  border-color: rgba(0, 210, 160, 0.30);
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.08);
}

.resp-tipo-btn.active {
  background: var(--gradient-accent);
  color: rgba(0, 0, 0, 0.85);
  border-color: transparent;
  box-shadow: 0 2px 10px var(--accent-glow), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

/* ── File Drop ── */
.resp-file-drop {
  border: 2px dashed rgba(255, 255, 255, 0.14);
  border-radius: var(--radius-md);
  padding: 24px;
  text-align: center;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  transition: all var(--duration-base) var(--ease-out);
}

.resp-file-drop:hover {
  border-color: rgba(0, 210, 160, 0.38);
  color: var(--text-secondary);
  background: rgba(0, 210, 160, 0.05);
}

.resp-file-drop.has-file {
  border-color: var(--accent);
  background: rgba(0, 210, 160, 0.07);
  color: var(--accent);
}

/* ── Respostas Form (inline) ── */
.respostas-form {
  padding: 10px 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: rgba(255, 255, 255, 0.03);
}

.respostas-form input,
.respostas-form textarea,
.respostas-form select {
  padding: 7px 11px;
  background: rgba(255, 255, 255, 0.07);
  color: var(--text-primary);
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-family: inherit;
  resize: vertical;
  transition: all var(--duration-base) var(--ease-out);
}

.respostas-form input:focus,
.respostas-form textarea:focus {
  outline: none;
  border-color: rgba(0, 210, 160, 0.40);
  box-shadow: 0 0 0 2px var(--accent-glow-sm);
}

.respostas-form-actions {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
}

.respostas-form-actions button {
  padding: 6px 16px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all var(--duration-base) var(--ease-out);
}

#resp-cancelar {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.11);
  color: var(--text-secondary);
}

#resp-cancelar:hover {
  background: rgba(255, 255, 255, 0.11);
  color: var(--text-primary);
}

#resp-salvar {
  background: var(--gradient-accent);
  color: rgba(0, 0, 0, 0.85);
  box-shadow: 0 2px 10px var(--accent-glow);
}

#resp-salvar:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 18px rgba(0, 210, 160, 0.42);
  filter: brightness(1.07);
}

/* ============================================================
   RESPONSIVE — Mobile first
   ============================================================ */
@media (max-width: 768px) {
  #sidebar {
    width: 100%;
    min-width: 100%;
    position: absolute;
    z-index: 10;
    height: 100vh;
    backdrop-filter: var(--blur-lg);
    -webkit-backdrop-filter: var(--blur-lg);
  }

  #app.chat-open #sidebar {
    display: none;
  }

  #app.chat-open #chat-area {
    width: 100%;
  }

  #app {
    position: relative;
  }

  #messages-container {
    padding: 14px 16px;
  }

  .chat-header {
    cursor: pointer;
  }

  .ficha-panel {
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    min-width: 100%;
    height: 100vh;
    z-index: 15;
    backdrop-filter: var(--blur-xl);
    -webkit-backdrop-filter: var(--blur-xl);
  }

  .modal-box {
    width: 95vw;
    max-height: 90vh;
    border-radius: var(--radius-lg);
  }

  .message {
    max-width: 82%;
  }

  #messages-container {
    padding: 12px 12px;
  }

  .chat-cadastro {
    display: none;
  }
}

@media (max-width: 480px) {
  .sidebar-header h2 {
    font-size: 15px;
  }

  .message-input-area {
    padding: 8px 10px 10px;
    gap: 6px;
  }

  #respostas-btn,
  #attach-btn,
  #mic-btn {
    width: 34px;
    height: 34px;
  }

  .chat-header {
    padding: 10px 14px;
  }

  .resolve-btn {
    padding: 6px 12px;
    font-size: 11px;
  }
}
