/* ============================================================
   HOJ — Base de POPs  |  Identidade Visual
   Fonte Inter: coloque os arquivos .woff2 em assets/fonts/
   ============================================================ */

@font-face {
  font-family: 'Inter';
  src: url('fonts/Inter-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Inter';
  src: url('fonts/Inter-Medium.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Inter';
  src: url('fonts/Inter-SemiBold.woff2') format('woff2');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Inter';
  src: url('fonts/Inter-Bold.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* ── Tokens — HOJ (chat/admin) ── */
:root {
  --primary:     #006D73;
  --primary-dark:#00555A;
  --secondary:   #0F8B8D;
  --accent:      #6BBF59;
  --accent-dark: #55A045;
  --bg:          #F4F6F7;
  --card:        #FFFFFF;
  --text:        #3C3C3C;
  --text-light:  #6B7280;
  --text-inv:    #FFFFFF;
  --border:      #DDE3E8;
  --danger:      #DC3545;
  --warn:        #F59E0B;
  --radius:      10px;
  --shadow:      0 2px 12px rgba(0,0,0,.08);
  --shadow-lg:   0 4px 24px rgba(0,0,0,.12);
  --transition:  .18s ease;

  /* ── Tokens — Connextia Hub (azul corporativo) ── */
  --hub-primary:   #1B3A6B;
  --hub-secondary: #2563EB;
  --hub-accent:    #0EA5E9;
  --hub-cta:       #15803D;
  --hub-cta-hover: #166534;
  --hub-bg:        #F1F5F9;
  --hub-card:      #FFFFFF;
  --hub-text:      #1E293B;
  --hub-text-light:#64748B;
  --hub-border:    #CBD5E1;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--secondary); }
img { max-width: 100%; display: block; }
ul { list-style: none; }

/* ── Header ── */
.hoj-header {
  background: var(--primary);
  color: var(--text-inv);
  padding: 0 1.5rem;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,.2);
}
.hoj-header .logo-wrap {
  display: flex;
  align-items: center;
  gap: .75rem;
}
.hoj-header .logo-wrap img {
  height: 38px;
  width: auto;
  object-fit: contain;
}
.hoj-header h1 {
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: .01em;
}
.hoj-header .header-right {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: .85rem;
  opacity: .9;
}
.sector-badge {
  background: rgba(255,255,255,.15);
  border: 1px solid rgba(255,255,255,.25);
  border-radius: 20px;
  padding: .25rem .75rem;
  font-size: .8rem;
  font-weight: 500;
}

/* ── Footer ── */
.hoj-footer {
  margin-top: auto;
  background: var(--primary);
  color: rgba(255,255,255,.7);
  text-align: center;
  padding: .9rem 1rem;
  font-size: .8rem;
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  padding: .55rem 1.25rem;
  border: none;
  border-radius: var(--radius);
  font-family: inherit;
  font-size: .9rem;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--transition), transform var(--transition);
  white-space: nowrap;
}
.btn:active { transform: scale(.97); }
.btn-primary  { background: var(--primary);   color: #fff; }
.btn-primary:hover  { background: var(--secondary); }
.btn-accent   { background: var(--accent);    color: #fff; }
.btn-accent:hover   { background: var(--accent-dark); }
.btn-outline  { background: transparent; color: var(--primary); border: 1.5px solid var(--primary); }
.btn-outline:hover  { background: var(--primary); color: #fff; }
.btn-danger   { background: var(--danger);    color: #fff; }
.btn-danger:hover   { background: #b02a37; }
.btn-sm { padding: .35rem .8rem; font-size: .8rem; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ── Form controls ── */
.form-group { margin-bottom: 1.1rem; }
.form-group label {
  display: block;
  font-size: .85rem;
  font-weight: 500;
  margin-bottom: .4rem;
  color: var(--text);
}
.form-control {
  width: 100%;
  padding: .6rem .9rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-family: inherit;
  font-size: .95rem;
  color: var(--text);
  background: #fff;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.form-control:focus {
  outline: none;
  border-color: var(--secondary);
  box-shadow: 0 0 0 3px rgba(15,139,141,.15);
}
.code-input {
  letter-spacing: .35em;
  font-size: 1.4rem;
  font-weight: 600;
  text-align: center;
}

/* ── Cards ── */
.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.5rem;
}

/* ── Alerts ── */
.alert {
  padding: .75rem 1rem;
  border-radius: var(--radius);
  font-size: .88rem;
  margin-bottom: 1rem;
}
.alert-error   { background: #fde8ea; color: #842029; border: 1px solid #f5c2c7; }
.alert-success { background: #d1f0d8; color: #145523; border: 1px solid #a3d9af; }
.alert-warn    { background: #fff3cd; color: #664d03; border: 1px solid #ffda6a; }
.alert-info    { background: #d0ecf4; color: #0c5460; border: 1px solid #9edae8; }

/* ── Spinner ── */
.spinner {
  width: 20px; height: 20px;
  border: 2.5px solid rgba(255,255,255,.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Modal ── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.45);
  display: flex; align-items: center; justify-content: center;
  z-index: 200;
  padding: 1rem;
}
.modal-overlay.hidden { display: none; }
.modal {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  width: 100%; max-width: 480px;
  padding: 2rem;
  position: relative;
}
.modal h2 { font-size: 1.2rem; margin-bottom: 1.25rem; color: var(--primary); }
.modal-close {
  position: absolute; top: 1rem; right: 1rem;
  background: none; border: none; font-size: 1.4rem;
  cursor: pointer; color: var(--text-light);
}

/* ================================================================
   INDEX PAGE — Sector selection
   ================================================================ */
.page-index { flex: 1; padding: 2rem 1.5rem; }
.page-index .intro {
  text-align: center;
  max-width: 560px;
  margin: 0 auto 2.5rem;
}
.page-index .intro h2 {
  font-size: 1.55rem;
  color: var(--primary);
  margin-bottom: .5rem;
}
.page-index .intro p { color: var(--text-light); font-size: .95rem; }

.sectors-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
  max-width: 900px;
  margin: 0 auto 2rem;
}
.sector-card {
  background: #fff;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 1.2rem 1rem;
  cursor: pointer;
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
  text-align: center;
  user-select: none;
}
.sector-card:hover {
  border-color: var(--secondary);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}
.sector-card.selected {
  border-color: var(--primary);
  background: #e8f4f4;
}
.sector-card .sc-icon {
  font-size: 2rem;
  margin-bottom: .5rem;
  display: block;
}
.sector-card .sc-name {
  font-weight: 600;
  font-size: .95rem;
  color: var(--text);
}

.auth-panel {
  max-width: 360px;
  margin: 0 auto;
}
.auth-panel h3 { font-size: 1rem; margin-bottom: 1rem; color: var(--primary); }
.admin-link-wrap { text-align: center; margin-top: 2rem; }
.admin-link-wrap a { font-size: .8rem; color: var(--text-light); }
.admin-link-wrap a:hover { color: var(--primary); }

/* ================================================================
   CHAT PAGE
   ================================================================ */
.chat-layout {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: calc(100vh - 64px - 44px); /* minus header and footer */
}
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  scroll-behavior: smooth;
}
.chat-messages:empty::before {
  content: 'Faça uma pergunta sobre os POPs do seu setor.';
  display: block;
  text-align: center;
  color: var(--text-light);
  font-size: .9rem;
  margin-top: 3rem;
}

/* Message bubbles */
.msg {
  display: flex;
  flex-direction: column;
  max-width: 80%;
  animation: fadeUp .2s ease;
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.msg-user { align-self: flex-end; align-items: flex-end; }
.msg-bot  { align-self: flex-start; align-items: flex-start; }

.msg-bubble {
  padding: .75rem 1rem;
  border-radius: 14px;
  font-size: .93rem;
  line-height: 1.65;
  word-break: break-word;
  white-space: pre-wrap;
}
.msg-user .msg-bubble {
  background: var(--primary);
  color: #fff;
  border-bottom-right-radius: 4px;
}
.msg-bot .msg-bubble {
  background: #fff;
  color: var(--text);
  border-left: 4px solid var(--accent);
  border-bottom-left-radius: 4px;
  box-shadow: var(--shadow);
}
.msg-time {
  font-size: .72rem;
  color: var(--text-light);
  margin-top: .25rem;
  padding: 0 .25rem;
}

/* Sources section */
.msg-sources {
  margin-top: .5rem;
  width: 100%;
}
.sources-toggle {
  background: none;
  border: none;
  color: var(--primary);
  font-size: .78rem;
  font-family: inherit;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  gap: .3rem;
}
.sources-toggle:hover { text-decoration: underline; }
.sources-list {
  margin-top: .5rem;
  display: flex;
  flex-direction: column;
  gap: .4rem;
}
.sources-list.hidden { display: none; }
.source-item {
  background: #f0faf0;
  border: 1px solid #c3e6cb;
  border-left: 3px solid var(--accent);
  border-radius: 6px;
  padding: .6rem .8rem;
  font-size: .78rem;
}
.source-item .src-file {
  font-weight: 600;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: .3rem;
  margin-bottom: .25rem;
}
.source-item .src-excerpt {
  color: var(--text-light);
  line-height: 1.5;
}
.source-item .src-score {
  font-size: .7rem;
  color: var(--accent-dark);
  margin-top: .2rem;
}

/* Typing indicator */
.typing-indicator .msg-bubble {
  display: flex;
  gap: .3rem;
  align-items: center;
  padding: .9rem 1rem;
}
.typing-indicator .dot {
  width: 7px; height: 7px;
  background: var(--text-light);
  border-radius: 50%;
  animation: bounce .9s ease infinite;
}
.typing-indicator .dot:nth-child(2) { animation-delay: .15s; }
.typing-indicator .dot:nth-child(3) { animation-delay: .3s; }
@keyframes bounce {
  0%, 60%, 100% { transform: translateY(0); }
  30% { transform: translateY(-6px); }
}

/* Chat input bar */
.chat-input-bar {
  background: #fff;
  border-top: 1px solid var(--border);
  padding: .85rem 1.25rem;
  display: flex;
  gap: .75rem;
  align-items: flex-end;
}
.chat-input-bar textarea {
  flex: 1;
  resize: none;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: .6rem .9rem;
  font-family: inherit;
  font-size: .93rem;
  min-height: 44px;
  max-height: 140px;
  overflow-y: auto;
  color: var(--text);
  transition: border-color var(--transition);
}
.chat-input-bar textarea:focus {
  outline: none;
  border-color: var(--secondary);
}
.chat-input-bar .btn-send {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--primary);
  border: none;
  color: #fff;
  font-size: 1.1rem;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: background var(--transition), transform var(--transition);
}
.chat-input-bar .btn-send:hover { background: var(--secondary); }
.chat-input-bar .btn-send:active { transform: scale(.93); }
.chat-input-bar .btn-send:disabled { background: var(--border); cursor: not-allowed; }

/* ================================================================
   ADMIN PAGE
   ================================================================ */
.admin-layout { flex: 1; display: flex; }
.admin-sidebar {
  width: 220px;
  flex-shrink: 0;
  background: #fff;
  border-right: 1px solid var(--border);
  padding: 1.5rem 0;
}
.admin-sidebar .sidebar-title {
  padding: 0 1.25rem .75rem;
  font-size: .7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-light);
}
.admin-sidebar .nav-item {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .65rem 1.25rem;
  color: var(--text);
  font-size: .9rem;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}
.admin-sidebar .nav-item:hover { background: var(--bg); }
.admin-sidebar .nav-item.active { background: #e8f4f4; color: var(--primary); font-weight: 600; }
.admin-sidebar .nav-item .nav-icon { font-size: 1.1rem; }

.admin-main { flex: 1; overflow-y: auto; padding: 2rem; }
.admin-main .page-title {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: .5rem;
}

/* Tables */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .88rem;
}
.data-table th {
  text-align: left;
  padding: .65rem .9rem;
  background: var(--bg);
  font-weight: 600;
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-light);
  border-bottom: 1px solid var(--border);
}
.data-table td {
  padding: .7rem .9rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: #fafbfc; }

/* Badges */
.badge {
  display: inline-block;
  padding: .2rem .55rem;
  border-radius: 20px;
  font-size: .72rem;
  font-weight: 600;
}
.badge-green    { background: #d1f0d8; color: #145523; }
.badge-red      { background: #fde8ea; color: #842029; }
.badge-teal     { background: #cceef0; color: #004b50; }
.badge-gray     { background: #e9ecef; color: #495057; }

/* Code display */
.code-display {
  font-family: 'Courier New', monospace;
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: .25em;
  color: var(--primary);
  background: var(--bg);
  padding: .35rem .75rem;
  border-radius: 6px;
  border: 1px solid var(--border);
}

/* Drop zone */
.drop-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 2.5rem 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
  color: var(--text-light);
  font-size: .9rem;
}
.drop-zone:hover, .drop-zone.drag-over {
  border-color: var(--secondary);
  background: #f0fbfc;
  color: var(--primary);
}
.drop-zone .dz-icon { font-size: 2.5rem; margin-bottom: .5rem; }
.drop-zone .dz-hint { font-size: .78rem; margin-top: .35rem; }

/* Status indicators */
.status-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}
.status-dot.online  { background: var(--accent); }
.status-dot.offline { background: var(--danger); }

/* Admin login screen */
.login-screen {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}
.login-box {
  width: 100%;
  max-width: 380px;
}
.login-box .login-logo {
  text-align: center;
  margin-bottom: 2rem;
}
.login-box .login-logo img { height: 56px; margin: 0 auto .75rem; }
.login-box .login-logo h2 { font-size: 1.1rem; color: var(--primary); }
.login-box .login-logo p  { font-size: .82rem; color: var(--text-light); margin-top: .2rem; }

/* Tabs (admin) */
.admin-tabs { display: none; }
.admin-tabs.visible { display: block; }

/* Section header */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}
.section-header h3 { font-size: 1.05rem; font-weight: 600; }

/* Upload result list */
.upload-results { margin-top: 1rem; display: flex; flex-direction: column; gap: .4rem; }
.upload-result-item {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: .83rem;
  padding: .4rem .6rem;
  border-radius: 6px;
}
.upload-result-item.ok  { background: #d1f0d8; color: #145523; }
.upload-result-item.err { background: #fde8ea; color: #842029; }

/* Responsive tweaks */
@media (max-width: 640px) {
  .sectors-grid { grid-template-columns: repeat(2, 1fr); }
  .msg { max-width: 95%; }
  .admin-sidebar { display: none; }
  .admin-main { padding: 1rem; }
}

/* ================================================================
   CONNEXTIA HUB — Landing page
   ================================================================ */

/* Hub body */
body.hub-page {
  background: var(--hub-bg);
  color: var(--hub-text);
}

/* Hub header */
.hub-header {
  background: var(--hub-primary);
  color: #fff;
  padding: 0 2rem;
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 16px rgba(0,0,0,.25);
}
.hub-header .brand {
  display: flex;
  align-items: center;
  gap: .75rem;
}
.hub-header .brand img { height: 36px; object-fit: contain; }
.hub-header .brand-name { font-size: 1.15rem; font-weight: 700; letter-spacing: -.01em; }
.hub-header .brand-sub { font-size: .7rem; opacity: .7; display: block; margin-top: -.1rem; }
.hub-nav { display: flex; align-items: center; gap: 1.5rem; font-size: .88rem; }
.hub-nav a { color: rgba(255,255,255,.85); transition: color .15s; }
.hub-nav a:hover { color: #fff; }

/* Hero */
.hub-hero {
  background: linear-gradient(135deg, var(--hub-primary) 0%, #1e4f9c 60%, var(--hub-secondary) 100%);
  color: #fff;
  padding: 5rem 2rem 4rem;
  text-align: center;
}
.hub-hero .hero-badge {
  display: inline-block;
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.25);
  border-radius: 20px;
  padding: .3rem 1rem;
  font-size: .78rem;
  font-weight: 500;
  letter-spacing: .06em;
  text-transform: uppercase;
  margin-bottom: 1.25rem;
}
.hub-hero h1 {
  font-size: clamp(1.9rem, 5vw, 3rem);
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: .75rem;
  letter-spacing: -.02em;
}
.hub-hero h1 span { color: var(--hub-accent); }
.hub-hero p {
  font-size: 1.05rem;
  opacity: .85;
  max-width: 540px;
  margin: 0 auto 2rem;
  line-height: 1.65;
}
.hub-hero .hero-cta {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  background: #fff;
  color: var(--hub-primary);
  font-weight: 700;
  font-size: .95rem;
  padding: .75rem 1.75rem;
  border-radius: 30px;
  transition: transform .15s, box-shadow .15s;
  box-shadow: 0 4px 20px rgba(0,0,0,.2);
}
.hub-hero .hero-cta:hover { transform: translateY(-2px); box-shadow: 0 8px 28px rgba(0,0,0,.25); color: var(--hub-primary); }

/* Sections */
.hub-section {
  padding: 4rem 2rem;
  max-width: 1100px;
  margin: 0 auto;
}
.hub-section-title {
  text-align: center;
  margin-bottom: 2.5rem;
}
.hub-section-title h2 {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--hub-primary);
  margin-bottom: .4rem;
}
.hub-section-title p { color: var(--hub-text-light); font-size: .95rem; }

/* Services grid */
.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.25rem;
}
.service-card {
  background: var(--hub-card);
  border: 1.5px solid var(--hub-border);
  border-radius: 14px;
  padding: 1.75rem 1.5rem;
  transition: border-color .15s, box-shadow .15s, transform .15s;
  position: relative;
  overflow: hidden;
}
.service-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--hub-secondary);
  transform: scaleX(0);
  transition: transform .2s;
}
.service-card:hover::before { transform: scaleX(1); }
.service-card:hover {
  border-color: var(--hub-secondary);
  box-shadow: 0 8px 32px rgba(37,99,235,.1);
  transform: translateY(-3px);
}
.service-card.active { cursor: pointer; }
.service-card.coming-soon { opacity: .7; }
.service-card .svc-icon { font-size: 2.25rem; margin-bottom: .9rem; display: block; }
.service-card h3 { font-size: 1.05rem; font-weight: 700; color: var(--hub-text); margin-bottom: .4rem; }
.service-card p { font-size: .84rem; color: var(--hub-text-light); line-height: 1.55; }
.service-card .svc-badge {
  display: inline-block;
  margin-top: .75rem;
  padding: .2rem .6rem;
  border-radius: 10px;
  font-size: .7rem;
  font-weight: 600;
}
.svc-badge.live { background: #dcfce7; color: #15803d; }
.svc-badge.soon { background: #f1f5f9; color: #64748b; }

/* POPs section */
.pops-section {
  background: #fff;
  border-top: 1px solid var(--hub-border);
  border-bottom: 1px solid var(--hub-border);
  padding: 4rem 2rem;
}
.pops-inner { max-width: 1100px; margin: 0 auto; }

/* Hub auth card */
.hub-auth-card {
  background: var(--hub-bg);
  border: 1.5px solid var(--hub-border);
  border-radius: 14px;
  padding: 2rem;
  max-width: 420px;
  margin: 0 auto 2.5rem;
  text-align: center;
}
.hub-auth-card h3 { font-size: 1.05rem; font-weight: 700; color: var(--hub-primary); margin-bottom: .35rem; }
.hub-auth-card p { font-size: .84rem; color: var(--hub-text-light); margin-bottom: 1.25rem; }

/* Sector buttons (hub) */
.hub-sectors-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: .9rem;
  margin-bottom: 2.5rem;
}
.hub-sector-btn {
  background: var(--hub-card);
  border: 1.5px solid var(--hub-border);
  border-radius: 12px;
  padding: 1.1rem 1rem;
  text-align: center;
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s, transform .15s;
  text-decoration: none;
  display: block;
  color: var(--hub-text);
}
.hub-sector-btn:hover {
  border-color: var(--hub-secondary);
  box-shadow: 0 4px 16px rgba(37,99,235,.12);
  transform: translateY(-2px);
  color: var(--hub-text);
}
.hub-sector-btn .hsb-icon { font-size: 1.75rem; margin-bottom: .5rem; display: block; }
.hub-sector-btn .hsb-name { font-size: .85rem; font-weight: 600; }
.hub-sector-btn .hsb-count { font-size: .72rem; color: var(--hub-text-light); margin-top: .2rem; }

/* Hub chat widget */
.hub-chat-wrap {
  background: var(--hub-bg);
  border: 1.5px solid var(--hub-border);
  border-radius: 14px;
  overflow: hidden;
}
.hub-chat-header {
  background: var(--hub-primary);
  color: #fff;
  padding: .85rem 1.25rem;
  font-size: .9rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: .5rem;
}
.hub-chat-messages {
  height: 340px;
  overflow-y: auto;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  background: #fff;
}
.hub-chat-input {
  display: flex;
  gap: .6rem;
  padding: .85rem 1rem;
  border-top: 1px solid var(--hub-border);
  background: var(--hub-bg);
}
.hub-chat-input input {
  flex: 1;
  padding: .6rem .9rem;
  border: 1.5px solid var(--hub-border);
  border-radius: 30px;
  font-family: inherit;
  font-size: .9rem;
  color: var(--hub-text);
  background: #fff;
}
.hub-chat-input input:focus { outline: none; border-color: var(--hub-secondary); }
.hub-chat-input button {
  background: var(--hub-primary);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 40px; height: 40px;
  cursor: pointer;
  font-size: 1rem;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: background .15s;
}
.hub-chat-input button:hover { background: var(--hub-secondary); }
.hub-chat-input button:disabled { background: var(--hub-border); cursor: not-allowed; }

/* Hub source chips */
.hub-source-chips { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .5rem; }
.hub-source-chip {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 20px;
  padding: .2rem .65rem;
  font-size: .72rem;
  color: var(--hub-secondary);
  font-weight: 500;
}

/* Hub footer */
.hub-footer {
  background: var(--hub-primary);
  color: rgba(255,255,255,.7);
  text-align: center;
  padding: 1.5rem 2rem;
  font-size: .82rem;
}
.hub-footer a { color: rgba(255,255,255,.85); }
.hub-footer a:hover { color: #fff; }

/* ================================================================
   REPOSITÓRIO PAGE
   ================================================================ */
.repo-header-bar {
  background: var(--hub-primary);
  color: #fff;
  padding: 1.5rem 2rem;
}
.repo-header-bar h1 { font-size: 1.4rem; font-weight: 700; }
.repo-header-bar p { font-size: .85rem; opacity: .8; margin-top: .25rem; }
.repo-back { font-size: .82rem; color: rgba(255,255,255,.75); display: inline-flex; align-items: center; gap: .3rem; margin-bottom: .5rem; }
.repo-back:hover { color: #fff; }

.repo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.1rem;
  padding: 2rem;
  max-width: 1100px;
  margin: 0 auto;
}
.repo-card {
  background: #fff;
  border: 1.5px solid var(--hub-border);
  border-radius: 12px;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: .6rem;
  transition: box-shadow .15s, border-color .15s;
}
.repo-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,.08); border-color: var(--hub-accent); }
.repo-card .rc-filename {
  font-weight: 600;
  font-size: .92rem;
  color: var(--hub-primary);
  display: flex;
  align-items: flex-start;
  gap: .4rem;
}
.repo-card .rc-desc {
  font-size: .8rem;
  color: var(--hub-text-light);
  line-height: 1.6;
  flex: 1;
}
.repo-card .rc-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.btn-hub-outline {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .4rem .9rem;
  border: 1.5px solid var(--hub-secondary);
  border-radius: 20px;
  font-size: .78rem;
  font-weight: 600;
  color: var(--hub-secondary);
  background: transparent;
  cursor: pointer;
  transition: background .15s, color .15s;
  text-decoration: none;
  font-family: inherit;
}
.btn-hub-outline:hover { background: var(--hub-secondary); color: #fff; }
.btn-hub-solid {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .4rem .9rem;
  border: none;
  border-radius: 20px;
  font-size: .78rem;
  font-weight: 600;
  color: #fff;
  background: var(--hub-primary);
  cursor: pointer;
  transition: background .15s;
  text-decoration: none;
  font-family: inherit;
}
.btn-hub-solid:hover { background: var(--hub-secondary); color: #fff; }

@media (max-width: 640px) {
  .hub-hero { padding: 3rem 1.25rem 2.5rem; }
  .hub-section { padding: 2.5rem 1.25rem; }
  .services-grid { grid-template-columns: 1fr 1fr; }
  .hub-sectors-grid { grid-template-columns: repeat(3, 1fr); }
  .repo-grid { grid-template-columns: 1fr; padding: 1rem; }
}
