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

body {
  width: 400px;
  min-height: 500px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 13px;
  color: #1a1a1a;
  background: #f5f5f7;
}

.header {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  color: white;
  padding: 16px;
  text-align: center;
}

.header h1 {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 4px;
}

.subtitle {
  font-size: 11px;
  opacity: 0.8;
}

.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 12px;
}

.stat-card {
  background: white;
  border-radius: 8px;
  padding: 10px;
  text-align: center;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.stat-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #666;
  margin-bottom: 4px;
}

.stat-value {
  font-size: 22px;
  font-weight: 700;
  color: #1a1a2e;
}

.stat-badge {
  display: inline-block;
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 12px;
  margin-top: 4px;
  font-weight: 600;
  text-transform: uppercase;
}

.stat-badge.compliant {
  background: #dcfce7;
  color: #166534;
}

.stat-badge.at-risk {
  background: #fef9c3;
  color: #854d0e;
}

.stat-badge.non-compliant {
  background: #fee2e2;
  color: #991b1b;
}

#risk-card {
  grid-column: 1 / -1;
}

#risk-card .stat-value {
  font-size: 32px;
  color: #dc2626;
}

.tabs {
  display: flex;
  border-bottom: 1px solid #e5e5e5;
  background: white;
}

.tab-btn {
  flex: 1;
  padding: 10px;
  border: none;
  background: none;
  font-size: 12px;
  font-weight: 600;
  color: #666;
  cursor: pointer;
  transition: all 0.2s;
}

.tab-btn:hover {
  color: #1a1a2e;
}

.tab-btn.active {
  color: #1a1a2e;
  border-bottom: 2px solid #dc2626;
}

.tab-content {
  padding: 12px;
  max-height: 280px;
  overflow-y: auto;
}

.tab-content.hidden {
  display: none;
}

.search-bar {
  margin-bottom: 8px;
}

.search-bar input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #e5e5e5;
  border-radius: 6px;
  font-size: 12px;
  outline: none;
}

.search-bar input:focus {
  border-color: #dc2626;
}

.list-container {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.empty {
  text-align: center;
  padding: 24px;
  color: #999;
  font-size: 12px;
}

.item-card {
  background: white;
  border-radius: 6px;
  padding: 10px;
  border-left: 3px solid #ccc;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.item-card.severity-info {
  border-left-color: #3b82f6;
}

.item-card.severity-low {
  border-left-color: #22c55e;
}

.item-card.severity-medium {
  border-left-color: #eab308;
}

.item-card.severity-high {
  border-left-color: #f97316;
}

.item-card.severity-critical {
  border-left-color: #dc2626;
  background: #fef2f2;
}

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

.item-title {
  font-weight: 600;
  font-size: 12px;
}

.item-badge {
  font-size: 9px;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 600;
  text-transform: uppercase;
}

.item-badge.severity-info {
  background: #dbeafe;
  color: #1e40af;
}

.item-badge.severity-low {
  background: #dcfce7;
  color: #166534;
}

.item-badge.severity-medium {
  background: #fef9c3;
  color: #854d0e;
}

.item-badge.severity-high {
  background: #ffedd5;
  color: #9a3412;
}

.item-badge.severity-critical {
  background: #fee2e2;
  color: #991b1b;
}

.item-meta {
  font-size: 11px;
  color: #666;
  margin-bottom: 2px;
}

.item-desc {
  font-size: 11px;
  color: #444;
  line-height: 1.4;
}

.policy-editor {
  background: white;
  border-radius: 8px;
  padding: 12px;
}

.rule-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid #f0f0f0;
}

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

.rule-name {
  font-weight: 600;
  font-size: 12px;
}

.rule-type {
  font-size: 10px;
  color: #888;
}

.toggle-switch {
  position: relative;
  width: 36px;
  height: 20px;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: #ccc;
  border-radius: 20px;
  transition: 0.3s;
}

.toggle-slider:before {
  content: "";
  position: absolute;
  height: 14px;
  width: 14px;
  left: 3px;
  bottom: 3px;
  background: white;
  border-radius: 50%;
  transition: 0.3s;
}

.toggle-switch input:checked + .toggle-slider {
  background: #dc2626;
}

.toggle-switch input:checked + .toggle-slider:before {
  transform: translateX(16px);
}

.btn-primary {
  width: 100%;
  padding: 10px;
  background: #dc2626;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 12px;
}

.btn-primary:hover {
  background: #b91c1c;
}

.btn-secondary {
  width: 100%;
  padding: 10px;
  background: #f3f4f6;
  color: #374151;
  border: none;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 8px;
}

.btn-secondary:hover {
  background: #e5e7eb;
}

.footer {
  display: flex;
  justify-content: space-between;
  padding: 12px;
  border-top: 1px solid #e5e5e5;
  background: white;
}

.btn-link {
  background: none;
  border: none;
  color: #666;
  font-size: 11px;
  cursor: pointer;
  text-decoration: underline;
}

.btn-link:hover {
  color: #1a1a2e;
}

.status-message {
  position: fixed;
  bottom: 60px;
  left: 50%;
  transform: translateX(-50%);
  background: #1a1a2e;
  color: white;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 12px;
  z-index: 100;
  animation: fadeInOut 2s ease;
}

@keyframes fadeInOut {
  0% { opacity: 0; transform: translateX(-50%) translateY(10px); }
  20% { opacity: 1; transform: translateX(-50%) translateY(0); }
  80% { opacity: 1; transform: translateX(-50%) translateY(0); }
  100% { opacity: 0; transform: translateX(-50%) translateY(-10px); }
}
