/* ============================================================
   AGROVISION 2.0 — style.css
   Estética: Editorial Agrícola — luz natural, tipografia forte,
   formas orgânicas, layout bento assimétrico
   Fontes: Instrument Serif (display) + Plus Jakarta Sans (corpo)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Instrument+Serif:ital@0;1&family=Plus+Jakarta+Sans:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;1,300;1,400&display=swap');

/* ─── TOKENS ─────────────────────────────────────────── */
:root {
  --bg:           #f0f7f2;
  --bg-warm:      #eaf4ed;
  --bg-paper:     #f8fbf8;
  --surface:      #ffffff;
  --surface-soft: #f3f9f4;
  --surface-tint: #ebf5ee;
  --line:         #d0e8d6;
  --line-mid:     #b6d9bf;
  --line-strong:  #8fbfa0;
  --text:         #1a2e22;
  --text-mid:     #3d5e48;
  --muted:        #6b8f77;
  --muted-light:  #9ab8a3;
  --brand:        #2d7a4f;
  --brand-2:      #1f6640;
  --brand-light:  #4a9e6a;
  --brand-pale:   #c8ebd4;
  --brand-wash:   #e8f6ec;
  --danger:       #c0392b;
  --danger-pale:  #fdf0ef;
  --warning:      #c07028;
  --warning-pale: #fdf4e7;
  --shadow-xs: 0 1px 3px rgba(30,80,50,0.06);
  --shadow-sm: 0 2px 8px rgba(30,80,50,0.08), 0 1px 2px rgba(30,80,50,0.04);
  --shadow-md: 0 4px 16px rgba(30,80,50,0.10), 0 2px 4px rgba(30,80,50,0.05);
  --shadow-lg: 0 12px 40px rgba(30,80,50,0.12), 0 4px 12px rgba(30,80,50,0.06);
  --shadow-xl: 0 24px 64px rgba(30,80,50,0.14), 0 8px 24px rgba(30,80,50,0.07);
  --r-xs:   4px;
  --r-sm:   8px;
  --r-md:   14px;
  --r-lg:   20px;
  --r-xl:   28px;
  --r-2xl:  40px;
  --r-full: 9999px;
  --font-display: 'Instrument Serif', Georgia, serif;
  --font-body:    'Plus Jakarta Sans', system-ui, sans-serif;
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-out:    cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --dur-fast:  140ms;
  --dur-mid:   300ms;
  --dur-slow:  520ms;
  --nav-h: 62px;
}

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

html {
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: var(--line-mid) var(--bg);
}
html::-webkit-scrollbar { width: 5px; }
html::-webkit-scrollbar-track { background: var(--bg); }
html::-webkit-scrollbar-thumb { background: var(--line-mid); border-radius: var(--r-full); }

body {
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 400;
  line-height: 1.65;
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  position: relative;
}

/* Gradientes ambiente no fundo */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    radial-gradient(ellipse 70% 50% at 10% 5%,  rgba(45,122,79,0.05) 0%, transparent 60%),
    radial-gradient(ellipse 50% 70% at 90% 95%, rgba(74,158,106,0.06) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
}

/* Blob orgânico flutuante — canto sup. direito */
body::after {
  content: '';
  position: fixed;
  top: -100px;
  right: -100px;
  width: 400px;
  height: 400px;
  background: radial-gradient(ellipse at center, rgba(200,235,212,0.45) 0%, transparent 65%);
  border-radius: 62% 38% 70% 30% / 40% 60% 40% 60%;
  animation: floatBlob 22s ease-in-out infinite;
  pointer-events: none;
  z-index: 0;
}

a { color: var(--brand); text-decoration: none; transition: color var(--dur-fast) var(--ease-out); }
a:hover { color: var(--brand-2); }

/* ─── KEYFRAMES ──────────────────────────────────────── */
@keyframes floatBlob {
  0%,100% { transform: translate(0,0) rotate(0deg) scale(1); }
  25%      { transform: translate(-20px,25px) rotate(6deg) scale(1.06); }
  50%      { transform: translate(12px,-18px) rotate(-4deg) scale(0.96); }
  75%      { transform: translate(-10px,12px) rotate(5deg) scale(1.03); }
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(28px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.92); }
  to   { opacity: 1; transform: scale(1); }
}
@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-24px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shimmer {
  0%   { background-position: -600px 0; }
  100% { background-position:  600px 0; }
}
@keyframes drawLine {
  from { width: 0; }
  to   { width: 100%; }
}
@keyframes drawLineX {
  from { transform: scaleX(0); }
  to   { transform: scaleX(1); }
}
@keyframes dotPulse {
  0%,100% { transform: scale(1);   opacity: 1; }
  50%      { transform: scale(1.5); opacity: 0.4; }
}
@keyframes countUp {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes leafSway {
  0%,100% { transform: rotate(-3deg) scale(1); }
  50%      { transform: rotate(3deg) scale(1.05); }
}
@keyframes borderGlow {
  0%,100% { border-color: var(--line); }
  50%      { border-color: var(--line-mid); }
}
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ─── SCROLL REVEAL ──────────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity var(--dur-slow) var(--ease-out), transform var(--dur-slow) var(--ease-out);
}
.reveal.revealed { opacity: 1; transform: translateY(0); }

.reveal-left {
  opacity: 0; transform: translateX(-30px);
  transition: opacity var(--dur-slow) var(--ease-out), transform var(--dur-slow) var(--ease-out);
}
.reveal-left.revealed { opacity: 1; transform: translateX(0); }

.reveal-right {
  opacity: 0; transform: translateX(30px);
  transition: opacity var(--dur-slow) var(--ease-out), transform var(--dur-slow) var(--ease-out);
}
.reveal-right.revealed { opacity: 1; transform: translateX(0); }

.reveal-scale {
  opacity: 0; transform: scale(0.93);
  transition: opacity var(--dur-slow) var(--ease-out), transform var(--dur-slow) var(--ease-spring);
}
.reveal-scale.revealed { opacity: 1; transform: scale(1); }

.reveal-d1 { transition-delay: 70ms; }
.reveal-d2 { transition-delay: 140ms; }
.reveal-d3 { transition-delay: 210ms; }
.reveal-d4 { transition-delay: 280ms; }
.reveal-d5 { transition-delay: 350ms; }
.reveal-d6 { transition-delay: 420ms; }

/* ─── HEADER ─────────────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 200;
  height: var(--nav-h);
  padding: 0 2rem;
  background: rgba(248,251,248,0.92);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  animation: fadeIn 400ms var(--ease-out) both;
}

/* Linha verde que se desenha no carregamento */
.site-header::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 2rem;
  height: 2px;
  width: 0;
  background: linear-gradient(90deg, var(--brand), var(--brand-light), transparent);
  animation: drawLine 700ms 300ms var(--ease-out) forwards;
  border-radius: var(--r-full);
}

.brand-block { display: flex; align-items: center; }
.brand-link {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  color: var(--text);
  text-decoration: none;
  transition: opacity var(--dur-fast);
}
.brand-link:hover { opacity: 0.7; color: var(--text); }

.brand-logo {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  object-fit: cover;
  border: 0;
  box-shadow: var(--shadow-sm);
  transition: transform var(--dur-mid) var(--ease-spring), box-shadow var(--dur-mid);
}
.brand-link:hover .brand-logo {
  transform: rotate(-6deg) scale(1.06);
  box-shadow: var(--shadow-md);
}

.brand-name {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-style: italic;
  color: var(--brand-2);
  letter-spacing: 0.01em;
}

.page-title {
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin: 0;
}

/* ─── TOP NAV — UNDERLINE STYLE ──────────────────────── */
.top-nav {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  text-align: center;
  width: 100%;
  gap: 0;
  padding: 0 2rem;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  overflow-x: visible;
  scrollbar-width: none;
  animation: fadeIn 400ms 100ms var(--ease-out) both;
}
.top-nav::-webkit-scrollbar { display: none; }

.top-nav-item {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.95rem 1.05rem;
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--muted);
  text-decoration: none;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color var(--dur-fast) var(--ease-out), border-color var(--dur-fast);
  position: relative;
}
.top-nav-item i {
  font-size: 0.82rem;
  transition: transform var(--dur-mid) var(--ease-spring);
}
.top-nav-item:hover { color: var(--text); }
.top-nav-item:hover i { transform: translateY(-1px); }
.top-nav-item.active {
  color: var(--brand);
  border-bottom-color: var(--brand);
  font-weight: 600;
}

/* ─── MAIN ───────────────────────────────────────────── */
.page-main {
  width: min(1280px, 95vw);
  margin: 2rem auto 3.5rem;
  position: relative;
  z-index: 1;
}

/* ─── SURFACE CARD ───────────────────────────────────── */
.surface-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-sm);
  padding: 1.6rem 1.8rem;
  position: relative;
  overflow: hidden;
  transition:
    box-shadow var(--dur-mid) var(--ease-out),
    border-color var(--dur-mid) var(--ease-out),
    transform var(--dur-mid) var(--ease-out);
}
.surface-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--line-mid);
  transform: translateY(-2px);
}
/* Brilho orgânico no canto */
.surface-card::before {
  content: '';
  position: absolute;
  top: -40px; right: -40px;
  width: 120px; height: 120px;
  background: radial-gradient(ellipse, var(--brand-wash) 0%, transparent 68%);
  border-radius: 60% 40% 55% 45% / 50% 55% 45% 55%;
  pointer-events: none;
  opacity: 0.6;
  transition: transform var(--dur-mid) var(--ease-spring), opacity var(--dur-mid);
}
.surface-card:hover::before { transform: scale(1.3) rotate(8deg); opacity: 1; }

/* ─── GRIDS ──────────────────────────────────────────── */
.page-grid  { display: grid; gap: 1.25rem; }
.grid-two   { grid-template-columns: 1fr 1fr; }
.grid-three { grid-template-columns: repeat(3, 1fr); }
.grid-auto  { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }

/* BENTO GRID assimétrico */
.bento-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 1.25rem;
}
.bento-col-3  { grid-column: span 3; }
.bento-col-4  { grid-column: span 4; }
.bento-col-5  { grid-column: span 5; }
.bento-col-6  { grid-column: span 6; }
.bento-col-7  { grid-column: span 7; }
.bento-col-8  { grid-column: span 8; }
.bento-col-12 { grid-column: span 12; }

.mt-1 { margin-top: 1.25rem; }
.mt-2 { margin-top: 2rem; }
.max-w-sm { max-width: 400px; }
.max-w-md { max-width: 580px; }

/* ─── TIPOGRAFIA ─────────────────────────────────────── */
.section-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-style: italic;
  font-weight: 400;
  color: var(--text);
  margin: 0 0 1.1rem;
  letter-spacing: 0.01em;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Linha decorativa após título */
.section-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--line-mid), transparent);
  margin-left: 0.75rem;
  transform-origin: left;
  animation: drawLineX 600ms 200ms var(--ease-out) both;
}

.text-muted { color: var(--muted); }
.text-error { color: var(--danger); }

/* ─── STAT VALUE ─────────────────────────────────────── */
.stat-value {
  font-family: var(--font-display);
  font-size: 3.2rem;
  font-style: italic;
  font-weight: 400;
  color: var(--brand-2);
  line-height: 1;
  margin: 0.6rem 0 0.4rem;
  letter-spacing: -0.02em;
  animation: countUp var(--dur-slow) var(--ease-out) both;
}

/* ─── BOTÕES ─────────────────────────────────────────── */
.btn,
button,
.desktop-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border: 0;
  border-radius: var(--r-full);
  padding: 0.6rem 1.35rem;
  cursor: pointer;
  text-decoration: none;
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  background: var(--brand);
  color: #fff;
  box-shadow: var(--shadow-sm);
  transition:
    transform var(--dur-fast) var(--ease-spring),
    box-shadow var(--dur-mid) var(--ease-out),
    background var(--dur-fast);
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}
.btn::after, button::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0);
  transition: background var(--dur-fast);
}
.btn:active::after, button:active::after { background: rgba(255,255,255,0.15); }

.btn:hover, button:hover, .desktop-btn:hover {
  background: var(--brand-2);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md), 0 0 0 4px rgba(45,122,79,0.1);
  color: #fff;
}
.btn:active, button:active, .desktop-btn:active {
  transform: translateY(0) scale(0.97);
  box-shadow: var(--shadow-xs);
}
.btn.secondary, .desktop-btn.secondary {
  background: var(--surface-tint);
  color: var(--brand-2);
  border: 1.5px solid var(--line-mid);
  box-shadow: var(--shadow-xs);
}
.btn.secondary:hover, .desktop-btn.secondary:hover {
  background: var(--brand-wash);
  border-color: var(--line-strong);
  color: var(--brand-2);
  box-shadow: var(--shadow-sm);
}

.actions-row {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-top: 1.1rem;
}

.dashboard-ai-state {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 0.65rem;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 600;
}

.dashboard-ai-state.is-hidden {
  display: none;
}

.dashboard-ai-spinner {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid var(--line-mid);
  border-top-color: var(--brand);
  animation: spin 5.2s linear infinite !important;
  flex-shrink: 0;
}

.dashboard-ai-text {
  margin: 0;
  white-space: pre-line;
  min-height: 2.6rem;
  line-height: 1.58;
}

/* ─── FORMS ──────────────────────────────────────────── */
form { display: grid; gap: 0.9rem; }
label {
  display: block;
  font-size: 0.73rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.3rem;
}
input, select, textarea {
  width: 100%;
  padding: 0.7rem 1rem;
  border-radius: var(--r-md);
  border: 1.5px solid var(--line);
  background: var(--surface);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.9rem;
  outline: none;
  transition:
    border-color var(--dur-fast) var(--ease-out),
    box-shadow var(--dur-fast) var(--ease-out),
    background var(--dur-fast);
}
input::placeholder, textarea::placeholder { color: var(--muted-light); }
input:hover, select:hover, textarea:hover { border-color: var(--line-mid); }
input:focus, select:focus, textarea:focus {
  border-color: var(--brand);
  background: var(--bg-paper);
  box-shadow: 0 0 0 3px rgba(45,122,79,0.1);
}
select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='7' viewBox='0 0 12 7'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236b8f77' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 2.5rem;
}

/* ─── UPLOAD DROPZONE ────────────────────────────────── */
.upload-dropzone {
  border: 2px dashed var(--line-mid);
  border-radius: var(--r-xl);
  padding: 2.5rem 1.5rem;
  text-align: center;
  background: var(--surface-tint);
  cursor: pointer;
  display: block;
  position: relative;
  overflow: hidden;
  transition:
    border-color var(--dur-mid) var(--ease-out),
    background var(--dur-mid) var(--ease-out),
    transform var(--dur-mid) var(--ease-spring);
}
.upload-dropzone::before {
  content: '🌿';
  position: absolute;
  top: 1rem; right: 1.5rem;
  font-size: 1.6rem;
  opacity: 0.25;
  animation: leafSway 4s ease-in-out infinite;
  pointer-events: none;
}
.upload-dropzone:hover, .upload-dropzone.dragging {
  border-color: var(--brand-light);
  background: var(--brand-wash);
  transform: scale(1.01);
  border-style: solid;
}
.upload-dropzone i {
  font-size: 2.4rem;
  color: var(--brand-light);
  display: block;
  margin-bottom: 0.75rem;
  transition: transform var(--dur-mid) var(--ease-spring);
}
.upload-dropzone:hover i { transform: translateY(-5px) scale(1.08); }

.preview-image {
  display: block;
  max-width: 100%;
  max-height: 280px;
  object-fit: contain;
  border-radius: var(--r-lg);
  margin-top: 1rem;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-md);
  animation: scaleIn var(--dur-slow) var(--ease-spring) both;
}

/* ─── ANALYSIS RESULT ────────────────────────────────── */
.analysis-result {
  line-height: 1.7;
  animation: fadeUp var(--dur-slow) var(--ease-out) both;
}
.analysis-result h3 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-style: italic;
  color: var(--brand-2);
  margin-bottom: 0.75rem;
}
.analysis-result ul { list-style: none; display: grid; gap: 0.65rem; }
.disease-list li {
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-left: 3px solid var(--brand-pale);
  border-radius: 0 var(--r-md) var(--r-md) 0;
  padding: 0.75rem 1rem;
  font-size: 0.88rem;
  transition:
    border-left-color var(--dur-fast),
    background var(--dur-fast),
    transform var(--dur-mid) var(--ease-spring);
}
.disease-list li:hover {
  border-left-color: var(--brand);
  background: var(--brand-wash);
  transform: translateX(4px);
}

/* ─── CHATBOX ────────────────────────────────────────── */
.chatbox {
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  min-height: 420px;
  max-height: 62vh;
  overflow-y: auto;
  padding: 1.1rem;
  background: var(--bg-warm);
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}
.chatbox::-webkit-scrollbar { width: 4px; }
.chatbox::-webkit-scrollbar-thumb { background: var(--line-mid); border-radius: var(--r-full); }

.message {
  max-width: 76%;
  padding: 0.75rem 1rem;
  line-height: 1.55;
  font-size: 0.88rem;
  animation: fadeUp 220ms var(--ease-out) both;
}
.message.user {
  margin-left: auto;
  background: var(--brand);
  color: #fff;
  border-radius: var(--r-xl) var(--r-xl) var(--r-xs) var(--r-xl);
  box-shadow: var(--shadow-sm);
}
.message.bot {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-xl) var(--r-xl) var(--r-xl) var(--r-xs);
  color: var(--text);
  box-shadow: var(--shadow-xs);
}
.message.error {
  background: var(--danger-pale);
  border: 1px solid rgba(192,57,43,0.18);
  color: var(--danger);
  border-radius: var(--r-md);
  max-width: 100%;
}

/* Indicador de digitação */
.typing-indicator {
  display: flex;
  gap: 5px;
  align-items: center;
  padding: 0.75rem 1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-xl) var(--r-xl) var(--r-xl) var(--r-xs);
  width: fit-content;
  box-shadow: var(--shadow-xs);
}
.typing-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--muted-light);
  animation: dotPulse 1.4s ease-in-out infinite;
}
.typing-dot:nth-child(2) { animation-delay: 200ms; }
.typing-dot:nth-child(3) { animation-delay: 400ms; }

.chat-form {
  display: flex;
  gap: 0.6rem;
  margin-top: 0.75rem;
}
.chat-form input { flex: 1; border-radius: var(--r-full); }
.chat-form button { border-radius: var(--r-full); padding: 0.6rem 1.2rem; flex-shrink: 0; }

/* ─── CHARTS ─────────────────────────────────────────── */
.chart-box { min-height: 280px; }
.chart-box canvas { width: 100% !important; height: 260px !important; }

/* ─── HISTORY RECORDS ────────────────────────────────── */
.list-grid { display: grid; gap: 0.9rem; }

.record-card {
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  padding: 1.1rem 1.4rem;
  background: var(--surface);
  display: grid;
  grid-template-columns: 4px minmax(0, 1fr);
  gap: 0.35rem 1.2rem;
  align-items: start;
  transition:
    border-color var(--dur-fast),
    box-shadow var(--dur-mid) var(--ease-out),
    transform var(--dur-mid) var(--ease-spring);
}
.record-card:hover {
  border-color: var(--line-mid);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}
/* Barra lateral colorida */
.record-card::before {
  content: '';
  grid-column: 1;
  grid-row: 1 / -1;
  background: linear-gradient(to bottom, var(--brand-pale), var(--brand));
  border-radius: var(--r-full);
  align-self: stretch;
}
.record-card > * {
  grid-column: 2;
  min-width: 0;
}
.record-card h3 {
  font-family: var(--font-body);
  font-size: 0.88rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
  color: var(--text);
}

/* ─── BADGES ─────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  border-radius: var(--r-full);
  padding: 0.18rem 0.65rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  background: var(--brand-wash);
  color: var(--brand-2);
  border: 1px solid var(--brand-pale);
}
.badge.warning {
  background: var(--warning-pale);
  color: var(--warning);
  border-color: rgba(192,112,40,0.2);
}
.badge.error {
  background: var(--danger-pale);
  color: var(--danger);
  border-color: rgba(192,57,43,0.2);
}

/* ─── TABLE ──────────────────────────────────────────── */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--r-lg);
  border: 1px solid var(--line);
}
.table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.table th {
  background: var(--surface-soft);
  padding: 0.7rem 1rem;
  text-align: left;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.7rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom: 1px solid var(--line-mid);
}
.table td {
  padding: 0.65rem 1rem;
  border-bottom: 1px solid var(--line);
  color: var(--text);
  transition: background var(--dur-fast);
}
.table tbody tr { transition: background var(--dur-fast); }
.table tbody tr:hover td { background: var(--bg-warm); }
.table tbody tr:last-child td { border-bottom: none; }

/* ─── MONITOR GRID ───────────────────────────────────── */
.monitor-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(168px, 1fr));
  gap: 1rem;
}
.monitor-card {
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  background: var(--surface);
  padding: 1rem 1.1rem;
  position: relative;
  overflow: hidden;
  transition:
    border-color var(--dur-fast),
    box-shadow var(--dur-mid) var(--ease-out),
    transform var(--dur-mid) var(--ease-spring);
}
.monitor-card::after {
  content: '';
  position: absolute;
  top: -20px; right: -20px;
  width: 80px; height: 80px;
  background: radial-gradient(ellipse, var(--brand-wash) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}
.monitor-card:hover {
  border-color: var(--line-mid);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.monitor-value {
  font-family: var(--font-display);
  font-size: 1.9rem;
  font-style: italic;
  font-weight: 400;
  color: var(--brand-2);
  margin: 0.25rem 0 0.1rem;
  letter-spacing: -0.02em;
}

/* ─── FOOTER ─────────────────────────────────────────── */
.site-footer {
  border-top: 1px solid var(--line);
  color: var(--muted);
  padding: 1.35rem 0 1.7rem;
  background: linear-gradient(180deg, rgba(255,255,255,0.92) 0%, var(--surface-soft) 100%);
  position: relative;
  z-index: 2;
}
.site-footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 18%;
  right: 18%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--line-mid), transparent);
  pointer-events: none;
}
.site-footer-inner {
  width: min(1280px, 95vw);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 0.9rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: rgba(255, 255, 255, 0.86);
  box-shadow: var(--shadow-xs);
}
.site-footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--brand-2);
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.04rem;
}
.site-footer-brand-icon {
  width: 26px;
  height: 26px;
  border-radius: var(--r-sm);
  background: linear-gradient(135deg, var(--brand), var(--brand-light));
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  box-shadow: var(--shadow-xs);
}
.site-footer-copy {
  font-size: 0.79rem;
  letter-spacing: 0.03em;
  color: var(--muted);
}
.site-footer-links {
  display: inline-flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}
.site-footer-links a {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 500;
  transition: color var(--dur-fast) var(--ease-out);
}
.site-footer-links a:hover {
  color: var(--brand-2);
}

/* Badge fixo de autoria */
.dev-badge {
  position: fixed;
  right: 14px;
  bottom: 14px;
  z-index: 9500;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  max-width: min(96vw, 540px);
  padding: 0.56rem 0.88rem;
  border-radius: var(--r-full);
  border: 1px solid rgba(255, 255, 255, 0.62);
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.56) 0%,
    rgba(232, 246, 236, 0.36) 100%
  );
  color: #1f3e2b;
  box-shadow:
    0 12px 34px rgba(31, 102, 64, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(15px) saturate(145%);
  -webkit-backdrop-filter: blur(15px) saturate(145%);
  font-family: var(--font-body);
  font-size: 0.74rem;
  line-height: 1.2;
  isolation: isolate;
  overflow: hidden;
}
.dev-badge::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(
    130deg,
    rgba(255, 255, 255, 0.38) 0%,
    rgba(255, 255, 255, 0.04) 52%,
    rgba(45, 122, 79, 0.12) 100%
  );
  pointer-events: none;
  opacity: 0.75;
}
.dev-badge > * {
  position: relative;
  z-index: 1;
}
.dev-badge-logo {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 0;
  box-shadow: none;
}
.dev-badge-prefix {
  color: #355743;
  white-space: nowrap;
}
.dev-badge-sep {
  color: #406650;
  white-space: nowrap;
}
.dev-badge-link {
  color: #1f6640;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  border-bottom: 1px dotted rgba(31, 102, 64, 0.45);
  transition: color var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out);
}
.dev-badge-link:hover {
  color: #174f33;
  border-bottom-color: rgba(23, 79, 51, 0.85);
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .dev-badge {
    background: rgba(237, 247, 240, 0.96);
  }
}

/* ─── LOADING OVERLAY ────────────────────────────────── */
.loading-overlay[hidden] { display: none !important; }
.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(240,247,242,0.78);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 200ms var(--ease-out) both;
}
.loading-card {
  background: var(--surface);
  border: 1px solid var(--line-mid);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-xl);
  padding: 1rem 1.5rem;
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
  min-width: 220px;
  animation: scaleIn 280ms var(--ease-spring) both;
}
.loading-card p {
  margin: 0;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--text);
}
.loading-spinner {
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 2.5px solid var(--line-mid);
  border-top-color: var(--brand);
  animation: spin 2.8s linear infinite !important;
  flex-shrink: 0;
  will-change: transform;
}
body.ui-loading { cursor: wait; }
body.ui-loading a,
body.ui-loading button,
body.ui-loading input,
body.ui-loading select,
body.ui-loading textarea { pointer-events: none; }

/* ─── SKELETON ───────────────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg, var(--surface-tint) 0%, var(--surface-soft) 50%, var(--surface-tint) 100%);
  background-size: 600px 100%;
  animation: shimmer 1.4s ease-in-out infinite;
  border-radius: var(--r-sm);
}

/* ─── PROGRESS BAR ───────────────────────────────────── */
.progress-bar { height: 4px; background: var(--line); border-radius: var(--r-full); overflow: hidden; }
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--brand-pale), var(--brand));
  border-radius: var(--r-full);
  animation: drawLine 1s var(--ease-out) both;
}

/* ─── TOOLTIP ────────────────────────────────────────── */
[data-tooltip] { position: relative; }
[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  background: var(--text);
  color: #fff;
  border-radius: var(--r-sm);
  padding: 0.3rem 0.65rem;
  font-size: 0.73rem;
  font-family: var(--font-body);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--dur-fast), transform var(--dur-fast);
  z-index: 50;
}
[data-tooltip]:hover::after { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ─── AI INSIGHT BLOCK ───────────────────────────────── */
.ai-insight-block {
  font-size: 0.9rem;
  line-height: 1.8;
  color: var(--text-mid);
  padding: 1rem 1.25rem;
  background: var(--surface-soft);
  border-radius: var(--r-lg);
  border-left: 3px solid var(--brand-light);
  font-family: var(--font-display);
  font-style: italic;
}

/* ─── DIVIDER ────────────────────────────────────────── */
.divider {
  border: none;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--line-mid), transparent);
  margin: 1.5rem 0;
}

/* ─── FOCUS VISIBLE ──────────────────────────────────── */
:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; border-radius: var(--r-sm); }
::selection { background: var(--brand-pale); color: var(--brand-2); }

/* ─── TOGGLE ─────────────────────────────────────────── */
.mobile-only  { display: none; }
.desktop-only { display: block; }

/* ─── RESPONSIVE ─────────────────────────────────────── */
@media (max-width: 1100px) {
  .bento-col-3 { grid-column: span 6; }
  .bento-col-4 { grid-column: span 6; }
}
@media (max-width: 1000px) {
  .grid-two, .grid-three { grid-template-columns: 1fr; }
  .bento-grid { grid-template-columns: repeat(6, 1fr); }
  .bento-col-3, .bento-col-4, .bento-col-5 { grid-column: span 3; }
  .bento-col-6, .bento-col-7, .bento-col-8, .bento-col-12 { grid-column: span 6; }
  .message { max-width: 90%; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
  .loading-spinner {
    animation-name: spin !important;
    animation-duration: 2.8s !important;
    animation-timing-function: linear !important;
    animation-iteration-count: infinite !important;
  }
}
