* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; background: #f0f2f5; color: #333; height: 100vh; overflow: hidden; }

.app-header { background: #2c3e50; color: white; padding: 12px 24px; display: flex; justify-content: space-between; align-items: center; }
.app-header h1 { font-size: 20px; }
.app-main { display: flex; height: calc(100vh - 52px); }
.sidebar { width: 380px; min-width: 380px; overflow-y: auto; padding: 16px; background: white; border-right: 1px solid #e0e0e0; }
.map-container { flex: 1; position: relative; }
#map { width: 100%; height: 100%; }

.panel { margin-bottom: 16px; padding: 16px; background: #f8f9fa; border-radius: 8px; }
.panel.hidden { display: none; }
.panel h2 { font-size: 16px; margin-bottom: 12px; color: #2c3e50; }

.drop-zone { border: 2px dashed #bdc3c7; border-radius: 8px; padding: 32px 16px; text-align: center; cursor: pointer; transition: border-color 0.2s; }
.drop-zone.drag-over { border-color: #3498db; background: #eaf2fd; }
.drop-icon { font-size: 36px; display: block; margin-bottom: 8px; }
.upload-preview img { width: 100%; max-height: 200px; object-fit: cover; border-radius: 8px; }
.preview-info { font-size: 13px; color: #666; margin: 8px 0; line-height: 1.6; }

.progress-bar { background: #eee; border-radius: 4px; height: 8px; margin-top: 12px; }
.progress-fill { background: #3498db; height: 100%; border-radius: 4px; width: 0; transition: width 0.3s; }
.progress-text { font-size: 12px; color: #666; margin-top: 4px; display: block; }
.progress-bar.hidden { display: none; }

.btn-primary { background: #3498db; color: white; border: none; padding: 10px 20px; border-radius: 6px; cursor: pointer; font-size: 14px; width: 100%; margin-top: 12px; }
.btn-primary:hover { background: #2980b9; }
.btn-primary:disabled { background: #bdc3c7; cursor: not-allowed; }
.btn-secondary { background: white; color: #2c3e50; border: 1px solid #ddd; padding: 8px 16px; border-radius: 6px; cursor: pointer; font-size: 13px; }
.btn-secondary:hover { background: #f0f0f0; }
.btn-ghost { background: none; border: 1px solid rgba(255,255,255,0.3); color: white; padding: 6px 16px; border-radius: 6px; cursor: pointer; font-size: 13px; }
.btn-ghost:hover { background: rgba(255,255,255,0.1); }
.btn-link { background: none; border: none; color: #3498db; cursor: pointer; text-decoration: underline; font-size: 14px; }
.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn-block { width: 100%; }

.map-controls { position: absolute; top: 10px; right: 10px; z-index: 1000; display: flex; flex-direction: column; gap: 4px; }

.result-actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.zone-stat-item { padding: 10px; margin-bottom: 8px; border-radius: 6px; border-left: 4px solid #bdc3c7; background: white; }
.zone-stat-item.alert-red { border-left-color: #e74c3c; background: #fdf0ef; }
.zone-stat-item.alert-yellow { border-left-color: #f39c12; background: #fef9e7; }
.zone-stat-item.alert-normal { border-left-color: #27ae60; background: #eafaf1; }
.zone-stat-item h3 { font-size: 14px; margin-bottom: 4px; }
.zone-stat-item .stats { font-size: 12px; color: #666; line-height: 1.6; }

.image-overlay { position: absolute; top: 10px; left: 10px; z-index: 1000; background: white; border-radius: 8px; padding: 16px; box-shadow: 0 4px 12px rgba(0,0,0,0.15); max-width: 60%; }
.image-overlay h3 { margin-bottom: 8px; }
.image-overlay img { max-width: 100%; max-height: 60vh; border-radius: 4px; }
.image-overlay.hidden { display: none; }
.btn-close-overlay { position: absolute; top: 8px; right: 8px; background: rgba(0,0,0,0.5); color: white; border: none; width: 28px; height: 28px; border-radius: 50%; cursor: pointer; font-size: 14px; }

.history-list { max-height: 200px; overflow-y: auto; }
.history-item { padding: 8px; border-bottom: 1px solid #eee; cursor: pointer; font-size: 13px; }
.history-item:hover { background: #f0f0f0; }

.modal { position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 2000; display: flex; align-items: center; justify-content: center; }
.modal.hidden { display: none; }
.modal-content { background: white; border-radius: 12px; padding: 24px; width: 400px; max-width: 90vw; }
.modal-content h2 { margin-bottom: 16px; }
.modal-content label { display: block; margin-bottom: 12px; font-size: 14px; color: #555; }
.modal-content input { width: 100%; padding: 8px 12px; border: 1px solid #ddd; border-radius: 6px; font-size: 14px; margin-top: 4px; }
.form-actions { display: flex; gap: 8px; margin-top: 16px; }

.text-muted { color: #999; }
.text-xs { font-size: 12px; }
.hidden { display: none; }
