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

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: #f0f2f5;
  color: #333;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

/* Login/Auth Styles */
.auth-container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  background: linear-gradient(135deg, #25d366, #128c7e);
}

.auth-card {
  background: white;
  padding: 40px;
  border-radius: 15px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.2);
  width: 100%;
  max-width: 400px;
}

.auth-header {
  text-align: center;
  margin-bottom: 30px;
}

.auth-header h1 {
  color: #25d366;
  margin-bottom: 10px;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 5px;
  font-weight: 500;
}

.form-group input, .form-group select, .form-group textarea {
  width: 100%;
  padding: 12px;
  border: 2px solid #e1e5e9;
  border-radius: 8px;
  font-size: 16px;
  transition: border-color 0.3s;
}

.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  outline: none;
  border-color: #25d366;
}

.btn {
  background: #25d366;
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 16px;
  font-weight: 500;
  transition: all 0.3s;
  width: 100%;
}

.btn:hover {
  background: #20b358;
  transform: translateY(-1px);
}

.btn:disabled {
  background: #ccc;
  cursor: not-allowed;
  transform: none;
}

.btn-secondary {
  background: #6c757d;
}

.btn-secondary:hover {
  background: #5a6268;
}

.btn-danger {
  background: #dc3545;
}

.btn-danger:hover {
  background: #c82333;
}

.btn-small {
  padding: 8px 16px;
  font-size: 14px;
  width: auto;
}

/* Dashboard Styles */
.dashboard {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 20px;
  height: 100vh;
}

.sidebar {
  background: white;
  border-radius: 10px;
  padding: 20px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  overflow-y: auto;
}

.main-content {
  background: white;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  display: flex;
  flex-direction: column;
}

.header {
  background: #25d366;
  color: white;
  padding: 20px;
  border-radius: 10px 10px 0 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Estatísticas */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
  gap: 10px;
  margin-bottom: 15px;
}

.stat-item {
  background: #f8f9fa;
  padding: 12px 8px;
  border-radius: 8px;
  text-align: center;
  border-left: 4px solid #25d366;
}

.stat-item strong {
  display: block;
  font-size: 20px;
  color: #25d366;
}

.stat-item small {
  color: #666;
  font-size: 11px;
}

.employee-stat {
  background: #f8f9fa;
  padding: 8px;
  border-radius: 5px;
  margin-bottom: 5px;
}

/* Sidebar Sections */
.sidebar-section {
  margin-bottom: 25px;
}

.sidebar-section h3 {
  color: #25d366;
  margin-bottom: 15px;
  font-size: 18px;
}

.session-list, .attendance-list {
  list-style: none;
}

.session-item, .attendance-item {
  padding: 12px;
  background: #f8f9fa;
  border-radius: 8px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: all 0.3s;
  border-left: 4px solid transparent;
  position: relative;
}

.session-item:hover, .attendance-item:hover {
  background: #e9ecef;
  transform: translateX(5px);
}

.session-item.connected {
  border-left-color: #28a745;
}

.session-item.disconnected {
  border-left-color: #dc3545;
}

.attendance-item.selected {
  background: #25d366;
  color: white;
}

.attendance-item.unread {
  border-left-color: #ff6b35;
  background: #fff3f0;
}

.attendance-item.unread.selected {
  background: #25d366;
}

.attendance-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 5px;
}

.unread-indicator {
  color: #ff6b35;
  font-size: 20px;
  margin-left: auto;
}

.status-badge {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: bold;
  margin-left: 8px;
}

.type-badge {
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 10px;
  font-weight: bold;
}

.type-badge.group {
  background: #e3f2fd;
  color: #1976d2;
}

.type-badge.private {
  background: #f3e5f5;
  color: #7b1fa2;
}

/* Chat Area */
.chat-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 20px;
}

.chat-header {
  background: #f8f9fa;
  padding: 15px;
  border-radius: 8px;
  margin-bottom: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.chat-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.messages-area {
  flex: 1;
  border: 1px solid #e1e5e9;
  border-radius: 8px;
  padding: 15px;
  overflow-y: auto;
  background: #f8f9fa;
  margin-bottom: 20px;
  max-height: 400px;
}

.message {
  margin: 10px 0;
  padding: 12px;
  border-radius: 12px;
  max-width: 80%;
  word-wrap: break-word;
  position: relative;
}

.message.sent {
  background: #dcf8c6;
  margin-left: auto;
  border-bottom-right-radius: 4px;
}

.message.received {
  background: white;
  border-bottom-left-radius: 4px;
}

.message-sender {
  font-size: 12px;
  color: #25d366;
  font-weight: bold;
  margin-bottom: 5px;
}

.message-info {
  font-size: 12px;
  color: #666;
  margin-top: 5px;
}

.message img {
  max-width: 100%;
  max-height: 200px;
  border-radius: 8px;
  cursor: pointer;
}

.btn-pv {
  background: #007bff;
  color: white;
  border: none;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 11px;
  cursor: pointer;
  margin-top: 5px;
  transition: background 0.3s;
}

.btn-pv:hover {
  background: #0056b3;
}

/* Message Input */
.message-input {
  display: flex;
  gap: 10px;
  align-items: flex-end;
}

.message-input textarea {
  flex: 1;
  min-height: 40px;
  max-height: 120px;
  resize: vertical;
}

.file-input {
  position: relative;
  overflow: hidden;
  display: inline-block;
}

.file-input input[type=file] {
  position: absolute;
  left: -9999px;
}

/* Modals */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.modal-content {
  background: white;
  padding: 30px;
  border-radius: 15px;
  width: 90%;
  max-width: 500px;
  max-height: 80vh;
  overflow-y: auto;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.close-btn {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: #666;
}

/* QR Code */
.qr-container {
  text-align: center;
  padding: 20px;
}

.qr-container img {
  max-width: 300px;
  border: 2px solid #25d366;
  border-radius: 10px;
  margin: 20px 0;
}

/* Status Categories */
.status-filter {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.status-btn {
  padding: 8px 16px;
  border: 2px solid #e1e5e9;
  background: white;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.3s;
  font-size: 14px;
}

.status-btn.active {
  background: #25d366;
  color: white;
  border-color: #25d366;
}

/* Responsive */
@media (max-width: 768px) {
  .dashboard {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
  }
  
  .sidebar {
    order: 2;
    max-height: 300px;
  }
  
  .container {
    padding: 10px;
  }
  
  .auth-card {
    margin: 20px;
    padding: 30px;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Animations */
@keyframes pulse {
  0% { opacity: 1; }
  50% { opacity: 0.5; }
  100% { opacity: 1; }
}

.unread-indicator {
  animation: pulse 1.5s infinite;
}

/* Utilities */
.text-center { text-align: center; }
.text-success { color: #28a745; }
.text-danger { color: #dc3545; }
.text-warning { color: #ffc107; }
.text-info { color: #17a2b8; }

.mb-10 { margin-bottom: 10px; }
.mb-20 { margin-bottom: 20px; }
.mt-10 { margin-top: 10px; }
.mt-20 { margin-top: 20px; }

.hidden { display: none !important; }
.loading {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid #f3f3f3;
  border-top: 3px solid #25d366;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}