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

body { 
  font-family: 'Roboto', 'Google Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
  background: #f5f7fa;
  color: #2c3e50;
  line-height: 1.6;
  padding: 0;
  margin: 0;
  min-height: 100vh;
}

/* Sidebar Navigation */
.sidebar {
  position: fixed;
  left: 0;
  top: 0;
  height: 100vh;
  width: 240px;
  background: #2c3e50;
  color: white;
  overflow-y: auto;
  z-index: 1000;
  box-shadow: 2px 0 8px rgba(0,0,0,0.1);
}

.sidebar-header {
  padding: 24px 20px;
  background: #1a252f;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-header h1 {
  font-size: 20px;
  font-weight: 500;
  color: white;
  margin: 0;
}

.sidebar-menu {
  padding: 16px 0;
}

.sidebar-menu a {
  display: flex;
  align-items: center;
  padding: 12px 20px;
  color: rgba(255,255,255,0.7);
  text-decoration: none;
  transition: all 0.3s;
  font-size: 14px;
}

.sidebar-menu a:hover,
.sidebar-menu a.active {
  background: rgba(255,255,255,0.1);
  color: white;
}

.sidebar-menu a span {
  margin-right: 12px;
}

/* Main Content */
.main-content {
  margin-left: 240px;
  min-height: 100vh;
}

/* Header */
.header {
  background: white;
  box-shadow: 0 2px 4px rgba(0,0,0,0.08);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 32px;
  height: 64px;
}

.header h1 {
  font-size: 20px;
  font-weight: 500;
  color: #2c3e50;
  margin: 0;
}

.btn-logout {
  padding: 8px 20px;
  background: #e74c3c;
  color: white;
  text-decoration: none;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 500;
  transition: background 0.2s;
}

.btn-logout:hover {
  background: #c0392b;
}

/* Container */
.container {
  padding: 32px;
}

/* Stats Cards */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px;
  margin-bottom: 32px;
}

.stat-card {
  background: white;
  padding: 24px;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}

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

.stat-card-title {
  font-size: 14px;
  color: #7f8c8d;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 500;
}

.stat-card-icon {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}

.stat-card-icon.blue { background: #e3f2fd; color: #2196f3; }
.stat-card-icon.green { background: #e8f5e9; color: #4caf50; }
.stat-card-icon.orange { background: #fff3e0; color: #ff9800; }
.stat-card-icon.purple { background: #f3e5f5; color: #9c27b0; }

.stat-card-value {
  font-size: 32px;
  font-weight: 600;
  color: #2c3e50;
  margin-bottom: 4px;
}

.stat-card-label {
  font-size: 13px;
  color: #95a5a6;
}

/* Section Headers */
h2 { 
  font-size: 18px;
  font-weight: 600;
  color: #2c3e50;
  margin: 32px 0 16px 0;
  letter-spacing: 0;
}

/* Cards */
.section-card {
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  margin-bottom: 24px;
  overflow: hidden;
}

.section-card-header {
  padding: 20px 24px;
  border-bottom: 1px solid #ecf0f1;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.section-card-header h3 {
  font-size: 16px;
  font-weight: 600;
  color: #2c3e50;
  margin: 0;
}

.section-card-body {
  padding: 0;
}

/* Tables */
table { 
  width: 100%; 
  border-collapse: collapse;
  background: transparent;
}

th, td { 
  padding: 16px 24px; 
  text-align: left; 
  border-bottom: 1px solid #ecf0f1;
}

th { 
  background: #f8f9fa; 
  font-weight: 600;
  color: #7f8c8d;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

td {
  color: #2c3e50;
  font-size: 14px;
}

tbody tr {
  transition: background 0.2s;
}

tbody tr:hover { 
  background: #f8f9fa;
}

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

/* Form Card */
.pair-form {
  background: white;
  padding: 24px;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  margin-bottom: 32px;
}

.pair-form h3 {
  font-size: 16px;
  font-weight: 600;
  color: #2c3e50;
  margin: 0 0 20px 0;
}

.pair-form-group {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.pair-form input {
  padding: 12px 16px;
  border: 1px solid #dfe6e9;
  border-radius: 4px;
  font-size: 14px;
  min-width: 200px;
  transition: all 0.2s;
  font-family: inherit;
  color: #2c3e50;
}

.pair-form input:focus {
  outline: none;
  border-color: #3498db;
  box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.pair-form button {
  padding: 12px 28px;
  background: #3498db;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s;
  box-shadow: 0 2px 4px rgba(52, 152, 219, 0.3);
}

.pair-form button:hover {
  background: #2980b9;
  box-shadow: 0 4px 8px rgba(52, 152, 219, 0.4);
  transform: translateY(-1px);
}

.pair-form button:active {
  background: #2574a9;
  transform: translateY(0);
}

/* Status badges */
.status { 
  display: inline-block;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.3px;
}

.status.on { 
  background: #d5f4e6; 
  color: #27ae60; 
}

.status.off { 
  background: #fadbd8; 
  color: #e74c3c; 
}

.timestamp { 
  color: #95a5a6; 
  font-size: 13px; 
}

/* Responsive */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-240px);
  }
  
  .main-content {
    margin-left: 0;
  }
  
  .stats-grid {
    grid-template-columns: 1fr;
  }
}

/* Device Status Indicators */
.device-status {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.3px;
}

.status-online {
  background: #d5f4e6;
  color: #27ae60;
}

.status-recent {
  background: #fff3cd;
  color: #f39c12;
}

.status-offline {
  background: #fadbd8;
  color: #e74c3c;
}

.status-unknown {
  background: #ecf0f1;
  color: #95a5a6;
}

/* Battery Indicators */
.battery-indicator {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 500;
}

.battery-good {
  color: #27ae60;
}

.battery-medium {
  color: #f39c12;
}

.battery-low {
  color: #e67e22;
}

.battery-critical {
  color: #e74c3c;
  font-weight: 600;
}
