/* Manuais CÂMBIO — tema unificado */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,400;0,9..40,600;0,9..40,700;1,9..40,400&display=swap');

:root {
  --bg: #0f1419;
  --bg-soft: #1a222d;
  --surface: #ffffff;
  --surface-2: #f4f6f9;
  --accent: #c9a227;
  --accent-dim: #e8d48b;
  --text: #1a1f26;
  --muted: #5c6570;
  --border: #e2e6ec;
  --radius: 14px;
  --shadow: 0 8px 32px rgba(15, 20, 25, 0.08);
  --header-h: 64px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: 'DM Sans', system-ui, sans-serif;
  background: linear-gradient(165deg, var(--bg) 0%, #1c2430 45%, var(--bg-soft) 100%);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

body.manuais-home,
body.manuais-hub {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

/* Barra superior */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1rem 0 1.25rem;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  max-width: 1280px;
  margin: 0 auto;
  width: 100%;
}

.site-header .brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--text);
}

.site-header .brand img {
  height: 40px;
  width: auto;
  object-fit: contain;
}

.site-header .brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.site-header .brand-text strong {
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.site-header .brand-text span {
  font-size: 0.72rem;
  color: var(--muted);
  font-weight: 500;
}

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 1rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  transition: background 0.2s, border-color 0.2s, transform 0.15s;
}

.back-btn:hover {
  background: var(--surface-2);
  border-color: var(--accent);
  transform: translateY(-1px);
}

.wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem 1rem 3rem;
  width: 100%;
}

/* Home */
body.manuais-home .hero-card {
  max-width: 560px;
  margin: 2rem auto 0;
  padding: 2.25rem 1.75rem;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  text-align: center;
  border: 1px solid rgba(255, 255, 255, 0.8);
}

body.manuais-home .hero-card .logo-big {
  margin-bottom: 1.25rem;
}

body.manuais-home .hero-card .logo-big img {
  height: 72px;
  width: auto;
}

body.manuais-home .hero-card h1 {
  margin: 0 0 0.5rem;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
}

body.manuais-home .hero-card .lead {
  margin: 0 0 1.75rem;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.5;
}

.index-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.index-list a {
  display: block;
  padding: 1rem 1.25rem;
  border-radius: 999px;
  text-decoration: none;
  color: var(--text);
  font-weight: 700;
  font-size: 0.95rem;
  background: linear-gradient(135deg, #fffef5 0%, var(--accent-dim) 100%);
  border: 1px solid rgba(201, 162, 39, 0.35);
  transition: transform 0.2s, box-shadow 0.2s;
}

.index-list a:hover {
  transform: scale(1.02);
  box-shadow: 0 8px 24px rgba(201, 162, 39, 0.25);
}

body.manuais-home .dash-link {
  margin-top: 1.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.65rem 1.25rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
  border-radius: 999px;
  border: 1px dashed var(--border);
  transition: color 0.2s, border-color 0.2s;
}

body.manuais-home .dash-link:hover {
  color: var(--text);
  border-color: var(--accent);
}

body.manuais-home .site-header .back-btn {
  font-size: 0.8rem;
}

/* Hub (grades de montadoras) */
body.manuais-hub .panel {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1.5rem 1.25rem 2rem;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

body.manuais-hub .panel h1 {
  margin: 0 0 0.35rem;
  font-size: 1.35rem;
  text-align: center;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--text);
}

body.manuais-hub .panel .sub {
  text-align: center;
  color: var(--muted);
  font-size: 0.88rem;
  margin-bottom: 1.5rem;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 1rem;
}

@media (min-width: 640px) {
  .grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  }
}

.card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem 0.75rem;
  text-align: center;
  text-decoration: none;
  color: var(--text);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  min-height: 132px;
  justify-content: center;
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.card:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
  box-shadow: 0 12px 28px rgba(201, 162, 39, 0.15);
}

.card .m-logo {
  width: 64px;
  height: 64px;
  object-fit: contain;
}

.card .m-name {
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.03em;
  line-height: 1.2;
}

/* Detalhe (lista de documentos) */
body.manuais-detail .layout {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  max-width: 1100px;
  margin: 0 auto;
}

@media (min-width: 900px) {
  body.manuais-detail .layout {
    flex-direction: row;
    align-items: flex-start;
  }
}

.sidebar {
  flex: 0 0 auto;
  width: 100%;
  max-width: 320px;
  margin: 0 auto;
  position: sticky;
  top: calc(var(--header-h) + 12px);
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

@media (max-width: 899px) {
  .sidebar {
    position: static;
    max-width: none;
  }
}

.sidebar h1 {
  margin: 0 0 0.35rem;
  font-size: 1.15rem;
  font-weight: 700;
  text-align: center;
  letter-spacing: 0.06em;
}

.sidebar .hint {
  margin: 0;
  font-size: 0.82rem;
  color: var(--muted);
  text-align: center;
  line-height: 1.45;
}

.main-content {
  flex: 1;
  min-width: 0;
  background: var(--surface);
  padding: 1.25rem 1rem 1.5rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

@media (min-width: 640px) {
  .main-content {
    padding: 1.5rem 1.5rem 2rem;
  }
}

.file-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.file-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1rem 1rem;
  border-radius: 12px;
  text-decoration: none;
  color: var(--text);
  background: linear-gradient(135deg, #fffef8 0%, #f8f4e4 100%);
  border: 1px solid rgba(201, 162, 39, 0.28);
  transition: transform 0.15s, box-shadow 0.15s;
}

.file-item:hover {
  transform: translateX(4px);
  box-shadow: 0 6px 20px rgba(201, 162, 39, 0.12);
}

.file-item .file-info {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  font-weight: 600;
  font-size: 0.9rem;
  line-height: 1.35;
  text-align: left;
}

.file-item .file-info .doc-title {
  font-weight: 600;
}

.file-item .file-info small {
  font-weight: 500;
  font-size: 0.75rem;
  color: var(--muted);
}

.file-item .file-type {
  flex-shrink: 0;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  background: var(--surface);
  padding: 0.35rem 0.55rem;
  border-radius: 6px;
  border: 1px solid var(--border);
}

.file-item.file-item--doc-html {
  background: linear-gradient(135deg, #f0f7ff 0%, #e8f0fa 100%);
  border-color: rgba(80, 130, 200, 0.25);
}

.print-watermark {
  display: none;
}

@media print {
  .site-header,
  .sidebar {
    display: none !important;
  }
  .print-watermark {
    display: block;
    position: fixed;
    inset: 0;
    font-size: 28px;
    color: rgba(200, 0, 0, 0.35);
    font-weight: 800;
    transform: rotate(-18deg);
    z-index: 9999;
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
  }
}
