* {
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
  background: #f8f9fa;
  margin: 0;
  min-height: 100vh;
  color: #1a202c;
}

.dashboard-wrapper {
  display: flex;
  height: 100vh;
}

.sidebar {
  width: 220px;
  background: #ffffff;
  border-right: 1px solid #e5e7eb;
  display: flex;
  flex-direction: column;
  padding: 24px 0;
}

.sidebar-logo {
  font-size: 24px;
  font-weight: 700;
  color: #1a202c;
  padding: 0 24px 32px 24px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.sidebar-nav {
  flex: 1;
  padding: 0;
}

.sidebar-item {
  padding: 12px 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  color: #6b7280;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s;
  border-left: 3px solid transparent;
}

.sidebar-item:hover {
  background: #f9fafb;
  color: #1f2937;
}

.sidebar-item.active {
  background: #eff6ff;
  color: #2563eb;
  border-left-color: #2563eb;
}

.sidebar-item::before {
  width: 20px;
  font-size: 18px;
}

.sidebar-footer {
  padding: 16px 24px;
  border-top: 1px solid #e5e7eb;
}

.main-content {
  flex: 1;
  overflow-y: auto;
  background: #f8f9fa;
}

.top-bar {
  background: white;
  padding: 16px 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #e5e7eb;
}

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

.user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 600;
  font-size: 16px;
}

.container {
  padding: 32px;
  max-width: 100%;
}

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

h2 {
  margin: 0;
  font-size: 24px;
  font-weight: 600;
  color: #1a202c;
}

.section-title {
  font-size: 16px;
  font-weight: 600;
  color: #6b7280;
  margin: 24px 0 16px 0;
}

button {
  padding: 10px 20px;
  background: #2563eb;
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 500;
  font-size: 14px;
  transition: all 0.2s ease;
}

button:hover {
  background: #1d4ed8;
}

button:active {
  transform: scale(0.98);
}

.btn-outline {
  background: white;
  color: #6b7280;
  border: 1px solid #d1d5db;
}

.btn-outline:hover {
  background: #f9fafb;
  border-color: #9ca3af;
}

.add-button {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: white;
  color: #374151;
  border: 1px solid #d1d5db;
  font-size: 13px;
}

.add-button::before {
  content: '+';
  font-size: 18px;
  font-weight: 600;
}

.add-button:hover {
  background: #f9fafb;
}

input, select {
  padding: 10px 14px;
  width: 100%;
  margin-bottom: 16px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 14px;
  transition: all 0.2s ease;
  background: white;
}

input:focus, select:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.search-box {
  position: relative;
  margin-bottom: 20px;
  max-width: 300px;
}

.search-box input {
  margin-bottom: 0;
}

.table-container {
  background: white;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #e5e7eb;
}

table {
  width: 100%;
  border-collapse: collapse;
}

thead {
  background: #f9fafb;
  border-bottom: 1px solid #e5e7eb;
}

thead th {
  padding: 12px 16px;
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

tbody tr {
  border-bottom: 1px solid #f3f4f6;
  transition: background 0.2s;
}

tbody tr:hover {
  background: #f9fafb;
}

tbody tr:last-child {
  border-bottom: none;
}

tbody td {
  padding: 14px 16px;
  font-size: 14px;
  color: #374151;
}

tbody td:first-child {
  font-weight: 500;
  color: #1f2937;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
}

.status-badge.on {
  background: #dcfce7;
  color: #166534;
}

.status-badge.off {
  background: #fee2e2;
  color: #991b1b;
}

.action-buttons {
  display: flex;
  gap: 8px;
}

.action-btn {
  padding: 6px 16px;
  border-radius: 6px;
  background: white;
  border: 1px solid #d1d5db;
  color: #6b7280;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.action-btn:hover {
  background: #f9fafb;
  border-color: #9ca3af;
}

.action-btn.delete {
  color: #dc2626;
  border-color: #fca5a5;
}

.action-btn.delete:hover {
  background: #fef2f2;
  border-color: #f87171;
}

.icon-button {
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 6px;
  background: transparent;
  border: 1px solid #e5e7eb;
  color: #6b7280;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

.icon-button:hover {
  background: #f3f4f6;
  border-color: #d1d5db;
}

.danger {
  background: #dc2626;
  color: white;
}

.danger:hover {
  background: #b91c1c;
}

.icon-button.danger {
  background: transparent;
  color: #dc2626;
  border-color: #fecaca;
}

.icon-button.danger:hover {
  background: #fef2f2;
  border-color: #fca5a5;
}
