/* ============================================
   PAINEL LUMINAR - Tema Preto + Azul Ciano
   ============================================ */

:root {
  /* Cores principais */
  --bg-deep: #03060d;
  --bg-base: #060a14;
  --bg-card: #0b1322;
  --bg-card-hover: #0f1a2e;
  --bg-elevated: #111d33;
  --border-subtle: rgba(56, 132, 255, 0.12);
  --border-strong: rgba(56, 132, 255, 0.28);

  /* Azuis */
  --blue-50: #e6f3ff;
  --blue-100: #b3dbff;
  --blue-300: #5cb1ff;
  --blue-400: #2e95ff;
  --blue-500: #0a7aff;
  --blue-600: #0061e6;
  --cyan-400: #22d3ee;
  --cyan-500: #06b6d4;

  /* Status */
  --green: #10d981;
  --green-bg: rgba(16, 217, 129, 0.15);
  --red: #ef4444;
  --red-bg: rgba(239, 68, 68, 0.12);
  --orange: #fb923c;
  --orange-bg: rgba(251, 146, 60, 0.15);

  /* Texto */
  --text-primary: #f3f6fb;
  --text-secondary: #a4b1c6;
  --text-muted: #6b7a93;
  --text-disabled: #4a5568;

  /* Gradientes */
  --gradient-primary: linear-gradient(135deg, #0a7aff 0%, #22d3ee 100%);
  --gradient-hover: linear-gradient(135deg, #0061e6 0%, #06b6d4 100%);
  --gradient-glow: radial-gradient(circle at 50% 0%, rgba(10, 122, 255, 0.18), transparent 70%);
  --gradient-card: linear-gradient(145deg, rgba(11, 19, 34, 0.95) 0%, rgba(15, 26, 46, 0.85) 100%);

  /* Sombras / glow */
  --shadow-blue: 0 0 40px rgba(10, 122, 255, 0.25);
  --shadow-blue-soft: 0 4px 24px rgba(10, 122, 255, 0.18);
  --shadow-card: 0 8px 32px rgba(0, 0, 0, 0.45);

  /* Sizing */
  --sidebar-width: 260px;
  --header-height: 70px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 22px;

  /* Tipografia */
  --font-sans: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', 'Consolas', monospace;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
  font-family: var(--font-sans);
  background: var(--bg-deep);
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  background:
    radial-gradient(ellipse at top, rgba(10, 122, 255, 0.08) 0%, transparent 50%),
    radial-gradient(ellipse at bottom right, rgba(34, 211, 238, 0.06) 0%, transparent 50%),
    var(--bg-deep);
  min-height: 100vh;
}

a {
  color: var(--blue-300);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--cyan-400);
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

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

/* Scrollbar */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-track {
  background: var(--bg-base);
}
::-webkit-scrollbar-thumb {
  background: rgba(56, 132, 255, 0.25);
  border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(56, 132, 255, 0.45);
}

/* ============================================
   LAYOUT
   ============================================ */

.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
  min-height: 100vh;
}

.main-content {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.page-body {
  padding: 32px 40px;
  flex: 1;
}

/* ============================================
   SIDEBAR
   ============================================ */

.sidebar {
  background: linear-gradient(180deg, #060c1a 0%, #03060d 100%);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  padding: 24px 16px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px 24px;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 20px;
}

.brand-logo {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: var(--gradient-primary);
  display: grid;
  place-items: center;
  box-shadow: var(--shadow-blue-soft);
  flex-shrink: 0;
}

.brand-logo svg {
  width: 24px;
  height: 24px;
  color: white;
}

.brand-info {
  min-width: 0;
}

.brand-name {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--text-primary);
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.brand-email {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s ease;
  cursor: pointer;
  border: 1px solid transparent;
}

.nav-item:hover {
  background: rgba(10, 122, 255, 0.08);
  color: var(--text-primary);
  transform: translateX(2px);
}

.nav-item.active {
  background: linear-gradient(90deg, rgba(10, 122, 255, 0.22), rgba(34, 211, 238, 0.08));
  color: var(--blue-300);
  border-color: var(--border-strong);
  box-shadow: inset 0 0 0 1px rgba(56, 132, 255, 0.1), var(--shadow-blue-soft);
}

.nav-item.active::before {
  content: '';
  width: 3px;
  height: 22px;
  background: var(--gradient-primary);
  border-radius: 2px;
  position: absolute;
  margin-left: -14px;
}

.nav-item svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.nav-divider {
  margin: 16px 0;
  border-top: 1px solid var(--border-subtle);
}

/* ============================================
   TOP BAR
   ============================================ */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 40px;
  background: rgba(6, 10, 20, 0.6);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-subtle);
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.token-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: linear-gradient(135deg, rgba(10, 122, 255, 0.15), rgba(34, 211, 238, 0.08));
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  color: var(--blue-300);
  font-weight: 600;
  font-size: 13px;
  transition: all 0.2s ease;
}

.token-pill:hover {
  background: linear-gradient(135deg, rgba(10, 122, 255, 0.25), rgba(34, 211, 238, 0.15));
  transform: translateY(-1px);
}

.token-pill svg {
  width: 16px;
  height: 16px;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.icon-button {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  position: relative;
  transition: all 0.2s ease;
}

.icon-button:hover {
  background: var(--bg-card-hover);
  color: var(--blue-300);
  border-color: var(--border-strong);
}

.icon-button svg {
  width: 18px;
  height: 18px;
}

.icon-button .badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  background: var(--gradient-primary);
  color: white;
  font-size: 11px;
  font-weight: 700;
  border-radius: 999px;
  display: grid;
  place-items: center;
}

/* ============================================
   CARDS GENÉRICOS
   ============================================ */

.card {
  background: var(--gradient-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: all 0.25s ease;
}

.card:hover {
  border-color: var(--border-strong);
  background: linear-gradient(145deg, rgba(15, 26, 46, 0.95), rgba(17, 29, 51, 0.85));
}

.card-glow {
  position: relative;
  overflow: hidden;
}

.card-glow::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(56, 132, 255, 0.5), transparent);
}

/* ============================================
   BOTÕES
   ============================================ */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 14px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn svg {
  width: 18px;
  height: 18px;
}

.btn-primary {
  background: var(--gradient-primary);
  color: white;
  box-shadow: var(--shadow-blue-soft);
}

.btn-primary:hover {
  background: var(--gradient-hover);
  box-shadow: 0 8px 32px rgba(10, 122, 255, 0.35);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--text-primary);
  border-color: var(--border-strong);
}

.btn-secondary:hover {
  background: var(--bg-card-hover);
  border-color: var(--blue-400);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
}

.btn-ghost:hover {
  background: rgba(10, 122, 255, 0.08);
  color: var(--blue-300);
}

.btn-danger {
  background: var(--red-bg);
  color: var(--red);
  border-color: rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
  background: rgba(239, 68, 68, 0.2);
}

.btn-sm {
  padding: 8px 14px;
  font-size: 13px;
}

.btn-block {
  width: 100%;
  justify-content: center;
}

/* ============================================
   INPUTS / FORMULÁRIOS
   ============================================ */

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
}

.input {
  width: 100%;
  background: var(--bg-base);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  font-size: 14px;
  color: var(--text-primary);
  transition: all 0.2s ease;
}

.input::placeholder {
  color: var(--text-muted);
}

.input:focus {
  outline: none;
  border-color: var(--blue-400);
  box-shadow: 0 0 0 3px rgba(10, 122, 255, 0.15);
  background: var(--bg-card);
}

.input-with-icon {
  position: relative;
}

.input-with-icon .input {
  padding-left: 44px;
}

.input-with-icon svg {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--text-muted);
  pointer-events: none;
}

/* ============================================
   BADGES / STATUS
   ============================================ */

.badge-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}

.badge-status.active {
  background: var(--green-bg);
  color: var(--green);
}

.badge-status.pending {
  background: var(--orange-bg);
  color: var(--orange);
}

.badge-status.inactive {
  background: rgba(107, 122, 147, 0.15);
  color: var(--text-muted);
}

.badge-status::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 8px currentColor;
}

.tag-new {
  display: inline-block;
  padding: 3px 10px;
  background: var(--green-bg);
  color: var(--green);
  font-size: 11px;
  font-weight: 700;
  border-radius: 6px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

/* ============================================
   PAGE HEADERS
   ============================================ */

.page-title {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 6px;
  background: linear-gradient(135deg, #f3f6fb 0%, #8cb8ff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.page-subtitle {
  color: var(--text-secondary);
  font-size: 15px;
}

/* ============================================
   BANNER PROMOCIONAL
   ============================================ */

.promo-banner {
  background: linear-gradient(135deg, rgba(10, 122, 255, 0.12), rgba(34, 211, 238, 0.08));
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 18px 24px;
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 28px;
  position: relative;
  overflow: hidden;
}

.promo-banner::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--gradient-glow);
  pointer-events: none;
}

.promo-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--gradient-primary);
  display: grid;
  place-items: center;
  box-shadow: 0 0 24px rgba(10, 122, 255, 0.4);
  flex-shrink: 0;
}

.promo-icon svg {
  width: 22px;
  height: 22px;
  color: white;
}

.promo-content {
  flex: 1;
  min-width: 0;
}

.promo-title {
  font-weight: 600;
  font-size: 15px;
  margin-bottom: 2px;
}

.promo-text {
  color: var(--text-secondary);
  font-size: 13px;
}

.promo-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--cyan-400);
  font-weight: 600;
  font-size: 14px;
  padding: 8px 16px;
  border-radius: var(--radius-md);
  transition: all 0.2s ease;
  white-space: nowrap;
}

.promo-cta:hover {
  background: rgba(34, 211, 238, 0.1);
  transform: translateX(2px);
}

.promo-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--text-muted);
  transition: all 0.2s ease;
}

.promo-close:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
}

/* ============================================
   TABELAS
   ============================================ */

.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.data-table thead th {
  text-align: left;
  padding: 14px 18px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--blue-300);
  text-transform: uppercase;
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(10, 122, 255, 0.04);
}

.data-table tbody td {
  padding: 16px 18px;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 14px;
  color: var(--text-primary);
  transition: background 0.2s ease;
}

.data-table tbody tr {
  transition: background 0.2s ease;
}

.data-table tbody tr:hover {
  background: rgba(10, 122, 255, 0.05);
}

.data-table tbody tr:last-child td {
  border-bottom: none;
}

.row-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.row-action {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  display: grid;
  place-items: center;
  color: var(--text-muted);
  transition: all 0.2s ease;
}

.row-action:hover {
  background: rgba(10, 122, 255, 0.12);
  color: var(--blue-300);
}

.row-action.danger:hover {
  background: var(--red-bg);
  color: var(--red);
}

.row-action svg {
  width: 16px;
  height: 16px;
}

/* ============================================
   STEPPER (Wizard)
   ============================================ */

.stepper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 0 40px;
  position: relative;
}

.stepper::before {
  content: '';
  position: absolute;
  top: 36px;
  left: 8%;
  right: 8%;
  height: 2px;
  background: var(--border-subtle);
  z-index: 0;
}

.step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  position: relative;
  z-index: 1;
}

.step-circle {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 2px solid var(--border-subtle);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 15px;
  color: var(--text-muted);
  transition: all 0.3s ease;
}

.step.completed .step-circle {
  background: var(--gradient-primary);
  border-color: transparent;
  color: white;
  box-shadow: var(--shadow-blue-soft);
}

.step.active .step-circle {
  background: var(--gradient-primary);
  border-color: transparent;
  color: white;
  box-shadow: 0 0 0 6px rgba(10, 122, 255, 0.15), var(--shadow-blue);
}

.step-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  white-space: nowrap;
}

.step.active .step-label,
.step.completed .step-label {
  color: var(--text-primary);
}

/* ============================================
   GLASS / FLOATING CHAT BUTTON
   ============================================ */

.fab-chat {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--gradient-primary);
  display: grid;
  place-items: center;
  box-shadow: 0 8px 32px rgba(10, 122, 255, 0.45);
  z-index: 100;
  transition: all 0.25s ease;
  animation: pulse-glow 2.4s ease-in-out infinite;
}

.fab-chat:hover {
  transform: scale(1.08) translateY(-2px);
  box-shadow: 0 12px 40px rgba(10, 122, 255, 0.6);
}

.fab-chat svg {
  width: 24px;
  height: 24px;
  color: white;
}

@keyframes pulse-glow {
  0%, 100% {
    box-shadow: 0 8px 32px rgba(10, 122, 255, 0.45);
  }
  50% {
    box-shadow: 0 8px 32px rgba(10, 122, 255, 0.45), 0 0 0 12px rgba(10, 122, 255, 0);
  }
}

/* ============================================
   UTILS
   ============================================ */

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

.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.mt-8 { margin-top: 32px; }
.mb-2 { margin-bottom: 8px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.mb-8 { margin-bottom: 32px; }

.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.text-blue { color: var(--blue-300); }
.text-cyan { color: var(--cyan-400); }
.text-success { color: var(--green); }
.text-danger { color: var(--red); }

.hidden { display: none !important; }

/* ============================================
   ANIMATIONS
   ============================================ */

@keyframes fade-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.fade-in {
  animation: fade-in 0.4s ease forwards;
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.shimmer-text {
  background: linear-gradient(90deg, var(--text-primary) 0%, var(--cyan-400) 50%, var(--text-primary) 100%);
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: shimmer 3s linear infinite;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 1024px) {
  :root {
    --sidebar-width: 80px;
  }

  .brand-info,
  .nav-item span {
    display: none;
  }

  .nav-item {
    justify-content: center;
  }

  .page-body {
    padding: 24px;
  }
}

@media (max-width: 640px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    display: none;
  }

  .page-body {
    padding: 16px;
  }
}
