/* Thiago Pires - Eletricista | CSS COMPLETO FINAL (CONFIG + MOBILE PERFEITO) */
:root {
  --bg-main: #050816;
  --bg-card: #111827;
  --bg-card-inner: #1f2937;
  --accent-blue: #3b82f6;
  --accent-green: #22c55e;
  --accent-purple: #8b5cf6;
  --text-primary: #e5e7eb;
  --text-muted: #9ca3af;
  --border-subtle: #374151;
  --danger: #ef4444;
  --success: #22c55e;
  --shadow-soft: 0 20px 45px rgba(0, 0, 0, 0.55);
  --shadow-glow: 0 0 30px rgba(34, 197, 94, 0.3);
  --radius-lg: 18px;
  --radius-md: 12px;
  --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html, body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, sans-serif;
  color: var(--text-primary);
  line-height: 1.5;
  background: none;
}

/* FUNDO GRADIENTE */
body {
  background: 
    radial-gradient(circle at 20% 80%, rgba(120, 119, 198, 0.3) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(255, 119, 198, 0.3) 0%, transparent 50%),
    radial-gradient(circle at 40% 40%, rgba(120, 219, 255, 0.3) 0%, transparent 50%),
    linear-gradient(135deg, #0f172a 0%, #020617 70%, #000 100%);
  min-height: 100vh;
}

/* LAYOUTS */
.app-container, .center-wrapper, .layout {
  min-height: 100vh;
  display: flex;
}

.app-container, .center-wrapper { flex-direction: column; padding: 1rem; justify-content: center; align-items: center; }

/* CARDS */
.card {
  background: linear-gradient(145deg, var(--bg-card), rgba(17, 24, 39, 0.95));
  backdrop-filter: blur(20px);
  border: 1px solid rgba(55, 65, 81, 0.5);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  padding: 2rem;
  width: 100%;
  max-width: 420px;
  position: relative;
  overflow: hidden;
}

.cadastro-card { max-width: 500px; }

/* CADASTRO HEADER */
.cadastro-header {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 2rem 1rem;
  margin-bottom: 2rem;
  text-align: center;
}

.icon-bolt-large {
  width: 70px;
  height: 70px;
  margin: 0 auto 1.5rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #00ff88, #0099ff);
  box-shadow: 0 0 40px rgba(0, 255, 136, 0.4);
  font-size: 2rem;
  animation: boltPulse 2s infinite;
}

@keyframes boltPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

.titulo-cadastro {
  font-size: 2.2rem;
  font-weight: 700;
  background: linear-gradient(135deg, #ffffff, #e5e7eb);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 1.5rem;
}

.btn-voltar-home {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(15, 23, 42, 0.8);
  border: 1.5px solid rgba(55, 65, 81, 0.5);
  color: var(--text-primary);
  padding: 0.875rem 1.5rem;
  border-radius: var(--radius-md);
  text-decoration: none;
  font-weight: 600;
  transition: all var(--transition);
}

.btn-voltar-home:hover {
  background: rgba(59, 130, 246, 0.1);
  border-color: var(--accent-blue);
  transform: translateY(-2px);
}

/* FORMULÁRIOS */
.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

input, textarea, select {
  width: 100%;
  padding: 0.875rem 1rem;
  background: rgba(15, 23, 42, 0.8);
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.95rem;
  transition: all var(--transition);
}

input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
  background: rgba(15, 23, 42, 0.95);
}

/* BOTÕES */
.btn {
  border: none;
  border-radius: var(--radius-md);
  padding: 0.875rem 1.25rem;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: all var(--transition);
}

.btn.full { width: 100%; }
.btn-primary {
  background: linear-gradient(135deg, var(--accent-green), var(--accent-blue));
  color: #0f172a;
  box-shadow: 0 8px 25px rgba(34, 197, 94, 0.4);
}

.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 12px 35px rgba(34, 197, 94, 0.6); }

/* LOGIN NEON */
.login-container {
  width: 100%;
  max-width: 400px;
  margin: 0 auto;
  padding: 20px;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-card {
  background: #151520;
  border: 1px solid #2a2a35;
  border-radius: 16px;
  padding: 40px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(20px);
  max-width: 400px;
  transition: all 0.3s;
}

.login-card:hover { box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4), 0 0 40px rgba(0, 255, 136, 0.1); transform: translateY(-2px); }

.login-header { text-align: center; margin-bottom: 40px; }
.logo-icon {
  font-size: 2.5rem;
  margin-bottom: 16px;
  background: linear-gradient(135deg, #00ff88, #0099ff);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 20px rgba(0, 255, 136, 0.3));
  animation: pulse 2s ease-in-out infinite alternate;
}

.login-header h2 { color: #ffffff; font-size: 2rem; font-weight: 600; margin-bottom: 8px; }
.login-header p { color: #a0a0b0; font-size: 16px; }

.input-wrapper { position: relative; margin-bottom: 12px; }
.input-wrapper input {
  width: 100%;
  background: #1a1a25;
  border: 1px solid #2a2a35;
  border-radius: 6px;
  padding: 24px 16px;
  color: #ffffff;
  font-size: 16px;
  transition: all 0.3s;
  outline: none;
}

.input-wrapper input:focus {
  border-color: #00ff88;
  background: rgba(26, 26, 37, 0.8);
  box-shadow: 0 0 0 3px rgba(0, 255, 136, 0.1);
}

.input-wrapper label {
  position: absolute;
  left: 16px;
  top: 24px;
  color: #a0a0b0;
  font-size: 16px;
  transition: all 0.3s;
  pointer-events: none;
}

.input-wrapper input:focus + label, .input-wrapper input:valid + label {
  transform: translateY(-32px) scale(0.85);
  color: #00ff88;
}

.password-wrapper input { padding-right: 50px; }
.password-toggle {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  color: #a0a0b0;
  border-radius: 6px;
}

.password-toggle:hover { color: #00ff88; background: rgba(0, 255, 136, 0.1); }

.login-btn {
  width: 100%;
  background: linear-gradient(135deg, #00ff88, #0099ff);
  border: none;
  border-radius: 6px;
  padding: 20px 32px;
  color: #0a0a0f;
  font-size: 16px;
  font-weight: 600;
  margin: 4px 0 24px 0;
  text-transform: uppercase;
}

.login-btn:hover { transform: translateY(-1px); box-shadow: 0 10px 30px rgba(0, 255, 136, 0.3); }

.divider.neon-divider {
  text-align: center;
  margin: 32px 0 24px;
  position: relative;
}

.divider.neon-divider::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, #2a2a35, transparent);
  transform: translateY(-50%);
}

.signup-link { text-align: center; }
.signup-link p { color: #a0a0b0; font-size: 14px; }
.signup-link a { color: #00ff88; font-weight: 500; }
.signup-link a:hover { color: #0099ff; }

/* PAINEL */
.layout { flex-direction: row; min-height: 100vh; gap: 0; }
.sidebar {
  width: 260px;
  background: rgba(17, 24, 39, 0.95);
  backdrop-filter: blur(20px);
  border-right: 1px solid var(--border-subtle);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  height: 100vh;
}

.sidebar-header {
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-subtle);
}

.sidebar-header .brand {
  font-size: 1.4rem;
  background: linear-gradient(135deg, var(--accent-green), var(--accent-blue));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.sidebar-nav { display: flex; flex-direction: column; gap: 0.5rem; flex: 1; }

.nav-item {
  padding: 1rem;
  border: none;
  background: transparent;
  color: var(--text-muted);
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 500;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.nav-item:hover { background: rgba(55, 65, 81, 0.5); color: var(--text-primary); }
.nav-item.active { background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple)); color: #0f172a; }

.main { flex: 1; padding: 2rem; overflow-y: auto; }
.main-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-subtle);
}

.section { display: none; }
.section.visible { display: block; }

.grid-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}

.card-list-item {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  transition: all var(--transition);
}

.card-list-item:hover { border-color: var(--accent-blue); transform: translateY(-2px); }

.badge {
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-success { background: rgba(34, 197, 94, 0.2); color: var(--success); border: 1px solid rgba(34, 197, 94, 0.3); }
.badge-muted { background: rgba(156, 163, 175, 0.2); color: var(--text-muted); border: 1px solid rgba(156, 163, 175, 0.3); }

/* TABELAS + MOBILE */
.table-responsive { overflow-x: auto; }
.table, .table-mobile {
  width: 100%;
  border-collapse: collapse;
  background: rgba(15, 23, 42, 0.8);
  border-radius: var(--radius-md);
}

.table th, .table-mobile th {
  background: var(--bg-card-inner);
  padding: 1rem 0.75rem;
  text-align: left;
  font-weight: 600;
  color: var(--text-muted);
  font-size: 0.8rem;
  text-transform: uppercase;
}

.table td, .table-mobile td { padding: 1rem 0.75rem; border-bottom: 1px solid var(--border-subtle); }

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

/* CONFIGURAÇÕES */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.config-section {
  margin-bottom: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border-subtle);
}

.config-section:last-child { border-bottom: none; margin-bottom: 0; }

.config-section h3 {
  color: #ffffff;
  margin-bottom: 1rem;
  font-size: 1.2rem;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}

/* BOTÕES PEQUENOS */
.btn-small {
  padding: 0.4rem 0.8rem;
  font-size: 0.8rem;
  margin-right: 0.5rem;
  margin-bottom: 0.25rem;
}

.btn-blue { background: var(--accent-blue); color: white; }
.btn-danger { background: var(--danger); color: white; }

/* MODALS */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(10px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal.active { display: flex; }

.modal-content {
  background: #151520;
  border: 1px solid #2a2a35;
  border-radius: 16px;
  max-width: 500px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem;
  border-bottom: 1px solid #2a2a35;
}

.modal-header h3 { margin: 0; color: #ffffff; font-size: 1.3rem; font-weight: 600; }

.modal-close {
  background: none;
  border: none;
  font-size: 2rem;
  color: #a0a0b0;
  cursor: pointer;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}

.modal-close:hover {
  color: #00ff88;
  background: rgba(0, 255, 136, 0.1);
  transform: rotate(90deg);
}

.modal-content .form-group { padding: 0 1.5rem 1rem 1.5rem; }
.modal-content .form-actions {
  display: flex;
  gap: 1rem;
  padding: 1.5rem;
  border-top: 1px solid #2a2a35;
  justify-content: flex-end;
  background: rgba(26, 26, 37, 0.5);
}

.mt-2 { margin-top: 1rem; }

/* ANIMAÇÕES */
@keyframes pulse {
  from { filter: drop-shadow(0 0 20px rgba(0, 255, 136, 0.3)); }
  to { filter: drop-shadow(0 0 30px rgba(0, 255, 136, 0.6)); }
}

/* RESPONSIVO - MOBILE PERFEITO */
@media (max-width: 1024px) {
  .layout { flex-direction: column; }
  .sidebar {
    width: 100%;
    height: auto;
    flex-direction: row;
    overflow-x: auto;
    padding: 1rem;
  }
  .sidebar-nav { flex-direction: row; gap: 0.5rem; }
  .nav-item { flex: 1; white-space: nowrap; text-align: center; padding: 0.75rem; }
}

@media (max-width: 768px) {
  .card, .login-card { padding: 1.5rem; margin: 0.5rem; }
  .main { padding: 1rem; }
  .grid-cards { grid-template-columns: 1fr; gap: 1rem; }
  
  /* TABELA MOBILE SEM SCROLL */
  .table-mobile {
    font-size: 0.85rem;
    border: 1px solid var(--border-subtle);
  }
  
  .table-mobile thead { display: none; }
  .table-mobile tr {
    display: block;
    margin-bottom: 1rem;
    padding: 1rem;
    background: rgba(26, 26, 37, 0.5);
    border-radius: 12px;
    border: 1px solid #2a2a35;
  }
  
  .table-mobile td {
    display: block;
    padding: 0.75rem 0;
    border: none;
    position: relative;
    padding-left: 50%;
  }
  
  .table-mobile td::before {
    content: attr(data-label) ": ";
    position: absolute;
    left: 0;
    width: 45%;
    padding-right: 1rem;
    white-space: nowrap;
    font-weight: 600;
    color: var(--text-muted);
  }
  
  /* CONFIG MOBILE */
  .form-grid { grid-template-columns: 1fr; }
  .config-section {
    padding: 1.5rem;
    margin: 1.5rem 0;
    background: rgba(26, 26, 37, 0.3);
    border-radius: 12px;
    border: 1px solid #2a2a35;
  }
  
  /* MODALS MOBILE */
  .modal { padding: 0.5rem; }
  .modal-content {
    margin: 0.5rem;
    width: calc(100% - 1rem);
    max-height: 95vh;
  }
  .modal-header { padding: 1rem; }
  .modal-content .form-group { padding: 0 1rem 0.75rem; }
  .modal-content .form-actions { flex-direction: column; gap: 0.75rem; }
  
  .section-header { flex-direction: column; gap: 1rem; align-items: stretch; text-align: center; }
}

@media (max-width: 480px) {
  .titulo-cadastro { font-size: 1.6rem; }
  .login-card { padding: 1.25rem; }
}
