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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background: #f5f7fa;
  color: #2d3748;
}

.screen {
  min-height: 100vh;
}

.hidden {
  display: none !important;
}

/* Login */
.login-container {
  max-width: 400px;
  margin: 100px auto;
  padding: 40px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.login-container h1 {
  text-align: center;
  margin-bottom: 30px;
  color: #1a73e8;
}

.login-container form {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.login-container input {
  padding: 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 14px;
}

.login-container button {
  padding: 12px;
  background: #1a73e8;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.login-container button:hover {
  background: #1557b0;
}

.error {
  color: #d32f2f;
  font-size: 13px;
  text-align: center;
}

/* Navbar */
.navbar {
  background: white;
  padding: 15px 30px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.navbar-brand h1 {
  font-size: 20px;
  color: #1a73e8;
}

.navbar-user {
  display: flex;
  align-items: center;
  gap: 15px;
}

.btn-secondary {
  padding: 8px 16px;
  background: #5f6368;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
}

.btn-secondary:hover {
  background: #494c50;
}

/* Container */
.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 30px;
}

.view {
  background: white;
  border-radius: 12px;
  padding: 30px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.header {
  margin-bottom: 30px;
}

.header h2 {
  font-size: 24px;
  margin-bottom: 20px;
}

/* Stats */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.stat-card {
  background: #f8f9fa;
  padding: 20px;
  border-radius: 8px;
  border-left: 4px solid #1a73e8;
}

.stat-value {
  font-size: 32px;
  font-weight: 700;
  color: #1a73e8;
  margin-bottom: 8px;
}

.stat-label {
  font-size: 14px;
  color: #666;
}

/* Installations Grid */
.installations-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

.installation-card {
  background: #f8f9fa;
  padding: 20px;
  border-radius: 8px;
  border: 2px solid #e0e0e0;
  cursor: pointer;
  transition: all 0.2s;
}

.installation-card:hover {
  border-color: #1a73e8;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.installation-card.active {
  border-color: #4caf50;
  background: #e8f5e9;
}

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

.installation-name {
  font-size: 18px;
  font-weight: 600;
  color: #2d3748;
}

.installation-status {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #4caf50;
}

.installation-status.offline {
  background: #ccc;
}

.installation-id {
  font-size: 11px;
  color: #666;
  font-family: monospace;
  margin-bottom: 10px;
}

.installation-stats {
  display: flex;
  gap: 15px;
  font-size: 13px;
}

.installation-stats div {
  color: #666;
}

.installation-stats strong {
  color: #1a73e8;
}

/* Tabs */
.tabs {
  display: flex;
  gap: 5px;
  border-bottom: 2px solid #e0e0e0;
  margin-bottom: 30px;
}

.tab {
  padding: 12px 24px;
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  color: #666;
}

.tab.active {
  color: #1a73e8;
  border-bottom-color: #1a73e8;
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* Live Indicator */
.live-indicator {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: #4caf50;
  color: white;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}

.pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: white;
  animation: pulse 2s infinite;
}

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

/* Filters */
.filters {
  display: flex;
  gap: 15px;
  margin-bottom: 20px;
}

.filters input,
.filters select {
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 13px;
}

.filters input {
  flex: 1;
}

/* Detections List */
.detections-list {
  max-height: 600px;
  overflow-y: auto;
}

.detection-item {
  padding: 15px;
  margin-bottom: 15px;
  background: #f8f9fa;
  border-left: 4px solid #2196f3;
  border-radius: 6px;
  font-size: 13px;
}

.detection-item.risk-high {
  border-left-color: #d32f2f;
  background: #ffebee;
}

.detection-item.risk-medium {
  border-left-color: #ff9800;
  background: #fff3e0;
}

.detection-item.risk-low {
  border-left-color: #4caf50;
  background: #e8f5e9;
}

.detection-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 10px;
}

.detection-method {
  font-family: 'SF Mono', 'Consolas', monospace;
  color: #1a73e8;
  font-weight: 600;
  font-size: 13px;
  flex: 1;
}

.detection-badges {
  display: flex;
  gap: 6px;
}

.badge {
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
  color: white;
  text-transform: uppercase;
}

.badge.risk-high { background: #d32f2f; }
.badge.risk-medium { background: #ff9800; }
.badge.risk-low { background: #4caf50; }
.badge.type { background: #5f6368; }

.detection-meta {
  color: #666;
  font-size: 12px;
  margin-bottom: 10px;
}

.detection-section {
  background: white;
  padding: 10px;
  border-radius: 4px;
  margin-top: 10px;
  font-family: 'SF Mono', monospace;
  font-size: 11px;
  max-height: 200px;
  overflow-y: auto;
}

.detection-section .section-title {
  font-weight: 600;
  margin-bottom: 8px;
  text-transform: uppercase;
  font-size: 10px;
  color: #333;
}

/* Stats Table */
.stats-table {
  max-height: 600px;
  overflow-y: auto;
}

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

.stats-table th {
  background: #f8f9fa;
  padding: 12px;
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  color: #666;
  position: sticky;
  top: 0;
}

.stats-table td {
  padding: 12px;
  border-bottom: 1px solid #e0e0e0;
  font-size: 13px;
}

.stats-table tr:hover {
  background: #f8f9fa;
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
}

.stat-panel {
  background: #f8f9fa;
  padding: 20px;
  border-radius: 8px;
}

.stat-panel h3 {
  font-size: 16px;
  margin-bottom: 15px;
  color: #2d3748;
}

.stat-row {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid #e0e0e0;
  font-size: 13px;
}

.stat-row:last-child {
  border-bottom: none;
}

.stat-row .label {
  color: #666;
}

.stat-row .value {
  font-weight: 600;
  color: #1a73e8;
}

/* Loading */
.loading {
  text-align: center;
  padding: 40px;
  color: #666;
}

.empty-state {
  text-align: center;
  padding: 60px;
  color: #999;
}

.empty-state-icon {
  font-size: 64px;
  margin-bottom: 20px;
  opacity: 0.3;
}
