:root {
  --brand: #042936;
  --brand-2: #0b4555;
  --ink: #18333c;
  --muted: #688088;
  --line: #dce7e9;
  --canvas: #f5f8f8;
  --white: #fff;
  --accent: #27c99a;
  --sidebar: 292px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--canvas); font-family: Inter, "Segoe UI", Arial, sans-serif; }
button, input { font: inherit; }
button:focus-visible, a:focus-visible, input:focus-visible { outline: 3px solid rgba(39,201,154,.38); outline-offset: 2px; }
.skip-link { position: fixed; left: 1rem; top: -5rem; z-index: 9999; padding: .7rem 1rem; background: #fff; color: var(--brand); border-radius: .6rem; }
.skip-link:focus { top: 1rem; }

.topbar { position: fixed; inset: 0 0 auto 0; z-index: 50; height: 72px; display: flex; align-items: center; justify-content: space-between; padding: 0 28px; color: #fff; background: var(--brand); box-shadow: 0 3px 14px rgba(4,41,54,.18); }
.brand { display: flex; align-items: center; gap: 11px; }
.brand img { border-radius: 50%; box-shadow: 0 0 0 1px rgba(255,255,255,.24); }
.brand div { display: grid; line-height: 1.1; }
.brand strong { font-size: 1rem; letter-spacing: .01em; }
.brand span { margin-top: 4px; color: #a9c4ca; font-size: .72rem; }
.version-pill { display: flex; align-items: center; gap: 8px; font-size: .75rem; color: #bdd0d4; }
.version-pill span { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px rgba(39,201,154,.14); }
.topbar-actions { display: flex; align-items: center; gap: 18px; }
.topbar-actions form { margin: 0; }
.logout-button { display: inline-flex; align-items: center; gap: 7px; padding: 7px 10px; color: #d5e3e6; background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.13); border-radius: 8px; font-size: .73rem; }
.logout-button:hover { color: #fff; background: rgba(255,255,255,.12); }
.mobile-menu { display: none; border: 0; color: #fff; background: none; font-size: 1.5rem; }

.app-shell { min-height: 100vh; padding-top: 72px; }
.sidebar { position: fixed; z-index: 40; top: 72px; bottom: 0; left: 0; width: var(--sidebar); display: flex; flex-direction: column; padding: 22px 18px; overflow-y: auto; background: #fff; border-right: 1px solid var(--line); }
.sidebar-search { position: relative; display: flex; align-items: center; }
.sidebar-search i { position: absolute; left: 14px; color: #799097; }
.sidebar-search input { width: 100%; height: 44px; padding: 0 45px 0 40px; border: 1px solid var(--line); border-radius: 10px; background: #f9fbfb; color: var(--ink); }
.sidebar-search input:focus { border-color: #70a5b1; background: #fff; }
.sidebar-search kbd { position: absolute; right: 11px; color: #80949a; background: #e8eff0; border: 0; font-size: .68rem; }
.filter-label, .nav-heading { margin: 24px 8px 10px; color: #91a1a5; font-weight: 700; font-size: .67rem; letter-spacing: .12em; text-transform: uppercase; }
.filter-list { display: flex; flex-wrap: wrap; gap: 7px; }
.filter-chip { padding: 6px 10px; color: #49636b; background: #f2f6f7; border: 1px solid #dbe6e8; border-radius: 999px; font-size: .72rem; font-weight: 650; }
.filter-chip:hover, .filter-chip.active { color: #fff; background: var(--brand); border-color: var(--brand); }
.module-nav { flex: 1; }
.module-link { width: 100%; display: flex; align-items: center; justify-content: space-between; padding: 10px 10px; border: 0; border-radius: 9px; color: #49646c; background: transparent; font-size: .8rem; text-align: left; }
.module-link:hover { color: var(--brand); background: #eff5f6; }
.module-link.active { color: var(--brand); background: #e5f1f2; font-weight: 700; box-shadow: inset 3px 0 var(--accent); }
.module-link span { display: flex; align-items: center; gap: 10px; min-width: 0; }
.module-link i { width: 16px; color: #789197; }
.module-link em { padding: 1px 6px; color: #7a9096; background: #edf2f3; border-radius: 20px; font-size: .65rem; font-style: normal; }
.sidebar-footer { margin-top: 18px; padding: 14px; border-radius: 12px; background: var(--brand); display: grid; gap: 7px; }
.sidebar-footer span { color: #abc4ca; font-size: .68rem; }
.sidebar-footer a { color: #fff; font-size: .77rem; font-weight: 650; text-decoration: none; }
.sidebar-footer a i { color: var(--accent); }

.content { margin-left: var(--sidebar); min-height: calc(100vh - 72px); padding: 38px clamp(24px, 5vw, 74px) 0; }
.hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 2rem; max-width: 1280px; margin: 0 auto 32px; padding: clamp(26px, 4vw, 44px); color: #fff; border-radius: 20px; background: linear-gradient(125deg, var(--brand) 0%, #0b4656 72%, #0b5262 100%); box-shadow: 0 18px 45px rgba(4,41,54,.14); overflow: hidden; position: relative; }
.hero::after { content: ""; position: absolute; width: 320px; height: 320px; right: -90px; top: -190px; border: 45px solid rgba(255,255,255,.04); border-radius: 50%; }
.eyebrow { margin-bottom: 10px; color: #73e0c0; font-size: .7rem; font-weight: 750; letter-spacing: .13em; text-transform: uppercase; }
.hero h1 { margin: 0; font-size: clamp(2rem, 4vw, 3.3rem); font-weight: 700; letter-spacing: -.045em; }
.hero p { max-width: 650px; margin: 13px 0 0; color: #bdd0d4; font-size: clamp(.9rem, 1.5vw, 1.03rem); line-height: 1.7; }
.request-credentials { position: relative; z-index: 1; display: inline-flex; align-items: center; gap: 8px; margin-top: 22px; padding: 11px 15px; color: var(--brand); background: var(--accent); border: 0; border-radius: 9px; font-size: .8rem; font-weight: 750; box-shadow: 0 9px 22px rgba(0,0,0,.12); }
.request-credentials:hover { background: #50dbb3; transform: translateY(-1px); }
.hero-stats { position: relative; z-index: 1; display: flex; gap: 10px; }
.hero-stats div { min-width: 90px; padding: 13px 15px; border: 1px solid rgba(255,255,255,.12); border-radius: 12px; background: rgba(255,255,255,.06); backdrop-filter: blur(5px); }
.hero-stats strong, .hero-stats span { display: block; }
.hero-stats strong { font-size: 1.35rem; }
.hero-stats span { margin-top: 2px; color: #a9c3c9; font-size: .65rem; text-transform: uppercase; }

.results-toolbar { max-width: 1280px; margin: 0 auto 17px; display: flex; align-items: center; justify-content: space-between; }
.results-toolbar > div { display: grid; gap: 2px; }
.results-toolbar span { font-size: .91rem; font-weight: 700; }
.results-toolbar small { color: var(--muted); font-size: .72rem; }
.clear-button { padding: 7px 10px; color: #536e75; border: 0; background: transparent; font-size: .75rem; }

.api-grid { max-width: 1280px; margin: 0 auto; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.api-card { position: relative; min-width: 0; padding: 20px; background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 5px 18px rgba(15,54,64,.035); transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease; }
.api-card:hover { transform: translateY(-2px); border-color: #b9d1d5; box-shadow: 0 11px 26px rgba(15,54,64,.08); }
.api-card.deprecated { border-style: dashed; opacity: .84; }
.card-open { position: absolute; inset: 0; border: 0; border-radius: inherit; background: transparent; cursor: pointer; }
.card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.method-badge, .api-tag, .deprecated-badge { display: inline-flex; align-items: center; width: max-content; padding: 4px 8px; border-radius: 6px; font: 700 .65rem/1.2 var(--font-geist-mono, monospace); letter-spacing: .04em; }
.method-get { color: #087f5b; background: #dff7ed; }
.method-post { color: #1761a0; background: #e2f0ff; }
.method-put, .method-patch { color: #9a6513; background: #fff1d2; }
.method-delete { color: #b33d4c; background: #ffe7ea; }
.api-tag { font-family: inherit; letter-spacing: 0; }
.tag-oficial { color: #0d6ba5; background: #e2f3ff; }
.tag-hub { color: #85630a; background: #fff2c4; }
.tag-pro { color: #fff; background: #263439; }
.tag-misto { color: #9d2660; background: #ffe5f2; }
.tag-basico { color: #087957; background: #dcf7ec; }
.tag-webchat { color: #9b5213; background: #ffead7; }
.deprecated-badge { color: #9b5213; background: #ffead7; font-family: inherit; }
.api-card h2 { margin: 16px 0 7px; color: var(--brand); font-size: 1rem; line-height: 1.35; }
.api-card p { height: 40px; margin: 0 0 15px; overflow: hidden; color: var(--muted); font-size: .78rem; line-height: 1.55; }
.endpoint-row { position: relative; z-index: 1; display: flex; align-items: center; gap: 8px; min-width: 0; padding: 9px 10px; border-radius: 8px; background: #f3f7f7; }
.endpoint-row code { flex: 1; min-width: 0; overflow: hidden; color: #395a63; font-size: .69rem; text-overflow: ellipsis; white-space: nowrap; }
.copy-button, .detail-endpoint button, .section-title button { border: 0; color: #6a838a; background: transparent; }
.card-footer { display: flex; align-items: center; justify-content: space-between; margin-top: 15px; color: #809399; font-size: .68rem; }
.view-link { color: var(--brand); font-weight: 700; }

.empty-state { max-width: 1280px; margin: 60px auto; text-align: center; color: var(--muted); }
.empty-state i { display: block; margin-bottom: 12px; font-size: 2rem; color: #aabbbf; }
.empty-state h2 { color: var(--brand); font-size: 1.2rem; }
.empty-state button { padding: 8px 14px; color: #fff; background: var(--brand); border: 0; border-radius: 8px; }

.site-footer { max-width: 1280px; margin: 50px auto 0; padding: 26px 0; display: flex; align-items: center; justify-content: space-between; border-top: 1px solid var(--line); color: #647d84; }
.site-footer > div:first-child { display: flex; align-items: center; gap: 10px; }
.site-footer img { border-radius: 50%; }
.site-footer strong, .site-footer span { display: block; }
.site-footer strong { color: var(--brand); font-size: .82rem; }
.site-footer span { font-size: .68rem; }
.footer-support { display: flex; align-items: center; gap: 12px; }
.footer-support a { color: var(--brand); font-size: .74rem; font-weight: 650; text-decoration: none; }
.footer-support a:hover { text-decoration: underline; }

.detail-panel[hidden] { display: none; }
.detail-panel { position: fixed; inset: 0; z-index: 100; display: flex; justify-content: flex-end; }
.detail-backdrop { position: absolute; inset: 0; background: rgba(2,25,33,.58); backdrop-filter: blur(2px); }
.detail-sheet { position: relative; width: min(720px, 100%); height: 100%; overflow-y: auto; background: #fff; box-shadow: -20px 0 50px rgba(0,0,0,.18); animation: slideIn .22s ease-out; }
@keyframes slideIn { from { transform: translateX(30px); opacity: .6; } }
.detail-close { position: sticky; z-index: 2; top: 18px; float: right; margin: 18px 18px 0 0; width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 50%; color: var(--brand); background: #fff; }
.detail-header { padding: 54px 46px 30px; color: #fff; background: var(--brand); }
.detail-badges { display: flex; gap: 7px; margin-bottom: 22px; }
.detail-module { color: #85d6c0; font-size: .72rem; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; }
.detail-header h2 { margin: 8px 0 10px; font-size: clamp(1.7rem, 4vw, 2.4rem); letter-spacing: -.035em; }
.detail-header p { margin: 0; color: #b7ccd1; line-height: 1.65; }
.detail-section { padding: 24px 46px; border-bottom: 1px solid var(--line); }
.detail-section h3 { margin: 0 0 13px; color: var(--brand); font-size: .86rem; }
.detail-endpoint, .auth-box { display: flex; align-items: center; gap: 11px; padding: 12px; background: #f3f7f7; border-radius: 9px; }
.detail-endpoint code, .auth-box code { min-width: 0; overflow-wrap: anywhere; color: #395a63; font-size: .75rem; }
.detail-endpoint button { margin-left: auto; }
.auth-box i { color: #2a9e80; }
.section-title { display: flex; align-items: center; justify-content: space-between; }
.section-title button { font-size: .72rem; }
pre { max-height: 420px; margin: 0; padding: 18px; overflow: auto; color: #d8e7ea; background: #06212b; border-radius: 10px; font-size: .75rem; line-height: 1.55; }
.detail-section ul { margin: 0; padding-left: 1.1rem; color: #526c73; font-size: .82rem; line-height: 1.65; }
.detail-section li + li { margin-top: 8px; }
.panel-open { overflow: hidden; }
.toast-copy { position: fixed; z-index: 200; left: 50%; bottom: 24px; padding: 10px 15px; color: #fff; background: var(--brand); border-radius: 9px; box-shadow: 0 8px 26px rgba(0,0,0,.2); font-size: .76rem; opacity: 0; transform: translate(-50%, 12px); pointer-events: none; transition: .2s ease; }
.toast-copy.show { opacity: 1; transform: translate(-50%, 0); }
.sidebar-overlay { display: none; }

.admin-log-link { margin-top: 2px; color: var(--brand); border: 1px solid #dbe8ea; background: #f5f9f9; }
.admin-log-link > i { width: auto; font-size: .7rem; }

.auth-page { min-height: 100vh; background:
  radial-gradient(circle at 18% 18%, rgba(39,201,154,.12), transparent 28rem),
  linear-gradient(135deg, #031e28, var(--brand) 55%, #0a4655); }
.auth-shell { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.auth-card { width: min(430px, 100%); padding: clamp(28px, 5vw, 42px); color: var(--ink); background: rgba(255,255,255,.98); border: 1px solid rgba(255,255,255,.24); border-radius: 22px; box-shadow: 0 28px 75px rgba(0,0,0,.28); }
.auth-card > img { display: block; margin-bottom: 24px; border-radius: 50%; box-shadow: 0 0 0 6px #edf5f5; }
.auth-eyebrow, .modal-kicker { color: #16866d; font-size: .67rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.auth-card h1 { margin: 8px 0 9px; color: var(--brand); font-size: clamp(1.65rem, 5vw, 2.15rem); letter-spacing: -.035em; }
.auth-card > p { margin: 0 0 24px; color: var(--muted); font-size: .88rem; line-height: 1.6; }
.auth-card label { display: block; margin-bottom: 7px; color: #34535c; font-size: .75rem; font-weight: 700; }
.password-field { position: relative; display: flex; align-items: center; }
.password-field > i { position: absolute; left: 14px; color: #759097; }
.password-field input { width: 100%; height: 48px; padding: 0 48px 0 41px; color: var(--ink); background: #f8fbfb; border: 1px solid #d5e3e5; border-radius: 10px; }
.password-field input:focus { background: #fff; border-color: #6ba5b0; }
.password-field button { position: absolute; right: 8px; width: 34px; height: 34px; color: #708a91; background: transparent; border: 0; }
.auth-submit { width: 100%; display: flex; align-items: center; justify-content: center; gap: 9px; margin-top: 14px; padding: 13px; color: #fff; background: var(--brand); border: 0; border-radius: 10px; font-size: .84rem; font-weight: 750; }
.auth-submit:hover { background: var(--brand-2); }
.auth-card > small { display: block; margin-top: 20px; color: #82969b; font-size: .68rem; text-align: center; }
.auth-card > small i { color: #159174; }
.auth-card .alert { font-size: .76rem; }

.credentials-modal { border: 0; border-radius: 16px; box-shadow: 0 24px 65px rgba(3,31,40,.23); overflow: hidden; }
.credentials-modal .modal-header { padding: 22px 24px; border-color: var(--line); }
.credentials-modal .modal-title { margin-top: 5px; color: var(--brand); font-weight: 750; }
.credentials-modal .modal-body { padding: 24px; }
.credentials-modal .form-label { color: #375861; font-size: .78rem; font-weight: 700; }
.credentials-modal .form-control { min-height: 46px; border-color: #d5e3e5; }
.credentials-modal .modal-body small { display: block; margin-top: 9px; color: var(--muted); font-size: .7rem; }
.credentials-modal .modal-footer { padding: 16px 24px; border-color: var(--line); }
.btn-brand { color: #fff; background: var(--brand); }
.btn-brand:hover { color: #fff; background: var(--brand-2); }

.logs-sheet { width: min(1050px, 100%); }
.logs-header { padding: 48px 44px 26px; color: #fff; background: var(--brand); }
.logs-header h2 { margin: 7px 0 7px; font-size: 2rem; letter-spacing: -.035em; }
.logs-header p { margin: 0; color: #b9cdd2; font-size: .83rem; }
.logs-toolbar { display: flex; align-items: center; justify-content: space-between; padding: 17px 28px; color: var(--muted); border-bottom: 1px solid var(--line); font-size: .76rem; }
.logs-toolbar button { padding: 7px 10px; color: var(--brand); background: #edf5f5; border: 0; border-radius: 8px; font-weight: 700; }
.logs-table-wrap { padding: 0 28px 32px; overflow-x: auto; }
.logs-table { min-width: 760px; margin: 0; font-size: .74rem; }
.logs-table th { padding: 14px 10px 10px; color: #82959a; border-bottom-color: var(--line); font-size: .65rem; letter-spacing: .06em; text-transform: uppercase; }
.logs-table td { padding: 12px 10px; color: #4d6870; border-bottom-color: #edf2f3; vertical-align: middle; }
.logs-table code { color: var(--brand); background: #edf4f5; border-radius: 5px; padding: 3px 6px; }
.logs-empty { padding: 48px; color: var(--muted); text-align: center; }

@media (max-width: 1050px) {
  .api-grid { grid-template-columns: 1fr; }
  .hero { align-items: flex-start; flex-direction: column; }
}

@media (max-width: 820px) {
  .topbar { height: 64px; padding: 0 16px; }
  .app-shell { padding-top: 64px; }
  .mobile-menu { display: block; padding: 0 5px 0 0; }
  .version-pill { display: none; }
  .logout-button span { display: none; }
  .logout-button { width: 36px; height: 36px; justify-content: center; padding: 0; }
  .sidebar { top: 64px; width: min(310px, 87vw); transform: translateX(-105%); transition: transform .22s ease; box-shadow: 18px 0 35px rgba(4,41,54,.14); }
  .sidebar.open { transform: translateX(0); }
  .sidebar-overlay.show { position: fixed; z-index: 35; inset: 64px 0 0; display: block; background: rgba(4,41,54,.44); }
  .content { margin-left: 0; padding: 20px 16px 0; }
  .hero { margin-bottom: 24px; border-radius: 16px; }
  .hero-stats { width: 100%; }
  .hero-stats div { flex: 1; }
  .site-footer, .footer-support { align-items: flex-start; flex-direction: column; }
  .site-footer { gap: 20px; }
  .footer-support { gap: 7px; }
}

@media (max-width: 520px) {
  .hero { padding: 24px 20px; }
  .hero h1 { font-size: 2rem; }
  .api-card { padding: 17px; }
  .card-footer { align-items: flex-start; gap: 7px; flex-direction: column; }
  .detail-header { padding: 54px 22px 25px; }
  .detail-section { padding: 22px; }
  .logs-header { padding: 52px 22px 23px; }
  .logs-toolbar { padding: 14px 18px; }
  .logs-table-wrap { padding: 0 12px 25px; }
  .results-toolbar { align-items: flex-start; gap: 8px; }
  .clear-button { padding-top: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
