/* ── Reset & Base ─────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --navy:       #0B0F2E;
  --navy-mid:   #111540;
  --navy-card:  #161A45;
  --navy-light: #1E2355;
  --border:     rgba(255,255,255,0.08);
  --border-hover: rgba(255,255,255,0.18);
  --blue:       #8B5CF6;
  --blue-dark:  #7C3AED;
  --green:      #22C55E;
  --red:        #EF4444;
  --yellow:     #F59E0B;
  --text:       #E8EAF6;
  --text-dim:   rgba(232,234,246,0.55);
  --text-faint: rgba(232,234,246,0.30);
  --radius:     10px;
  --radius-sm:  6px;
  --header-h:   56px;
  --sidebar-w:  220px;
}

html, body { height: 100%; overflow: hidden; }

body {
  font-family: 'Inter', sans-serif;
  background: var(--navy);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
}

/* ── Light Mode ───────────────────────────────────────────────────────────── */

body.light-mode {
  --navy:         #F1F3FA;
  --navy-mid:     #FFFFFF;
  --navy-card:    #FFFFFF;
  --navy-light:   #E4E8F5;
  --border:       rgba(0,0,0,0.09);
  --border-hover: rgba(0,0,0,0.22);
  --text:         #111537;
  --text-dim:     rgba(17,21,55,0.62);
  --text-faint:   rgba(17,21,55,0.38);
}

body.light-mode .header {
  background: #FFFFFF;
  border-bottom-color: rgba(0,0,0,0.08);
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

body.light-mode .nav-sidebar {
  background: #F8F9FE;
  border-right-color: rgba(0,0,0,0.08);
}

body.light-mode .nav-section-label { color: rgba(17,21,55,0.35); }
html.light-mode body.login-page { background: #f1f3fa; }
html.light-mode .login-brand-panel { background: #1a0a3d; }
html.light-mode .login-form-panel { background: #f1f3fa; }
html.light-mode .login-card { background: transparent; }
html.light-mode .login-brand-name { color: #111537; }
html.light-mode .login-subtitle { color: rgba(17,21,55,0.55); }
html.light-mode .field input { background: #f1f3fa; border-color: rgba(0,0,0,0.1); color: #111537; }
html.light-mode .field label { color: rgba(17,21,55,0.55); }

body.light-mode .code-block,
body.light-mode .code-block-inline,
body.light-mode .req-code-block {
  background: #F0F2FA;
  color: #2a3060;
  border-color: rgba(0,0,0,0.08);
}

body.light-mode .chat-input-area { background: #FFFFFF; }
body.light-mode .chat-msg-assistant .msg-bubble {
  background: #F0F2FA;
  border-color: rgba(0,0,0,0.08);
}
body.light-mode .chat-msg-user .msg-bubble { background: var(--blue); color: #fff; }

body.light-mode .modal-box { background: #FFFFFF; }
body.light-mode .modal-input { background: #F1F3FA; }

body.light-mode .req-result-header { background: #F8F9FE; }
body.light-mode .req-result { background: #FFFFFF; }

body.light-mode .drop-zone-big { background: #F8F9FE; }

body.light-mode .ai-box {
  background: rgba(139,92,246,0.05);
  border-color: rgba(139,92,246,0.18);
}

/* Toggle button */
.btn-theme {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: transparent;
  color: var(--text-dim);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s;
  flex-shrink: 0;
}
.btn-theme:hover { color: var(--text); border-color: var(--border-hover); }
body.light-mode .header-logo { filter: brightness(0) saturate(100%); }
.btn-theme .icon-sun  { display: none; }
.btn-theme .icon-moon { display: block; }
body.light-mode .btn-theme .icon-sun  { display: block; }
body.light-mode .btn-theme .icon-moon { display: none; }

/* ── Login Page ───────────────────────────────────────────────────────────── */

body.login-page {
  display: flex;
  min-height: 100vh;
  overflow: hidden;
  background: var(--navy);
}

.login-split {
  display: flex;
  width: 100%;
  min-height: 100vh;
}

.login-brand-panel {
  flex: 0 0 55%;
  position: relative;
  overflow: hidden;
  background: #12053a;
}

.login-brand-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}

.login-form-panel {
  flex: 0 0 45%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 40px;
  background: var(--navy);
  position: relative;
}

.login-card {
  background: transparent;
  width: 100%;
  max-width: 360px;
}

.login-sofia-mark {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 1px;
  margin-bottom: 12px;
}
.sofia-logo-s {
  font-size: 52px;
  font-weight: 800;
  color: var(--blue);
  line-height: 1;
  font-family: 'Inter', sans-serif;
  letter-spacing: -2px;
}
.sofia-logo-plus {
  font-size: 26px;
  font-weight: 700;
  color: var(--blue);
  line-height: 1;
  margin-bottom: 18px;
}

.login-brand-name {
  text-align: center;
  font-size: 28px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
  margin-top: 0;
  letter-spacing: -0.5px;
}

.login-footer-brand {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 36px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}
.login-footer-by {
  font-size: 12px;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  flex-shrink: 0;
}
.login-footer-logo {
  height: 68px;
  width: auto;
  opacity: 0.92;
  filter: brightness(0) invert(1);
  transition: opacity 0.2s;
}
.login-footer-logo:hover { opacity: 1; }
html.light-mode .login-footer-logo {
  filter: brightness(0);
  opacity: 0.6;
}

.login-subtitle {
  text-align: center;
  color: var(--text-dim);
  font-size: 13px;
  margin-bottom: 32px;
}

.field { margin-bottom: 16px; }
.field label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-dim);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.field input {
  width: 100%;
  padding: 10px 14px;
  background: var(--navy-light);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s;
}
.field input:focus { border-color: var(--blue); }

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 18px;
  background: var(--blue);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, opacity 0.15s;
}
.btn-primary:hover { background: var(--blue-dark); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-full { width: 100%; justify-content: center; margin-top: 8px; }

.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: transparent;
  color: var(--text-dim);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}
.btn-ghost:hover { border-color: var(--border-hover); color: var(--text); }

.error-msg {
  background: rgba(239,68,68,0.12);
  border: 1px solid rgba(239,68,68,0.3);
  color: #fca5a5;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  margin-bottom: 12px;
}
.hidden { display: none !important; }

/* ── Header ───────────────────────────────────────────────────────────────── */

.header {
  height: var(--header-h);
  background: var(--navy-mid);
  border-bottom: 1px solid var(--border);
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  padding: 0 20px;
  gap: 16px;
}

.logo-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.header-logo {
  height: 32px;
  width: auto;
}

.header-tagline {
  font-size: 11px;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

/* ── App Layout ───────────────────────────────────────────────────────────── */

.app-layout {
  display: flex;
  margin-top: var(--header-h);
  height: calc(100vh - var(--header-h));
}

.nav-sidebar {
  width: var(--sidebar-w);
  background: var(--navy-mid);
  border-right: 1px solid var(--border);
  flex-shrink: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  padding: 16px 0 24px;
}

.nav-section {
  padding: 0 10px;
  margin-bottom: 4px;
}

.nav-section-label {
  display: block;
  font-size: 10px;
  font-weight: 600;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.9px;
  padding: 10px 8px 5px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 8px 10px;
  background: transparent;
  color: var(--text-dim);
  border: none;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s, color 0.15s;
}
.nav-item:hover { background: var(--navy-light); color: var(--text); }
.nav-item.active { background: rgba(139,92,246,0.12); color: var(--blue); }
.nav-item svg { flex-shrink: 0; }

.app-content {
  flex: 1;
  overflow: hidden;
  min-width: 0;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: flex-end;
}

.user-badge {
  font-size: 12px;
  color: var(--text-dim);
  padding: 4px 10px;
  background: var(--navy-light);
  border-radius: 20px;
}

.btn-logout {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  background: transparent;
  color: var(--text-dim);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s;
}
.btn-logout:hover { color: var(--red); border-color: rgba(239,68,68,0.4); }

/* ── Pages ────────────────────────────────────────────────────────────────── */

.page {
  height: 100%;
  overflow: hidden;
}
.page.hidden { display: none; }

/* ── Procedure Analyser Layout ────────────────────────────────────────────── */

.page-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  height: 100%;
}

/* Sidebar */
.sidebar {
  background: var(--navy-mid);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sidebar-head {
  padding: 16px;
  border-bottom: 1px solid var(--border);
}

.sidebar-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 10px;
}

.search-wrap {
  position: relative;
}
.search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-faint);
  pointer-events: none;
}
.input-search {
  width: 100%;
  padding: 8px 10px 8px 32px;
  background: var(--navy-light);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 13px;
  outline: none;
}
.input-search:focus { border-color: var(--blue); }

.proc-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
}

.proc-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.1s;
  gap: 6px;
}
.proc-item:hover { background: var(--navy-light); }
.proc-item.active { background: rgba(139,92,246,0.15); }
.proc-item.in-compare { border-left: 2px solid var(--blue); }

.proc-item-name {
  font-size: 12.5px;
  font-family: 'JetBrains Mono', monospace;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.badge-compare {
  font-size: 10px;
  padding: 2px 5px;
  background: rgba(139,92,246,0.2);
  color: var(--blue);
  border-radius: 4px;
  flex-shrink: 0;
}

.list-empty, .list-loading {
  padding: 24px 12px;
  text-align: center;
  color: var(--text-faint);
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

/* Content area */
.content-area {
  padding: 24px;
  overflow-y: auto;
  height: 100%;
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 60%;
  gap: 12px;
  color: var(--text-faint);
  text-align: center;
}
.empty-state h3 { font-size: 18px; color: var(--text-dim); }
.empty-state p  { font-size: 13px; max-width: 360px; }

/* Procedure view */
.proc-view-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 16px;
  gap: 16px;
}
.proc-name {
  font-size: 18px;
  font-weight: 600;
  font-family: 'JetBrains Mono', monospace;
}
.proc-meta {
  font-size: 12px;
  color: var(--text-faint);
  display: block;
  margin-top: 4px;
}

.code-block {
  background: var(--navy-mid);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12.5px;
  line-height: 1.7;
  overflow-x: auto;
  white-space: pre;
  color: #a8b4d8;
}

/* Compare view */
.compare-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.compare-head h2 { font-size: 16px; font-weight: 600; }

.compare-slots {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 12px;
  align-items: center;
  margin-bottom: 16px;
}

.compare-slot {
  background: var(--navy-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  position: relative;
}
.slot-label {
  font-size: 11px;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}
.slot-name {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  color: var(--text);
}
.slot-remove {
  position: absolute;
  top: 8px; right: 10px;
  background: none;
  border: none;
  color: var(--text-faint);
  font-size: 18px;
  cursor: pointer;
  line-height: 1;
}
.slot-remove:hover { color: var(--red); }

.compare-vs {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-faint);
  text-align: center;
}

.btn-compare {
  width: 100%;
  justify-content: center;
  padding: 12px;
  font-size: 14px;
  margin-bottom: 20px;
}

/* Code tabs */
.code-tabs {
  margin-bottom: 16px;
}

.code-tab-bar {
  display: flex;
  gap: 4px;
  margin-bottom: 0;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0;
}

.code-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: transparent;
  border: 1px solid transparent;
  border-bottom: none;
  border-radius: 6px 6px 0 0;
  color: var(--text-dim);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s;
  position: relative;
  bottom: -1px;
}
.code-tab-btn:hover { color: var(--text); background: var(--navy-light); }
.code-tab-btn.active {
  color: var(--text);
  background: var(--navy-mid);
  border-color: var(--border);
  border-bottom-color: var(--navy-mid);
}

.code-tab-panel {
  display: none;
  border-radius: 0 6px 6px 6px;
  max-height: 380px;
  overflow-y: auto;
  font-size: 12px;
}
.code-tab-panel.active { display: block; }

.code-block-sm {
  font-size: 11.5px;
  max-height: 300px;
  overflow-y: auto;
}

.ai-box {
  background: rgba(139,92,246,0.06);
  border: 1px solid rgba(139,92,246,0.2);
  border-radius: var(--radius);
  padding: 20px;
}
.ai-box-title {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 600;
  color: var(--blue);
  margin-bottom: 14px;
}
.ai-content { font-size: 13.5px; line-height: 1.7; }

/* Compare loading */
.compare-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 32px;
  color: var(--text-dim);
}

/* ── Procedure Analyser guided layout ─────────────────────────────────────── */

.pa-layout {
  height: 100%;
  overflow-y: auto;
  padding: 32px 40px;
  box-sizing: border-box;
}

/* Home: escolha o modo */
.pa-home-title {
  font-size: 13px;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 16px;
}

.pa-mode-cards {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 680px;
}

.pa-mode-card {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 20px 22px;
  background: var(--navy-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s, background 0.15s, transform 0.1s;
  width: 100%;
}
.pa-mode-card:hover {
  border-color: var(--border-hover);
  background: var(--navy-light);
  transform: translateX(3px);
}

.pa-mode-icon {
  width: 52px; height: 52px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.pa-mode-icon-blue   { background: rgba(139,92,246,0.15); color: var(--blue); }
.pa-mode-icon-purple { background: rgba(139,92,246,0.15); color: #a78bfa; }

.pa-mode-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.pa-mode-label { font-size: 15px; font-weight: 600; color: var(--text); }
.pa-mode-desc  { font-size: 12.5px; color: var(--text-dim); line-height: 1.5; }
.pa-mode-arrow { color: var(--text-faint); flex-shrink: 0; }

/* Flow container */
.pa-flow { height: 100%; }

.pa-flow-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 28px;
}

.btn-back {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 12px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-dim);
  font-size: 12.5px;
  cursor: pointer;
  transition: all 0.15s;
  flex-shrink: 0;
}
.btn-back:hover { border-color: var(--border-hover); color: var(--text); }

.pa-flow-title {
  display: flex;
  align-items: center;
  gap: 10px;
}
.pa-flow-title h2 { font-size: 18px; font-weight: 600; }

.pa-flow-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.pa-flow-badge-blue   { background: rgba(139,92,246,0.15); color: var(--blue); }
.pa-flow-badge-purple { background: rgba(139,92,246,0.15); color: #a78bfa; }

/* Step indicator */
.pa-step { max-width: 100%; }

.step-indicator {
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: 28px;
}
.step-dot {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--navy-light);
  border: 2px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-faint);
  flex-shrink: 0;
  transition: all 0.2s;
}
.step-dot.active { border-color: var(--blue); color: var(--blue); background: rgba(139,92,246,0.12); }
.step-dot.done   { border-color: var(--green); color: var(--green); background: rgba(34,197,94,0.1); }
.step-line {
  flex: 1;
  height: 2px;
  background: var(--border);
}
.step-line-done { background: var(--green); }

.step-content { }
.step-title { font-size: 17px; font-weight: 600; margin-bottom: 6px; }
.step-desc  { font-size: 13px; color: var(--text-dim); margin-bottom: 20px; }

.step-loading-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 48px;
  text-align: center;
}

/* Drop zone big */
.drop-zone-big {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 48px 32px;
  background: var(--navy-card);
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  color: var(--text-dim);
  width: 100%;
}
.drop-zone-big:hover, .drop-zone-big.dragging {
  border-color: var(--blue);
  background: rgba(139,92,246,0.05);
  color: var(--blue);
}
.drop-zone-title { font-size: 15px; font-weight: 500; }
.drop-zone-sub   { font-size: 12px; color: var(--text-faint); }
.drop-zone-hint  { font-size: 12px; color: var(--text-faint); }

/* Upload confirm */
.upload-confirm {
  margin-top: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: var(--navy-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  gap: 16px;
}
.upload-confirm-file {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  color: var(--text);
}
.upload-confirm-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

/* Result title row */
.result-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

/* Compare guided layout */
.compare-guide-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 20px;
  height: calc(100vh - var(--header-h) - 120px);
  overflow: hidden;
}

.compare-work-area {
  overflow-y: auto;
  padding-right: 4px;
}

.compare-slots-guide {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 12px;
  align-items: center;
  margin-bottom: 16px;
}

.compare-slot-guide {
  background: var(--navy-card);
  border: 1.5px dashed var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  position: relative;
  transition: border-color 0.15s;
  min-height: 80px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.compare-slot-guide.filled { border-style: solid; border-color: var(--border-hover); }

.slot-guide-label {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.slot-guide-name {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  font-weight: 600;
}
.slot-placeholder {
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 400;
  color: var(--text-faint);
}

.slot-letter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px; height: 20px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}
.slot-letter-a { background: rgba(139,92,246,0.2); color: var(--blue); }
.slot-letter-b { background: rgba(139,92,246,0.2); color: #a78bfa; }

.compare-vs-badge {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-faint);
  text-align: center;
  padding: 0 4px;
}

.sidebar-hint {
  font-size: 12px;
  color: var(--text-faint);
  margin-bottom: 10px;
  line-height: 1.4;
}

.compare-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 32px;
  color: var(--text-dim);
}

/* ── Modificadas Recentemente ─────────────────────────────────────────────── */

.recent-layout {
  height: 100%;
  overflow-y: auto;
  padding: 32px 40px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.recent-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.recent-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
}

.recent-subtitle {
  font-size: 12px;
  color: var(--text-faint);
  margin-top: 2px;
}

.recent-filters {
  display: flex;
  gap: 6px;
}

.filter-btn {
  padding: 6px 14px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 20px;
  color: var(--text-dim);
  font-size: 12.5px;
  cursor: pointer;
  transition: all 0.15s;
}
.filter-btn:hover { border-color: var(--border-hover); color: var(--text); }
.filter-btn.active { background: var(--blue); border-color: var(--blue); color: #fff; }

.recent-loading, .recent-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 60px 0;
  color: var(--text-faint);
  font-size: 13px;
}

.recent-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.recent-card {
  display: flex;
  flex-direction: column;
  background: var(--navy-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.recent-card-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
}

.review-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.recent-card-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.recent-card-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.recent-card-date {
  font-size: 11.5px;
  color: var(--text-faint);
}

.recent-card-result {
  border-top: 1px solid var(--border);
  padding: 12px 20px;
}

.result-inner {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.result-inner-detail {
  flex-direction: column;
  gap: 12px;
}

.result-detail-header {
  display: flex;
  align-items: center;
  gap: 10px;
}

.result-detail-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--yellow);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  flex: 1;
}

.detail-analysis {
  font-size: 13px;
  line-height: 1.7;
  color: var(--text-dim);
}

.status-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  flex-shrink: 0;
  margin-top: 1px;
}
.status-ok      { background: rgba(34,197,94,0.15);  color: #4ade80; }
.status-atencao { background: rgba(245,158,11,0.15); color: #fbbf24; }
.status-problema{ background: rgba(239,68,68,0.15);  color: #f87171; }

.status-resumo {
  font-size: 13px;
  color: var(--text-dim);
  flex: 1;
  line-height: 1.5;
}

.btn-close-result {
  background: transparent;
  border: none;
  color: var(--text-faint);
  cursor: pointer;
  padding: 2px;
  display: flex;
  align-items: center;
  flex-shrink: 0;
  transition: color 0.15s;
}
.btn-close-result:hover { color: var(--text); }

.btn-review {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-dim);
  font-size: 12.5px;
  cursor: pointer;
  transition: all 0.15s;
  flex-shrink: 0;
  white-space: nowrap;
}
.btn-review:hover:not(:disabled) { border-color: var(--blue); color: var(--blue); }
.btn-review:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-review-detail { border-color: rgba(245,158,11,0.3); color: var(--yellow); }
.btn-review-detail:hover:not(:disabled) { border-color: var(--yellow); color: var(--yellow); background: rgba(245,158,11,0.06); }

.recent-error {
  color: #f87171;
  font-size: 13px;
  padding: 16px;
}

/* ── Chat Layout ──────────────────────────────────────────────────────────── */

.chat-layout {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 24px 40px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.chat-welcome {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: auto 0;
  text-align: center;
  color: var(--text-dim);
  padding: 48px 0;
}
.chat-welcome svg { color: var(--text-faint); }
.chat-welcome h3 { font-size: 20px; color: var(--text); }
.chat-welcome p  { font-size: 13px; color: var(--text-dim); }

.chat-examples {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-top: 8px;
}
.chat-example {
  padding: 8px 14px;
  background: var(--navy-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  color: var(--text-dim);
  font-size: 12.5px;
  cursor: pointer;
  transition: all 0.15s;
}
.chat-example:hover { border-color: var(--blue); color: var(--blue); }

.chat-msg {
  max-width: 820px;
}
.chat-msg-user { align-self: flex-end; }
.chat-msg-assistant, .chat-msg-error { align-self: flex-start; }

.msg-bubble {
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 13.5px;
  line-height: 1.7;
}
.chat-msg-user .msg-bubble {
  background: var(--blue);
  color: #fff;
  border-bottom-right-radius: 4px;
}
.chat-msg-assistant .msg-bubble {
  background: var(--navy-card);
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
}
.msg-error {
  background: rgba(239,68,68,0.1);
  border: 1px solid rgba(239,68,68,0.25);
  color: #fca5a5;
}

/* Loading dots */
.msg-loading {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 14px 16px;
}
.msg-loading span {
  width: 7px; height: 7px;
  background: var(--text-dim);
  border-radius: 50%;
  animation: dots 1.2s ease-in-out infinite;
}
.msg-loading span:nth-child(2) { animation-delay: 0.2s; }
.msg-loading span:nth-child(3) { animation-delay: 0.4s; }
.loading-status {
  font-size: 11px;
  color: var(--text-faint);
  margin-left: 6px;
  font-style: italic;
  animation: none;
  width: auto;
  height: auto;
  background: none;
  border-radius: 0;
}
@keyframes dots {
  0%, 80%, 100% { opacity: 0.3; transform: scale(0.8); }
  40%            { opacity: 1;   transform: scale(1); }
}

/* Chat input */
.chat-input-area {
  border-top: 1px solid var(--border);
  padding: 16px 40px;
  background: var(--navy-mid);
}
.chat-input-wrap {
  display: flex;
  gap: 10px;
  align-items: flex-end;
}
.chat-input {
  flex: 1;
  padding: 12px 16px;
  background: var(--navy-light);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  font-size: 14px;
  font-family: 'Inter', sans-serif;
  resize: none;
  outline: none;
  min-height: 44px;
  max-height: 160px;
  overflow-y: auto;
  transition: border-color 0.15s;
}
.chat-input:focus { border-color: var(--blue); }
.chat-send {
  width: 44px; height: 44px;
  background: var(--blue);
  border: none;
  border-radius: 10px;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s, opacity 0.15s;
}
.chat-send:hover { background: var(--blue-dark); }
.chat-send:disabled { opacity: 0.4; cursor: not-allowed; }

.chat-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
}

.chat-disclaimer {
  font-size: 11px;
  color: var(--text-faint);
}

.btn-clear-chat {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-faint);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s;
}
.btn-clear-chat:hover { color: var(--red); border-color: rgba(239,68,68,0.4); }

/* ── Markdown rendered content ────────────────────────────────────────────── */

.ai-content h1, .ai-content h2, .ai-content h3,
.msg-bubble h1, .msg-bubble h2, .msg-bubble h3 {
  font-weight: 600;
  margin: 12px 0 6px;
  color: var(--text);
}
.ai-content h1, .msg-bubble h1 { font-size: 16px; }
.ai-content h2, .msg-bubble h2 { font-size: 15px; }
.ai-content h3, .msg-bubble h3 { font-size: 14px; }

.ai-content p, .msg-bubble p { margin: 6px 0; }

.ai-content ul, .msg-bubble ul { padding-left: 20px; margin: 6px 0; }
.ai-content li, .msg-bubble li { margin: 3px 0; }

.ai-content code, .msg-bubble code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  background: rgba(255,255,255,0.08);
  padding: 1px 5px;
  border-radius: 3px;
}

.code-block-inline {
  background: var(--navy-mid);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  overflow-x: auto;
  margin: 8px 0;
  white-space: pre;
  color: #a8b4d8;
}

.md-table-wrap {
  overflow-x: auto;
  margin: 12px 0;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}
.md-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.md-table th {
  padding: 10px 14px;
  background: var(--navy-light);
  font-weight: 600;
  color: var(--text-dim);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  text-align: left;
  white-space: nowrap;
  border-bottom: 1px solid var(--border);
}
.md-table td {
  padding: 9px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  text-align: left;
  white-space: nowrap;
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.md-table tbody tr:last-child td { border-bottom: none; }
.md-table tbody tr:hover td { background: rgba(255,255,255,0.03); }

/* ── Dashboard ────────────────────────────────────────────────────────────── */

.dash-layout {
  height: 100%;
  overflow-y: auto;
  padding: 28px 36px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.dash-welcome {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.dash-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--text);
}

.dash-date {
  font-size: 12px;
  color: var(--text-faint);
  margin-top: 3px;
  text-transform: capitalize;
}

.dash-refresh {
  font-size: 12px;
  padding: 6px 12px;
  gap: 6px;
}
.dash-refresh svg { transition: transform 0.6s ease; }
.dash-refresh.refreshing svg { animation: spin-once 0.6s ease; }

@keyframes spin-once {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

.dash-card { transition: opacity 0.25s, transform 0.25s; }
.dash-card-pulse {
  animation: card-pulse 0.45s ease;
}
@keyframes card-pulse {
  0%   { opacity: 1;    transform: scale(1); }
  40%  { opacity: 0.55; transform: scale(0.98); }
  100% { opacity: 1;    transform: scale(1); }
}

/* Cards */
.dash-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.dash-card {
  background: var(--navy-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: border-color 0.15s;
}
.dash-card:hover { border-color: var(--border-hover); }

.dash-card-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.dash-icon-blue   { background: rgba(139,92,246,0.12);  color: var(--blue); }
.dash-icon-yellow { background: rgba(245,158,11,0.12);  color: var(--yellow); }
.dash-icon-green  { background: rgba(34,197,94,0.12);   color: var(--green); }
.dash-icon-red    { background: rgba(239,68,68,0.12);   color: var(--red); }
.dash-icon-purple { background: rgba(139,92,246,0.12);  color: #a78bfa; }

.dash-card-body {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.dash-card-value {
  font-size: 26px;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
  display: flex;
  align-items: center;
}

.dash-card-label {
  font-size: 12px;
  color: var(--text-faint);
}

/* Recent section */
.dash-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
  min-height: 0;
}

.dash-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.dash-section-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.dash-link {
  font-size: 12px;
  padding: 5px 10px;
  gap: 4px;
  color: var(--text-faint);
}

.dash-recent-list {
  background: var(--navy-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  flex: 1;
}

.dash-recent-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 18px;
  border-bottom: 1px solid var(--border);
  transition: background 0.1s;
  gap: 12px;
}
.dash-recent-row:last-child { border-bottom: none; }
.dash-recent-row:hover { background: var(--navy-light); }

.dash-recent-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.dash-recent-name {
  font-size: 13px;
  font-weight: 500;
  font-family: 'JetBrains Mono', monospace;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dash-recent-date {
  font-size: 11px;
  color: var(--text-faint);
}

.dash-goto {
  padding: 5px 8px;
  flex-shrink: 0;
  color: var(--text-faint);
  border-color: transparent;
}
.dash-goto:hover { color: var(--blue); border-color: var(--border); }

.dash-loading {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 32px;
  color: var(--text-faint);
  font-size: 13px;
}

.dash-empty {
  padding: 32px;
  text-align: center;
  color: var(--text-faint);
  font-size: 13px;
}

/* ── Solicitar Alteração ──────────────────────────────────────────────────── */

.req-layout {
  height: 100%;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  padding: 24px 32px 0;
  gap: 16px;
  overflow: hidden;
}

.req-title  { font-size: 18px; font-weight: 600; color: var(--text); }
.req-subtitle { font-size: 13px; color: var(--text-dim); margin-top: 4px; }

.req-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex-shrink: 0;
}

.req-textarea {
  width: 100%;
  height: 140px;
  padding: 16px;
  background: var(--navy-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 14px;
  font-family: 'Inter', sans-serif;
  resize: none;
  outline: none;
  line-height: 1.65;
  transition: border-color 0.15s;
  box-sizing: border-box;
}
.req-textarea:focus { border-color: var(--blue); }
.req-textarea::placeholder { color: var(--text-faint); }

.req-form-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.req-hint {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--text-faint);
}

.req-result {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: var(--navy-card);
  border: 1px solid var(--border);
  border-radius: var(--radius) var(--radius) 0 0;
  overflow: hidden;
}
.req-result.hidden { display: none; }

.req-result-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  border-bottom: 1px solid var(--border);
  background: var(--navy-mid);
  flex-shrink: 0;
}

.req-result-title {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 600;
  color: var(--blue);
}

.req-result-actions { display: flex; gap: 8px; }

.req-result-content {
  flex: 1;
  overflow-y: auto;
  padding: 0;
}

.req-code-block {
  margin: 0;
  border: none;
  border-radius: 0;
  min-height: 100%;
  padding: 20px 24px;
  font-size: 13px;
  line-height: 1.7;
}

/* ── Solicitar Alteração — empty state ────────────────────────────────────── */

.empty-page-layout {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  gap: 14px;
  color: var(--text-dim);
  text-align: center;
  padding: 40px;
}

.empty-page-icon {
  width: 72px;
  height: 72px;
  border-radius: 20px;
  background: rgba(139,92,246,0.08);
  border: 1px solid rgba(139,92,246,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--blue);
  margin-bottom: 4px;
}

.empty-page-layout h2 {
  font-size: 20px;
  font-weight: 600;
  color: var(--text);
}

.empty-page-layout p {
  font-size: 13px;
  color: var(--text-dim);
  max-width: 380px;
  line-height: 1.6;
}

.coming-soon-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 4px 12px;
  background: rgba(245,158,11,0.12);
  color: var(--yellow);
  border: 1px solid rgba(245,158,11,0.25);
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ── Spinners ─────────────────────────────────────────────────────────────── */

.spinner {
  width: 28px; height: 28px;
  border: 3px solid var(--border);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
.spinner-sm {
  width: 14px; height: 14px;
  border: 2px solid var(--border);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Modal: Análise Detalhada ─────────────────────────────────────────────── */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(3px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal-overlay.hidden { display: none; }

.modal-box {
  background: var(--navy-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 28px 32px;
  width: 420px;
  box-shadow: 0 24px 64px rgba(0,0,0,0.6);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.modal-header {
  display: flex;
  align-items: center;
  gap: 14px;
}

.modal-header-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: rgba(245,158,11,0.12);
  border: 1px solid rgba(245,158,11,0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--yellow);
  flex-shrink: 0;
}

.modal-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}

.modal-subtitle {
  font-size: 12px;
  font-family: 'JetBrains Mono', monospace;
  color: var(--text-faint);
  margin-top: 2px;
}

.modal-desc {
  font-size: 13px;
  color: var(--text-dim);
  line-height: 1.6;
}

.modal-input {
  width: 100%;
  padding: 10px 14px;
  background: var(--navy-light);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s;
}
.modal-input:focus { border-color: var(--yellow); }

.modal-error {
  font-size: 12.5px;
  color: #f87171;
  padding: 8px 12px;
  background: rgba(239,68,68,0.08);
  border: 1px solid rgba(239,68,68,0.2);
  border-radius: var(--radius-sm);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 4px;
}

.btn-detail-confirm {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  background: rgba(245,158,11,0.15);
  color: var(--yellow);
  border: 1px solid rgba(245,158,11,0.35);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}
.btn-detail-confirm:hover { background: rgba(245,158,11,0.25); border-color: var(--yellow); }
.btn-detail-confirm:disabled { opacity: 0.5; cursor: not-allowed; }

/* ── Page: Novo Campo ────────────────────────────────────────────────────── */

.nc-layout {
  height: 100%;
  overflow-y: auto;
  padding: 28px 32px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.nc-header { display: flex; flex-direction: column; gap: 4px; }
.nc-title { font-size: 18px; font-weight: 600; color: var(--text); }
.nc-subtitle { font-size: 13px; color: var(--text-dim); line-height: 1.5; }

.nc-upload-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.nc-upload-head {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.nc-upload-badge {
  font-size: 11px;
  font-weight: 400;
  color: var(--text-faint);
  text-transform: none;
  letter-spacing: 0;
}
.nc-upload-required-badge { color: rgba(239,68,68,0.7); }

.nc-upload-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.nc-upload-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 14px 12px;
  background: var(--navy-light);
  border: 1px dashed var(--border-hover);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  text-align: center;
  color: var(--text-dim);
  min-height: 68px;
}
.nc-upload-zone:hover { border-color: var(--blue); background: rgba(139,92,246,0.05); color: var(--text); }
.nc-upload-zone.has-file { border-style: solid; border-color: var(--green); background: rgba(34,197,94,0.06); color: var(--green); }

.nc-upload-zone-text { font-size: 12px; line-height: 1.4; }
.nc-upload-zone-text strong { font-weight: 600; }
.nc-upload-zone-text em { color: var(--text-faint); font-style: normal; }

body.light-mode .nc-upload-zone { background: #F1F3FA; }
body.light-mode .nc-upload-zone:hover { background: rgba(139,92,246,0.06); }
body.light-mode .nc-upload-zone.has-file { background: rgba(34,197,94,0.06); }

.nc-form {
  background: var(--navy-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.nc-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 20px;
}

.nc-field-group { display: flex; flex-direction: column; gap: 6px; }

.nc-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.nc-required { color: var(--blue); font-weight: 600; }

.nc-input,
.nc-select {
  width: 100%;
  padding: 9px 12px;
  background: var(--navy-light);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 13px;
  outline: none;
  transition: border-color 0.15s;
  font-family: inherit;
}
.nc-input:focus,
.nc-select:focus { border-color: var(--blue); }
.nc-select option { background: var(--navy-card); }

.nc-form-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 4px;
  border-top: 1px solid var(--border);
}

.nc-check-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}
.nc-check-label { font-size: 13px; color: var(--text-dim); }
.nc-check-wrap input[type="checkbox"] { accent-color: var(--blue); width: 14px; height: 14px; cursor: pointer; }

.nc-result {
  background: var(--navy-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.nc-result-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: var(--navy-light);
  border-bottom: 1px solid var(--border);
}

.nc-result-title {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 600;
  color: var(--green);
}

.nc-tabs { display: flex; flex-direction: column; }

.nc-tab-bar {
  display: flex;
  gap: 2px;
  padding: 10px 14px 0;
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
}

.nc-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  background: transparent;
  color: var(--text-dim);
  border: none;
  border-bottom: 2px solid transparent;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
  white-space: nowrap;
  margin-bottom: -1px;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}
.nc-tab-btn:hover { color: var(--text); }
.nc-tab-btn.active { color: var(--blue); border-bottom-color: var(--blue); }

.nc-tab-content { display: none; padding: 14px; }
.nc-tab-content.active { display: flex; flex-direction: column; gap: 8px; }

.nc-code-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-shrink: 0;
}

.nc-code-hint {
  font-size: 12px;
  color: var(--text-faint);
}
.nc-code-hint strong { color: var(--text-dim); }

.nc-code {
  margin: 0;
  font-size: 12px;
  font-family: 'JetBrains Mono', monospace;
  white-space: pre;
  overflow: auto;
  min-height: 180px;
  background: var(--navy);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
  color: var(--text);
  line-height: 1.6;
}

body.light-mode .nc-input,
body.light-mode .nc-select { background: #f1f3fa; border-color: rgba(0,0,0,0.1); color: #111537; }
body.light-mode .nc-result { background: #fff; }
body.light-mode .nc-result-header { background: #F8F9FE; }
body.light-mode .nc-tab-bar { border-color: rgba(0,0,0,0.08); }

/* ── Sofia IA — Brand elements ───────────────────────────────────────────── */

/* Welcome video */
.welcome-video-wrap {
  width: 260px;
  max-width: 90vw;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: 0 4px 24px rgba(0,0,0,0.35);
  margin-bottom: 8px;
  background: #000;
}
.welcome-video {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 16px;
}

/* Chat welcome with Sofia avatar */
.sofia-chat-avatar-wrap {
  position: relative;
  width: 100px;
  height: 100px;
  margin-bottom: 4px;
}
.sofia-chat-avatar {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center top;
  border: 2px solid rgba(139,92,246,0.35);
  box-shadow: 0 0 0 6px rgba(139,92,246,0.08);
}
.sofia-chat-pulse {
  position: absolute;
  bottom: 4px;
  right: 4px;
  width: 14px;
  height: 14px;
  background: #22C55E;
  border-radius: 50%;
  border: 2px solid var(--navy);
}

/* Sidebar spacer — empurra itens abaixo dele para o fundo */
.nav-spacer { flex: 1; }

/* Sidebar by UpSoftware footer */
.sidebar-by-brand {
  padding: 14px 12px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}
.sidebar-by-text {
  font-size: 10px;
  font-weight: 500;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  flex-shrink: 0;
}
.sidebar-by-logo {
  height: 32px;
  width: auto;
  opacity: 0.75;
  filter: brightness(0) invert(1);
  transition: opacity 0.2s;
}
.sidebar-by-logo:hover { opacity: 1; }
body.light-mode .sidebar-by-logo {
  filter: brightness(0);
  opacity: 0.4;
}

/* Header Sofia S+ mark */
.sofia-header-mark {
  display: inline-flex;
  align-items: baseline;
  gap: 0;
  line-height: 1;
}
.sofia-header-s {
  font-size: 18px;
  font-weight: 800;
  color: var(--blue);
  letter-spacing: -1px;
  font-family: 'Inter', sans-serif;
}
.sofia-header-plus {
  font-size: 10px;
  font-weight: 700;
  color: var(--blue);
  margin-bottom: 4px;
}
.sofia-header-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.2px;
}

/* ── Sofia Widget Flutuante ──────────────────────────────────────────────── */

.sofia-widget-btn {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: var(--blue);
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(139,92,246,0.5);
  z-index: 400;
  padding: 0;
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.sofia-widget-btn:hover {
  transform: scale(1.07);
  box-shadow: 0 6px 28px rgba(139,92,246,0.65);
}
.sofia-widget-btn img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}
.sofia-widget-btn .sofia-w-badge {
  position: absolute;
  bottom: 3px;
  right: 3px;
  width: 13px;
  height: 13px;
  background: #22C55E;
  border-radius: 50%;
  border: 2px solid var(--navy);
}

.sofia-widget-panel {
  position: fixed;
  bottom: 100px;
  right: 28px;
  width: 300px;
  height: 400px;
  background: var(--navy-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 16px 48px rgba(0,0,0,0.55);
  z-index: 399;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: scale(0.92) translateY(16px);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.22s cubic-bezier(0.34,1.56,0.64,1), opacity 0.18s ease;
  transform-origin: bottom right;
}
.sofia-widget-panel.open {
  transform: scale(1) translateY(0);
  opacity: 1;
  pointer-events: all;
}

.sofia-widget-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--navy-mid);
  flex-shrink: 0;
}
.sofia-widget-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center top;
  border: 1.5px solid rgba(139,92,246,0.4);
  flex-shrink: 0;
}
.sofia-widget-info { flex: 1; min-width: 0; }
.sofia-widget-name {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
  display: block;
}
.sofia-widget-sub {
  font-size: 11px;
  color: var(--text-faint);
  display: block;
}
.sofia-widget-status {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: #4ade80;
}
.sofia-widget-status::before {
  content: '';
  width: 7px;
  height: 7px;
  background: #22C55E;
  border-radius: 50%;
  flex-shrink: 0;
}
.sofia-widget-close {
  background: transparent;
  border: none;
  color: var(--text-faint);
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  transition: color 0.15s, background 0.15s;
}
.sofia-widget-close:hover { color: var(--text); background: var(--navy-light); }

.sofia-widget-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sw-msg {
  display: flex;
  gap: 8px;
  align-items: flex-end;
}
.sw-msg-user { flex-direction: row-reverse; }
.sw-msg-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center top;
  flex-shrink: 0;
}
.sw-bubble {
  max-width: 78%;
  padding: 10px 13px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.6;
}
.sw-msg-sofia .sw-bubble {
  background: var(--navy-light);
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
  color: var(--text);
}
.sw-msg-user .sw-bubble {
  background: var(--blue);
  color: #fff;
  border-bottom-right-radius: 4px;
}
.sw-msg-user .sw-bubble p { margin: 0; }
.sw-bubble p { margin: 4px 0; }
.sw-bubble p:first-child { margin-top: 0; }
.sw-bubble p:last-child  { margin-bottom: 0; }
.sw-bubble strong { font-weight: 600; }
.sw-bubble ul { padding-left: 16px; margin: 4px 0; }
.sw-bubble li { margin: 2px 0; }
.sw-bubble code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11.5px;
  background: rgba(255,255,255,0.1);
  padding: 1px 4px;
  border-radius: 3px;
}

.sw-loading {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 10px 13px;
  background: var(--navy-light);
  border: 1px solid var(--border);
  border-radius: 12px;
  border-bottom-left-radius: 4px;
  width: fit-content;
}
.sw-loading span {
  width: 6px;
  height: 6px;
  background: var(--text-dim);
  border-radius: 50%;
  animation: dots 1.2s ease-in-out infinite;
}
.sw-loading span:nth-child(2) { animation-delay: 0.2s; }
.sw-loading span:nth-child(3) { animation-delay: 0.4s; }
.sw-loading-status {
  font-size: 11px;
  color: var(--text-faint);
  margin-left: 4px;
  font-style: italic;
  animation: none;
  width: auto;
  height: auto;
  background: none;
  border-radius: 0;
}

.sofia-widget-input {
  display: flex;
  gap: 8px;
  padding: 12px 14px;
  border-top: 1px solid var(--border);
  background: var(--navy-mid);
  flex-shrink: 0;
  align-items: flex-end;
}
.sw-input {
  flex: 1;
  padding: 9px 13px;
  background: var(--navy-light);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-size: 13px;
  font-family: 'Inter', sans-serif;
  resize: none;
  outline: none;
  min-height: 38px;
  max-height: 100px;
  overflow-y: auto;
  transition: border-color 0.15s;
  line-height: 1.5;
}
.sw-input:focus { border-color: var(--blue); }
.sw-input::placeholder { color: var(--text-faint); }
.sw-send {
  width: 38px;
  height: 38px;
  background: var(--blue);
  border: none;
  border-radius: 9px;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s, opacity 0.15s;
}
.sw-send:hover { background: var(--blue-dark); }
.sw-send:disabled { opacity: 0.4; cursor: not-allowed; }

body.light-mode .sofia-widget-panel { background: #fff; }
body.light-mode .sofia-widget-header { background: #F8F9FE; }
body.light-mode .sofia-widget-input  { background: #F8F9FE; }
body.light-mode .sw-msg-sofia .sw-bubble { background: #F0F2FA; border-color: rgba(0,0,0,0.08); color: #111537; }
body.light-mode .sw-input { background: #fff; border-color: rgba(0,0,0,0.1); color: #111537; }

/* ── Dashboard Insights ───────────────────────────────────────────────────── */

.insights-layout {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 28px 32px;
  height: 100%;
  overflow-y: auto;
}

.insights-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-shrink: 0;
}
.insights-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}
.insights-period {
  font-size: 12px;
  color: var(--text-dim);
}
.insights-header-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}
.insights-generated {
  font-size: 11px;
  color: var(--text-faint);
}

/* Summary bar */
.ins-summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  flex-shrink: 0;
}
.ins-metric {
  background: var(--navy-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.ins-metric-label {
  font-size: 11px;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 500;
}
.ins-metric-value {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
  min-height: 24px;
}
.ins-metric-delta { font-size: 12px; }
.ins-delta-pos { color: var(--green); }
.ins-delta-neg { color: var(--red); }
.ins-delta-neutral { color: var(--text-faint); font-size: 11px; }

/* Resumo Executivo */
.ins-resumo {
  background: linear-gradient(135deg, rgba(139,92,246,0.08) 0%, rgba(139,92,246,0.03) 100%);
  border: 1px solid rgba(139,92,246,0.22);
  border-left: 4px solid var(--blue);
  border-radius: var(--radius);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  animation: cardIn 0.4s ease both;
}
.ins-resumo-header {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--blue);
}
.ins-resumo-text {
  font-size: 14px;
  line-height: 1.65;
  color: var(--text);
  font-weight: 400;
}
body.light-mode .ins-resumo { background: rgba(139,92,246,0.05); }

/* Insight grid */
.ins-grid {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.ins-group { display: flex; flex-direction: column; gap: 10px; }

.ins-group-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  display: flex;
  align-items: center;
  gap: 6px;
  padding-bottom: 2px;
  border-bottom: 1px solid var(--border);
}
.ins-group-alerta       .ins-group-label,
.ins-group-label.ins-group-alerta       { color: #f87171; border-color: rgba(239,68,68,0.25); }
.ins-group-positivo     .ins-group-label,
.ins-group-label.ins-group-positivo     { color: #4ade80; border-color: rgba(34,197,94,0.25); }
.ins-group-oportunidade .ins-group-label,
.ins-group-label.ins-group-oportunidade { color: #a78bfa; border-color: rgba(139,92,246,0.25); }
.ins-group-neutro       .ins-group-label,
.ins-group-label.ins-group-neutro       { color: #fbbf24; border-color: rgba(245,158,11,0.25); }

.ins-group-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
@keyframes cardIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

.ins-card {
  background: var(--navy-card);
  border: 1px solid var(--border);
  border-left-width: 4px;
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  animation: cardIn 0.35s ease both;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.ins-card:hover {
  border-color: var(--border-hover);
  box-shadow: 0 4px 16px rgba(0,0,0,0.18);
}

.ins-card.ins-alerta       { border-left-color: var(--red); }
.ins-card.ins-positivo     { border-left-color: var(--green); }
.ins-card.ins-oportunidade { border-left-color: var(--blue); }
.ins-card.ins-neutro       { border-left-color: var(--yellow); }

.ins-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.ins-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.ins-alerta       .ins-badge { background: rgba(239,68,68,0.15);    color: #f87171; }
.ins-positivo     .ins-badge { background: rgba(34,197,94,0.15);    color: #4ade80; }
.ins-oportunidade .ins-badge { background: rgba(139,92,246,0.18);   color: #a78bfa; }
.ins-neutro       .ins-badge { background: rgba(245,158,11,0.15);   color: #fbbf24; }

.ins-cat-tag {
  font-size: 10px;
  color: var(--text-faint);
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.ins-card-text {
  font-size: 13.5px;
  color: var(--text);
  line-height: 1.55;
  font-weight: 450;
}

/* Skeleton loading */
.ins-skeleton {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
@keyframes shimmer {
  0%   { background-position: -400px 0; }
  100% { background-position: 400px 0; }
}
.ins-skeleton-card {
  height: 90px;
  border-radius: var(--radius);
  background: linear-gradient(90deg, var(--navy-card) 25%, var(--navy-light) 50%, var(--navy-card) 75%);
  background-size: 800px 100%;
  animation: shimmer 1.4s infinite;
}

/* Empty / idle state */
.ins-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 64px 24px;
  color: var(--text-dim);
  text-align: center;
}
.ins-empty h3 { font-size: 17px; font-weight: 600; color: var(--text); }
.ins-empty p  { font-size: 13px; max-width: 380px; line-height: 1.6; }
.btn-generate-insights {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  padding: 10px 22px;
  background: var(--blue);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.18s, transform 0.12s;
}
.btn-generate-insights:hover { background: var(--blue-dark); transform: translateY(-1px); }
.btn-generate-insights:active { transform: translateY(0); }

/* Error state */
.ins-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 48px 0;
  color: var(--text-dim);
  text-align: center;
}

/* Light mode adjustments */
body.light-mode .ins-metric     { background: #fff; }
body.light-mode .ins-card       { background: #fff; }
body.light-mode .ins-skeleton-card {
  background: linear-gradient(90deg, #f0f2fa 25%, #e4e8f5 50%, #f0f2fa 75%);
  background-size: 800px 100%;
}

/* ── Página Sofia IA ─────────────────────────────────────────────────────── */
.sofia-about-layout {
  padding: 28px 32px 48px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  overflow-y: auto;
  height: 100%;
}
.sofia-about-hero {
  display: flex;
  align-items: center;
  gap: 24px;
  background: linear-gradient(135deg, rgba(139,92,246,0.12), rgba(139,92,246,0.04));
  border: 1px solid rgba(139,92,246,0.22);
  border-radius: 16px;
  padding: 24px 28px;
  flex-wrap: wrap;
}
.sofia-about-img {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center top;
  border: 3px solid rgba(139,92,246,0.4);
  box-shadow: 0 0 0 6px rgba(139,92,246,0.1);
  flex-shrink: 0;
}
.sofia-about-hero-text { display: flex; flex-direction: column; gap: 6px; }
.sofia-about-title { font-size: 26px; font-weight: 700; color: var(--text); }
.sofia-about-sub   { font-size: 14px; color: var(--text-dim); }
.sofia-about-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  color: var(--blue);
  background: rgba(139,92,246,0.12);
  border: 1px solid rgba(139,92,246,0.25);
  border-radius: 20px;
  padding: 3px 12px;
  width: fit-content;
  letter-spacing: 0.3px;
}
.sofia-about-intro {
  font-size: 14px;
  line-height: 1.75;
  color: var(--text-dim);
  padding: 0 2px;
}
.sofia-about-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}
.sofia-about-card {
  background: var(--navy-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: border-color 0.18s, transform 0.18s;
}
.sofia-about-card:hover { border-color: rgba(139,92,246,0.3); transform: translateY(-2px); }
.sofia-about-card-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: rgba(139,92,246,0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--blue);
}
.sofia-about-card h4 { font-size: 13px; font-weight: 600; color: var(--text); }
.sofia-about-card p  { font-size: 12px; line-height: 1.6; color: var(--text-dim); }
.sofia-about-cta { display: flex; justify-content: center; padding-top: 4px; }

.sofia-about-video {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.sofia-about-video-label {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-dim);
}
.sofia-about-video-wrap {
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
  width: fit-content;
  margin: 0 auto;
}
.sofia-about-video-player {
  display: block;
  max-width: 560px;
  width: 100%;
  height: auto;
}

body.light-mode .sofia-about-card { background: #fff; }
body.light-mode .sofia-about-hero { background: rgba(139,92,246,0.06); }

/* ── Scrollbar ────────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.22); }

/* ── Mobile Bottom Nav ────────────────────────────────────────────────────── */
.mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 200;
  background: var(--navy-mid);
  border-top: 1px solid var(--border);
  padding: 0;
  height: 60px;
}
.mob-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: 10px;
  font-weight: 500;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  padding: 6px 0 8px;
  transition: color 0.15s;
}
.mob-nav-item.active { color: var(--blue); }
.mob-nav-item svg { flex-shrink: 0; }

/* ── Responsive — Mobile (≤768px) ────────────────────────────────────────── */
@media (max-width: 768px) {

  /* ── Bottom nav / sidebar ── */
  .mobile-bottom-nav { display: flex; }
  .nav-sidebar        { display: none; }

  /* ── Header compacto ── */
  .header-tagline     { display: none; }
  .user-badge         { display: none; }
  .btn-logout span    { display: none; }
  .btn-logout         { padding: 6px 8px; }
  .header-inner       { padding: 0 14px; }

  /* ── Widget flutuante: irrelevante no mobile ── */
  .sofia-widget-btn  { display: none !important; }
  .sofia-widget-panel{ display: none !important; }

  /* ── App container: usa dvh para se ajustar ao teclado ── */
  .app-layout {
    height: calc(100dvh - var(--header-h) - 60px);
    margin-top: var(--header-h);
  }

  /* ── Chat — layout simples e direto ──────────────────── */
  #page-chat {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
  }
  .chat-layout {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
  }
  .chat-messages {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 14px 12px 16px;
    gap: 12px;
    display: flex;
    flex-direction: column;
  }
  .chat-input-area {
    flex-shrink: 0;
    padding: 10px 12px;
    border-top: 1px solid var(--border);
  }
  /* Esconde só o disclaimer, mantém o botão limpar */
  .chat-disclaimer    { display: none; }
  .chat-footer        { justify-content: flex-end; margin-top: 4px; }
  /* Teclado aberto: some nav para o input subir naturalmente */
  .mobile-keyboard-open .mobile-bottom-nav { display: none; }
  .chat-msg           { max-width: 100%; }
  .chat-welcome       { padding: 16px 0; }
  .chat-welcome h3    { font-size: 15px; }
  .chat-examples      { gap: 6px; }
  .chat-example       { font-size: 11.5px; padding: 6px 11px; }

  /* ── Dashboard ── */
  .insights-layout {
    height: 100%;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 16px 14px calc(16px + 60px);
    gap: 14px;
  }
  .insights-header        { flex-direction: column; gap: 8px; }
  .insights-header-right  { width: 100%; justify-content: space-between; }
  .insights-title         { font-size: 17px; }
  .ins-summary            { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .ins-metric             { padding: 12px 14px; }
  .ins-metric-value       { font-size: 17px; }
  .ins-group-cards        { grid-template-columns: 1fr; }
  .ins-skeleton           { grid-template-columns: 1fr; }
  .ins-skeleton-card      { height: 72px; }

  /* ── Sofia IA page ── */
  .sofia-about-layout  { padding: 16px 14px 32px; gap: 16px; }
  .sofia-about-hero    { padding: 16px; gap: 16px; }
  .sofia-about-img     { width: 72px; height: 72px; }
  .sofia-about-title   { font-size: 20px; }
  .sofia-about-grid    { grid-template-columns: 1fr; }

  /* ── Login ── */
  .login-brand-panel  { display: none; }
  .login-form-panel   {
    flex: 1;
    padding: 0;
    align-items: stretch;
    background: var(--navy);
  }
  .login-card {
    max-width: 100%;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 40px 28px 36px;
  }
  .login-mobile-hero {
    display: flex;
    justify-content: center;
    margin-bottom: 24px;
  }
  .login-mobile-avatar {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid rgba(139,92,246,0.35);
    box-shadow: 0 0 28px rgba(139,92,246,0.25);
  }
  .login-brand-name   { font-size: 26px; }
  .login-footer-brand { margin-top: 28px; padding-top: 20px; }
  .login-footer-logo  { height: 52px; }
}

/* Hero visível só no mobile */
.login-mobile-hero { display: none; }
