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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  padding-top: 65px;
}

.header {
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(10px);
  padding: 0 !important;
  height: 55px;
  display: flex;
  align-items: center;
}

.header .container {
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  height: 100%;
  display: flex;
  align-items: center;
}

.header .title {
  font-size: 1.1rem;
  font-weight: 600;
  color: #2d3748;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
  line-height: 1;
}

.header .project-badge {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 0.2rem 0.65rem;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.main-content {
  padding: 1rem 0;
  margin-top: 10px;
}

/* Tela de Projetos */
.project-card {
  background: white;
  border-radius: 16px;
  padding: 0;
  margin-bottom: 1.5rem;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

.project-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.project-card-body {
  padding: 2.5rem;
  text-align: center;
  min-height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.project-name {
  font-size: 1.5rem;
  font-weight: 600;
  color: #2d3748;
  margin: 0;
}

.project-footer {
  background: #f7fafc;
  padding: 1rem 1.5rem;
  display: flex;
  justify-content: space-around;
  border-top: 2px solid #e2e8f0;
}

.project-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.project-stat-label {
  font-size: 0.75rem;
  color: #718096;
  font-weight: 500;
  text-transform: uppercase;
  margin-bottom: 0.25rem;
}

.project-stat-value {
  font-size: 1.25rem;
  font-weight: 700;
}

.project-stat-value.total {
  color: #4299e1;
}

.project-stat-value.online {
  color: #48bb78;
}

.project-stat-value.offline {
  color: #f56565;
}

/* Tela de Servidores */
.server-card {
  background: white;
  border-radius: 12px;
  padding: 1rem;
  margin-bottom: 1rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  overflow: hidden;
}

.server-card:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

/* Linha 1: Nome e Código do Nó - DESIGN COM DESTAQUE */
.server-line-1 {
  display: grid;
  grid-template-columns: 2fr 1.2fr 1fr;
  gap: 0.75rem;
  padding: 1rem;
  min-height: 55px;
  background: #2c3e50 !important;
  border-radius: 8px;
  margin: -1rem -1rem 1rem -1rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25) !important;
  position: relative;
  overflow: hidden;
  border-left: 4px solid #e74c3c;
  align-items: center;
}

.server-line-1::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(231, 76, 60, 0.1) 0%, rgba(0, 0, 0, 0) 100%);
  pointer-events: none;
}

.server-name-section {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  position: relative;
  z-index: 1;
}

.server-name-section i {
  color: white !important;
  font-size: 1.2rem;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.server-name {
  font-size: 1.1rem;
  font-weight: 700;
  color: white;
  margin: 0;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  letter-spacing: -0.3px;
}

.uptime-section {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.75rem;
  background: rgba(255, 255, 255, 0.3);
  backdrop-filter: blur(10px);
  border-radius: 8px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  position: relative;
  z-index: 1;
}

.uptime-icon {
  color: white;
  font-size: 1rem;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.uptime-content {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.uptime-label {
  font-size: 0.6rem;
  color: white;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.uptime-value {
  font-size: 0.95rem;
  color: white;
  font-weight: 700;
  font-family: 'Courier New', monospace;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.node-code {
  background: rgba(255, 255, 255, 0.35);
  backdrop-filter: blur(10px);
  color: white;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  font-family: 'Courier New', monospace;
  font-size: 0.95rem;
  font-weight: 700;
  text-align: center;
  border: 2px solid rgba(255, 255, 255, 0.5);
  letter-spacing: 1.5px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 1;
}

/* Linha 2: IPs */
.server-line-2 {
  padding-bottom: 0.75rem;
  border-bottom: 1px solid #e2e8f0;
  margin-bottom: 0.75rem;
}

.section-header {
  font-size: 0.75rem;
  color: #718096;
  font-weight: 600;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
  user-select: none;
  transition: color 0.2s;
  padding: 0.4rem;
  border-radius: 6px;
}

.section-header:hover {
  background: #f7fafc;
  color: #667eea;
}

.section-header i {
  color: #667eea;
  transition: transform 0.3s;
  font-size: 0.85rem;
}

.section-header .toggle-icon {
  margin-left: auto;
  font-size: 0.8rem;
}

.section-content {
  overflow: hidden;
  transition: max-height 0.3s ease, opacity 0.3s ease;
}

.section-content.collapsed {
  max-height: 0 !important;
  opacity: 0;
}

.ip-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1.3fr;
  gap: 0.5rem;
}

.ip-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem;
  background: #f7fafc;
  border-radius: 6px;
}

.ip-icon {
  color: #4299e1;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.ip-content {
  display: flex;
  flex-direction: column;
  gap: 0.05rem;
  flex: 1;
  min-width: 0;
}

.ip-label {
  font-size: 0.65rem;
  color: #718096;
  font-weight: 600;
  text-transform: uppercase;
  line-height: 1;
}

.ip-value {
  font-family: 'Courier New', monospace;
  font-size: 0.8rem;
  color: #2d3748;
  font-weight: 600;
}

/* Linha 3: Métricas */
.server-line-3 {
  padding-bottom: 0.75rem;
  border-bottom: 1px solid #e2e8f0;
  margin-bottom: 0.75rem;
}

.metrics-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: 0.5rem;
}

.metric-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.65rem 0.85rem;
  background: #f7fafc;
  border-radius: 8px;
}

.metric-left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
}

.metric-icon {
  color: #4299e1;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.metric-content {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  flex: 1;
  min-width: 0;
}

.metric-label {
  font-size: 0.65rem;
  color: #718096;
  font-weight: 600;
  text-transform: uppercase;
  line-height: 1;
}

.metric-capacity {
  font-size: 0.85rem;
  color: #2d3748;
  font-weight: 600;
}

.metric-usage-circle {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 3px 10px rgba(102, 126, 234, 0.3);
}

.metric-value {
  font-size: 0.65rem;
  color: white;
  font-weight: 700;
}

/* Linha 4: Sensores */
.server-line-4 {
  padding-bottom: 0.75rem;
  border-bottom: 1px solid #e2e8f0;
  margin-bottom: 0.75rem;
}

.server-line-4 .sensors-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
}

.server-line-4 .sensor-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0.75rem;
  background: #f7fafc;
  border-radius: 6px;
  transition: background 0.2s;
  gap: 0.4rem;
}

.server-line-4 .sensor-item:hover {
  background: #edf2f7;
}

.server-line-4 .sensor-name {
  font-size: 0.75rem;
  color: #2d3748;
  font-weight: 500;
  flex: 1;
}

.server-line-4 .sensor-status {
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Linha 5: Serviços */
.server-line-5 {
  margin-top: 0.25rem;
}

.services-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.service-item {
  display: grid;
  grid-template-columns: 180px 1fr 50px;
  align-items: center;
  padding: 0.4rem 0.6rem;
  background: #f7fafc;
  border-radius: 6px;
  transition: background 0.2s;
}

.service-item:hover {
  background: #edf2f7;
}

.service-type {
  font-size: 0.8rem;
  color: #4a5568;
  font-weight: 500;
}

.service-version {
  font-family: 'Courier New', monospace;
  font-size: 0.75rem;
  color: #2d3748;
  font-weight: 500;
}

.service-status {
  display: flex;
  justify-content: center;
}

.status-indicator {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  animation: pulse 2s infinite;
}

.status-indicator.success {
  background: #48bb78;
  box-shadow: 0 0 8px rgba(72, 187, 120, 0.5);
}

.status-indicator.warning {
  background: #ecc94b;
  box-shadow: 0 0 8px rgba(236, 201, 75, 0.5);
}

.status-indicator.error {
  background: #f56565;
  box-shadow: 0 0 8px rgba(245, 101, 101, 0.5);
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

.btn-back {
  background: white;
  color: #667eea;
  border: 2px solid #667eea;
  font-weight: 600;
  transition: all 0.3s ease;
}

.btn-back:hover {
  background: #667eea;
  color: white;
  transform: translateX(-3px);
}

.btn-add {
  background: #48bb78;
  color: white;
  border: none;
  font-weight: 600;
  transition: all 0.3s ease;
}

.btn-add:hover {
  background: #38a169;
  transform: scale(1.05);
}

.hidden {
  display: none !important;
}

.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  color: white;
}

.empty-state i {
  font-size: 4rem;
  margin-bottom: 1rem;
  opacity: 0.7;
}

.empty-state h3 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

/* Responsividade para servidores */
@media (min-width: 1500px) {
  #serversContainer {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
  }
  
  #serversContainer > .col-12 {
    width: 100%;
    padding: 0;
  }
}

/* Modal styles */
.modal-content {
  border-radius: 16px;
  border: none;
}

.modal-header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-radius: 16px 16px 0 0;
}

.form-label {
  font-weight: 600;
  color: #2d3748;
}

.form-control:focus {
  border-color: #667eea;
  box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}