/* ==========================================================
   MUYTO FIDELIDADE - DESIGN SYSTEM
   Estrutura base para layout, componentes e formulários
   ========================================================== */

/* ===== RESET E BASE ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  font-family: 'Inter', 'Segoe UI', Roboto, sans-serif;
  background-color: #f8fafc; /* slate-50 */
  color: #1e293b; /* slate-800 */
  line-height: 1.6;
}

:root {
  --app-max-width: 1280px;
  --app-padding-x: clamp(1rem, 2.5vw, 1.5rem);
  --app-padding-y: clamp(1rem, 2vw, 1.75rem);
  --app-gap: clamp(1.25rem, 2vw, 1.75rem);
  --app-header-height: 4rem;
}

a {
  color: #0B63CE;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

button {
  cursor: pointer;
  transition: all 0.2s ease-in-out;
}

/* ===== LAYOUT PADRÃO ===== */
.page-shell {
  max-width: var(--app-max-width);
  margin: 0 auto;
  padding: var(--app-padding-y) var(--app-padding-x);
  display: flex;
  flex-direction: column;
  gap: var(--app-gap);
}

.page-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--app-gap);
  width: 100%;
  min-width: 0;
}

.page-sidebar {
  --sidebar-width: min(85vw, 20rem);
  width: var(--sidebar-width);
  position: fixed;
  top: var(--app-header-height);
  left: 0;
  height: calc(100vh - var(--app-header-height));
  padding: 0 var(--app-padding-x);
  transform: translateX(calc(var(--sidebar-width) * -1.05));
  transition: transform 0.3s ease;
  z-index: 50;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.page-sidebar.is-open {
  transform: translateX(0);
}

body.sidebar-open {
  overflow: hidden;
}

body.sidebar-open::after {
  content: '';
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.4);
  z-index: 40;
}

@media (min-width: 640px) {
  .page-shell {
    padding: var(--app-padding-y) calc(var(--app-padding-x) * 1.1);
  }
}

@media (min-width: 768px) {
  body.sidebar-open {
    overflow: auto;
  }

  body.sidebar-open::after {
    display: none;
  }

  .page-sidebar {
    --sidebar-width: 16rem;
    position: sticky;
    top: calc(var(--app-header-height) + 1rem);
    height: calc(100vh - (var(--app-header-height) + 1rem));
    padding: 0;
    transform: none;
  }
}

@media (min-width: 1024px) {
  .page-shell {
    flex-direction: row;
    align-items: flex-start;
  }
}

/* ===== SIDEBAR ===== */
.sidebar-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 1rem;
  padding: 0.75rem;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
  display: grid;
  gap: 0.5rem;
}

@media (min-width: 640px) {
  .sidebar-card {
    padding: 1rem;
  }
}

.sidebar-footer {
  font-size: 0.75rem;
  color: #94a3b8;
  padding-left: 0.25rem;
}

/* ===== CONTAINERS E LAYOUT ===== */
.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 1rem;
}

/* Sidebar links */
.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.8rem;
  color: #475569; /* slate-600 */
  border-radius: 0.5rem;
  transition: background 0.2s, color 0.2s;
  font-weight: 600;
}

.sidebar-link:hover {
  background-color: #f1f5f9; /* slate-100 */
  color: #0B63CE;
  text-decoration: none;
  font-weight: 700;
}

.sidebar-link.active {
  background-color: #e0ebff;
  color: #0B63CE;
  font-weight: 600;
}

.sidebar-link:focus-visible {
  outline: 2px solid #0B63CE;
  outline-offset: 2px;
}

/* ===== HEADER ===== */
.brand-link {
  text-decoration: none;
  color: inherit;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.brand-link:hover {
  text-decoration: none;
}

.brand-highlight {
  font-family: 'Roboto', 'Inter', 'Segoe UI', sans-serif;
  font-weight: 700;
  color: #0B63CE;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

/* ===== CARDS ===== */
.card {
  background: #ffffff;
  border: 1px solid #e2e8f0; /* slate-200 */
  border-radius: 1rem;
  padding: 1.5rem;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  transition: all 0.2s ease-in-out;
}

.card:hover {
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

/* ===== BOTÕES ===== */
.btn {
  display: inline-block;
  font-weight: 500;
  border-radius: 0.5rem;
  padding: 0.5rem 1rem;
  border: 1px solid transparent;
  transition: all 0.2s ease-in-out;
}

.btn-primary {
  background-color: #0B63CE;
  color: #fff;
}

.btn-primary:hover {
  background-color: #094fa4;
}

.btn-outline {
  background-color: #fff;
  color: #0B63CE;
  border-color: #0B63CE;
}

.btn-outline:hover {
  background-color: #0B63CE;
  color: #fff;
}

/* ===== BADGES / PILLS ===== */
.pill {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
}

.pill-success {
  background-color: #dcfce7;
  color: #15803d;
}

.pill-warning {
  background-color: #fef3c7;
  color: #b45309;
}

.pill-danger {
  background-color: #fee2e2;
  color: #b91c1c;
}

/* ===== FORMULÁRIOS PADRONIZADOS ===== */
input[type="text"],
input[type="number"],
input[type="email"],
input[type="password"],
input[type="date"],
select,
textarea {
  width: 100%;
  border: 1px solid #d1d5db; /* slate-300 */
  border-radius: 0.5rem;
  padding: 6px 8px; /* ~3px de espaço interno lateral */
  font-size: 0.875rem;
  color: #1f2937; /* slate-800 */
  background-color: #ffffff;
  transition: all 0.2s ease-in-out;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: #0B63CE;
  box-shadow: 0 0 0 2px rgba(11, 99, 206, 0.2);
}

input:disabled,
select:disabled,
textarea:disabled {
  background-color: #f3f4f6;
  color: #9ca3af;
  cursor: not-allowed;
}

::placeholder {
  color: #9ca3af;
}

label {
  display: block;
  font-size: 0.875rem;
  color: #374151;
  margin-bottom: 4px;
}

/* ===== INPUTS DENTRO DE CARDS ===== */
.card input,
.card select,
.card textarea {
  border-color: #e2e8f0;
}

.card input:focus,
.card select:focus,
.card textarea:focus {
  border-color: #0B63CE;
  box-shadow: 0 0 0 2px rgba(11, 99, 206, 0.15);
}

/* ===== TABELAS ===== */
table {
  width: 100%;
  border-collapse: collapse;
}

th, td {
  text-align: left;
  padding: 0.75rem;
  border-bottom: 1px solid #e2e8f0;
}

th {
  background-color: #f8fafc;
  color: #475569;
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.75rem;
}

th.active {
  color: #2563eb;
  font-weight: 700;
}

/* ===== TOOLTIP / HOVER DETALHES ===== */
.tooltip {
  position: relative;
}

.tooltip .tooltip-text {
  visibility: hidden;
  opacity: 0;
  background-color: #334155;
  color: #fff;
  text-align: center;
  border-radius: 0.375rem;
  padding: 0.25rem 0.5rem;
  position: absolute;
  z-index: 10;
  bottom: 125%;
  left: 50%;
  transform: translateX(-50%);
  transition: opacity 0.2s;
  font-size: 0.75rem;
}

.tooltip:hover .tooltip-text {
  visibility: visible;
  opacity: 1;
}

/* ===== MODAIS ===== */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(15, 23, 42, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.modal-content {
  background-color: #fff;
  border-radius: 1rem;
  padding: 1.5rem;
  width: 90%;
  max-width: 480px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

/* ===== RESPONSIVIDADE ===== */
@media (max-width: 768px) {
  .sidebar-link {
    font-size: 0.9rem;
  }

  .card {
    padding: 1rem;
  }

  th, td {
    padding: 0.5rem;
  }
}


/* ===== MENU DO USUÁRIO (HEADER) ===== */
.user-area {
  position: relative;
}

.user-area .fa-chevron-down {
  transition: transform 0.3s ease;
}

.user-area.open .fa-chevron-down {
  transform: rotate(180deg);
}

.user-area #userMenu {
  opacity: 0;
  transform: scale(0.95);
  pointer-events: none;
}

.user-area.open #userMenu {
  opacity: 1;
  transform: scale(1);
  pointer-events: auto;
}



/*==================================================================*/

/* --- ÁREA DE GRÁFICOS DO DASHBOARD --- */
.chart-area {
  position: relative;
  width: 100%;
  height: 360px; /* altura padrão dos gráficos principais */
  min-height: 300px;
  max-height: 400px;
}

.chart-area--sm {
  height: 260px; /* gráficos menores (ex: "Detalhes") */
}

@media (max-width: 1024px) {
  .chart-area {
    height: 320px;
  }
}

@media (max-width: 768px) {
  .chart-area {
    height: 260px;
  }

  .chart-area--sm {
    height: 220px;
  }
}

 /* ===== 🎥 Estilos do Cartão 3D Muyto ===== */
#scene {
  width: 100%;
  aspect-ratio: 16 / 9;
  min-height: 60vh;
  display: flex;
  justify-content: center;
  align-items: center;
  /* transform: scale(2.5); /* ✅ aumenta 520% */
  transform-origin: center center; /* centraliza o zoom */
}




