* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #e8f5ea;
  color: #1f2937;
}
a { color: inherit; }

.app-shell {
  min-height: 100vh;
  padding: 24px;
}
.brand {
  color: #2f7c33;
  margin: 0 0 14px;
  font-size: 30px;
  font-weight: 700;
  text-align: center;
}
.card {
  background: #ffffff;
  border: 1px solid #d4e7d6;
  border-radius: 14px;
  box-shadow: 0 8px 24px rgba(47, 124, 51, 0.08);
  padding: 16px;
}

/* Auth */
.auth-wrap {
  max-width: 420px;
  margin: 48px auto;
}
.field-label {
  display: block;
  font-size: 13px;
  margin-bottom: 5px;
  color: #374151;
}
.field-input,
.field-select,
.field-textarea {
  width: 100%;
  border: 1px solid #c8ddca;
  border-radius: 10px;
  padding: 10px 12px;
  font: inherit;
  background: #fff;
}
.field-textarea {
  min-height: 120px;
  resize: vertical;
}
.primary-btn,
.secondary-btn,
.ghost-btn {
  border-radius: 10px;
  border: 1px solid transparent;
  padding: 10px 14px;
  font: inherit;
  cursor: pointer;
}
.primary-btn {
  background: #2f7c33;
  color: #fff;
}
.secondary-btn {
  background: #fff;
  border-color: #c8ddca;
  color: #2f7c33;
}
.ghost-btn {
  background: transparent;
  border-color: #c8ddca;
  color: #2f7c33;
}
.status-line {
  margin-top: 10px;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 13px;
}
.status-ok { background: #dcfce7; color: #166534; }
.status-err { background: #fee2e2; color: #991b1b; }

/* Panel */
.panel-layout {
  display: grid;
  grid-template-columns: 420px 1fr;
  gap: 16px;
  align-items: start;
}
.panel-title {
  margin: 0 0 6px;
  color: #2f7c33;
}
.row {
  display: grid;
  gap: 10px;
}
.row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.toolbar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.muted {
  color: #64748b;
  font-size: 12px;
}
.task-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}
.task-map-wrap {
  margin-top: 14px;
  border-top: 1px solid #d4e7d6;
  padding-top: 12px;
}
.task-map-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}
.task-map-title {
  margin: 0;
  color: #2f7c33;
  font-size: 16px;
}
.task-map {
  width: 100%;
  height: 300px;
  border: 1px solid #d4e7d6;
  border-radius: 10px;
  overflow: hidden;
  background: #f8fff9;
}
.task-item {
  border: 1px solid #d4e7d6;
  border-radius: 10px;
  padding: 10px;
  background: #fff;
  cursor: pointer;
}
.task-item.active {
  border-color: #2f7c33;
  box-shadow: 0 0 0 2px rgba(47, 124, 51, 0.12);
}
.task-item h4 {
  margin: 0 0 8px;
  font-size: 15px;
}
.task-meta {
  display: grid;
  gap: 4px;
  font-size: 13px;
}
.task-form {
  display: grid;
  gap: 10px;
}
.photo-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 10px;
  margin-top: 8px;
}
.photo-card {
  border: 1px solid #d4e7d6;
  border-radius: 10px;
  padding: 8px;
  background: #f8fff9;
}
.photo-preview {
  width: 100%;
  height: 120px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid #d4e7d6;
  background: #fff;
}
.photo-name {
  font-size: 12px;
  margin-top: 6px;
  word-break: break-all;
}
.photo-actions {
  margin-top: 8px;
  display: grid;
  gap: 6px;
}
.photo-actions button {
  width: 100%;
}
.photo-empty {
  font-size: 13px;
  border: 1px solid #d4e7d6;
  border-radius: 8px;
  padding: 6px 8px;
  background: #f8fff9;
  color: #64748b;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 1000;
}
.modal-card {
  width: min(980px, 100%);
  max-height: 90vh;
  overflow: auto;
  background: #ffffff;
  border: 1px solid #d4e7d6;
  border-radius: 14px;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.2);
  padding: 16px;
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.users-layout {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 12px;
  margin-top: 10px;
}
.users-list {
  margin-top: 8px;
  display: grid;
  gap: 8px;
}
.user-row {
  border: 1px solid #d4e7d6;
  border-radius: 10px;
  padding: 10px;
  background: #f8fff9;
}
.user-row h4 {
  margin: 0 0 6px;
  font-size: 14px;
}
.user-meta {
  display: grid;
  gap: 3px;
  font-size: 13px;
}
.user-actions {
  margin-top: 8px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

@media (max-width: 1100px) {
  .panel-layout {
    grid-template-columns: 1fr;
  }
  .row-2 {
    grid-template-columns: 1fr;
  }
  .users-layout {
    grid-template-columns: 1fr;
  }
}
