/* ============================================================
   RAMNET DESEMPENHO — main.css
   Tema claro, identidade visual ramnet.com.br
   Cores: #00a8d4 cyan · #003d5c azul escuro · #fdd835 amarelo
   Fontes: Exo 2 (títulos/UI) · Inter (corpo)
   ============================================================ */

/* ── GOOGLE FONTS ─────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Exo+2:wght@400;500;600;700;800;900&family=Inter:wght@300;400;500;600;700&display=swap');

/* ── VARIÁVEIS CSS ────────────────────────────────────────── */
:root {
  /* Paleta principal — identidade Ramnet */
  --cyan:           #00a8d4;
  --cyan-h:         #0097be;
  --cyan-lt:        #e0f6fc;
  --cyan-dim:       rgba(0, 168, 212, 0.12);
  --cyan-border:    rgba(0, 168, 212, 0.25);
  --cyan-glow:      rgba(0, 168, 212, 0.2);

  --dark:           #003d5c;
  --dark-h:         #002e45;
  --navy:           #001e2e;
  --navy2:          #000e18;

  --yellow:         #fdd835;
  --yellow-h:       #f9cf00;
  --yellow-dim:     rgba(253, 216, 53, 0.18);

  /* Fundos */
  --bg-deep:        #f4f7fa;
  --bg-card:        #ffffff;
  --bg-hover:       #e8eef5;
  --bg-input:       #ffffff;
  --bg-sidebar:     #003d5c;

  /* Texto */
  --text-primary:   #0f1923;
  --text-secondary: #374151;
  --text-muted:     #6b7280;
  --text-disabled:  #9ca3af;
  --text-on-dark:   #ffffff;
  --text-on-dark-sub: rgba(255, 255, 255, 0.75);

  /* Bordas */
  --border:         1px solid #dde3ea;
  --border-subtle:  1px solid #eef1f5;
  --border-focus:   1px solid var(--cyan);

  /* Raios */
  --radius-sm:      6px;
  --radius-md:      10px;
  --radius-lg:      16px;
  --radius-xl:      24px;
  --radius-full:    9999px;

  /* Sombras */
  --shadow-card:    0 2px 12px rgba(0, 0, 0, 0.07);
  --shadow-md:      0 8px 32px rgba(0, 0, 0, 0.10);
  --shadow-cyan:    0 4px 20px rgba(0, 168, 212, 0.18);
  --shadow-yellow:  0 4px 20px rgba(253, 216, 53, 0.25);

  /* Status */
  --green:          #22c55e;
  --green-dim:      rgba(34, 197, 94, 0.12);
  --red:            #ef4444;
  --red-dim:        rgba(239, 68, 68, 0.12);
  --orange:         #f97316;

  /* Tipografia */
  --font-title:     'Exo 2', sans-serif;
  --font-body:      'Inter', sans-serif;

  /* Transições */
  --transition:     200ms ease;
  --transition-md:  300ms ease;

  /* Layout */
  --sidebar-w:      240px;
  --header-h:       64px;
  --content-max:    1400px;

  /* Legado (usados em partiu.js inline) */
  --silver:         #8b9bb4;
  --bronze:         #CD7F32;
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-primary);
  background-color: var(--bg-deep);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img, svg, video, canvas {
  display: block;
  max-width: 100%;
}

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
}

a {
  color: var(--cyan);
  text-decoration: none;
}

ul, ol {
  list-style: none;
}

/* ── SCROLLBAR CUSTOMIZADA ────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-deep); }
::-webkit-scrollbar-thumb { background: #c8d5e0; border-radius: var(--radius-full); }
::-webkit-scrollbar-thumb:hover { background: var(--cyan); }

/* ── TIPOGRAFIA ───────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-title);
  font-weight: 700;
  line-height: 1.2;
  color: var(--text-primary);
}

h1 { font-size: clamp(1.6rem, 3vw, 2.25rem); }
h2 { font-size: clamp(1.2rem, 2.5vw, 1.6rem); }
h3 { font-size: clamp(1rem, 2vw, 1.25rem); }
h4 { font-size: 1rem; }

.text-sm   { font-size: 12px; }
.text-base { font-size: 14px; }
.text-lg   { font-size: 16px; }
.text-xl   { font-size: 18px; }

.text-secondary { color: var(--text-secondary); }
.text-muted     { color: var(--text-muted); }
.text-cyan      { color: var(--cyan); }
.text-yellow    { color: var(--yellow-h); }
.text-green     { color: var(--green); }
.text-red       { color: var(--red); }
.text-dark      { color: var(--dark); }

.font-title  { font-family: var(--font-title); }
.font-body   { font-family: var(--font-body); }
.font-bold   { font-weight: 700; }
.font-medium { font-weight: 500; }

/* ── LAYOUT UTILITÁRIOS ───────────────────────────────────── */
.container {
  width: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 16px;
}

.flex        { display: flex; }
.flex-col    { display: flex; flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center  { justify-content: center; }
.gap-4  { gap: 4px; }
.gap-8  { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.gap-24 { gap: 24px; }

/* ── COMPONENTES GLOBAIS ──────────────────────────────────── */

/* Card base */
.card {
  background: var(--bg-card);
  border: var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-card);
  transition: border-color var(--transition), box-shadow var(--transition),
              transform var(--transition);
}
.card:hover {
  border-color: var(--cyan-border);
  box-shadow: var(--shadow-cyan);
  transform: translateY(-2px);
}

/* Botões */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.3px;
  min-height: 44px;
  border: none;
  transition: background var(--transition), color var(--transition),
              transform var(--transition), box-shadow var(--transition);
  white-space: nowrap;
}
.btn:active { transform: scale(0.97); }
.btn:hover  { transform: translateY(-1px); }

.btn-primary {
  background: var(--dark);
  color: #fff;
}
.btn-primary:hover {
  background: var(--dark-h);
  box-shadow: 0 6px 20px rgba(0, 61, 92, 0.3);
}

.btn-cyan {
  background: var(--cyan);
  color: #fff;
}
.btn-cyan:hover {
  background: var(--cyan-h);
  box-shadow: var(--shadow-cyan);
}

.btn-secondary {
  background: var(--bg-hover);
  color: var(--text-primary);
  border: var(--border);
}
.btn-secondary:hover {
  background: var(--cyan-lt);
  border-color: var(--cyan);
  color: var(--cyan);
}

.btn-danger {
  background: var(--red-dim);
  color: var(--red);
  border: 1px solid rgba(239, 68, 68, 0.3);
}
.btn-danger:hover {
  background: rgba(239, 68, 68, 0.2);
}

.btn-sm { padding: 6px 14px; min-height: 36px; font-size: 12px; }
.btn-lg { padding: 14px 28px; min-height: 52px; font-size: 15px; }

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}
.badge-cyan   { background: var(--cyan-dim);  color: var(--dark);  border: 1px solid var(--cyan-border); }
.badge-yellow { background: var(--yellow-dim); color: #7a5500; border: 1px solid rgba(253,216,53,0.4); }
.badge-green  { background: var(--green-dim);  color: #166534;  border: 1px solid rgba(34,197,94,0.3); }
.badge-red    { background: var(--red-dim);    color: #991b1b;  border: 1px solid rgba(239,68,68,0.3); }

/* Barra de progresso */
.progress-bar {
  width: 100%;
  height: 6px;
  background: #dde3ea;
  border-radius: var(--radius-full);
  overflow: hidden;
}
.progress-bar__fill {
  height: 100%;
  border-radius: var(--radius-full);
  background: var(--cyan);
  transition: width 600ms cubic-bezier(0.4, 0, 0.2, 1);
}
.progress-bar__fill--yellow { background: var(--yellow-h); }
.progress-bar__fill--red    { background: var(--red); }
.progress-bar__fill--green  { background: var(--green); }
.progress-bar__fill--dark   { background: var(--dark); }

/* Inputs */
.input, .select {
  width: 100%;
  background: var(--bg-input);
  border: 2px solid #dde3ea;
  border-radius: var(--radius-md);
  color: var(--text-primary);
  padding: 10px 14px;
  min-height: 44px;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
  appearance: none;
}
.input:focus, .select:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px var(--cyan-dim);
}
.input::placeholder { color: var(--text-disabled); }

.select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%236b7280' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
  cursor: pointer;
}
.select option { background: #fff; color: var(--text-primary); }

/* Hint de formulário */
.form-hint {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
  line-height: 1.5;
}

/* Divisor */
.divider {
  width: 100%;
  height: 1px;
  background: #dde3ea;
  margin: 16px 0;
}

/* Scroll reveal */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 600ms ease-out, transform 600ms ease-out;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Tabela responsiva */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  white-space: nowrap;
}
.table th {
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--dark);
  padding: 10px 14px;
  border-bottom: 2px solid #dde3ea;
  text-align: left;
  background: #f8fafc;
}
.table td {
  padding: 12px 14px;
  border-bottom: var(--border-subtle);
  color: var(--text-secondary);
}
.table tbody tr:hover { background: var(--bg-hover); }
.table tbody tr:last-child td { border-bottom: none; }

/* Tooltip */
.tooltip {
  position: fixed;
  background: var(--dark);
  border: none;
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  font-size: 12px;
  color: #fff;
  pointer-events: none;
  z-index: 999;
  white-space: nowrap;
  box-shadow: var(--shadow-md);
  opacity: 0;
  transition: opacity var(--transition);
}
.tooltip.show { opacity: 1; }

/* Modal overlay */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(4px);
  z-index: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-md);
}
.modal-overlay.open {
  opacity: 1;
  pointer-events: all;
}
.modal {
  background: var(--bg-card);
  border: var(--border);
  border-radius: var(--radius-xl);
  padding: 28px;
  width: 90%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  transform: translateY(16px);
  transition: transform var(--transition-md);
  box-shadow: var(--shadow-md);
}
.modal-overlay.open .modal { transform: translateY(0); }

/* Estado vazio */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 48px 24px;
  color: var(--text-muted);
  font-size: 14px;
  text-align: center;
}
.empty-state__icon { font-size: 36px; opacity: 0.5; }

/* Spinner de loading */
.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--cyan-lt);
  border-top-color: var(--cyan);
  border-radius: 50%;
  animation: spin 700ms linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── ACESSIBILIDADE ───────────────────────────────────────── */
:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ── UTILITÁRIOS DE DISPLAY ───────────────────────────────── */
.hidden      { display: none !important; }
.visible     { visibility: visible; }
.invisible   { visibility: hidden; }
.opacity-0   { opacity: 0; }
.opacity-50  { opacity: 0.5; }
.opacity-100 { opacity: 1; }

/* ── RESPONSIVIDADE BASE ──────────────────────────────────── */
@media (min-width: 480px) {
  .container { padding: 0 20px; }
}
@media (min-width: 768px) {
  .container { padding: 0 28px; }
}
@media (min-width: 1024px) {
  .container { padding: 0 40px; }
}
